chore(backend): 落地 ADS 治理体系、升级日志并收录后端模板基线代码
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
package abacus.springboot.example;
|
||||
|
||||
import org.apache.http.client.HttpClient;
|
||||
import org.apache.http.client.config.RequestConfig;
|
||||
import org.apache.http.impl.client.HttpClientBuilder;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.autoconfigure.domain.EntityScan;
|
||||
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
|
||||
import org.springframework.http.client.ClientHttpRequestFactory;
|
||||
import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
import abacus.commons.responsebody.wrapper.ResultResponseBodyWrapper;
|
||||
|
||||
@SpringBootApplication
|
||||
@EnableDiscoveryClient
|
||||
// @EnableHystrix
|
||||
// 配置扫描
|
||||
@ComponentScan(basePackages = { "abacus.springboot.example", "abacus.springboot.example.*" })
|
||||
// 指定加载的repository 否则不能加载外部的repository
|
||||
@EnableJpaRepositories(basePackages = { "abacus.springboot.example.*", })
|
||||
// 指定加载的外部entity 否则不能加载外部的entity
|
||||
@EntityScan(basePackages = { "abacus.springboot.example.*", "com.abacus.pms.*", "com.abacus.xpos.foundation.dao" })
|
||||
//指定加载外部Feign
|
||||
@EnableFeignClients("abacus.springboot.example.feign")
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(Application.class, args);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ResultResponseBodyWrapper getResultResponseBodyWrapper() {
|
||||
return new ResultResponseBodyWrapper();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public RestTemplate getRestTemplate() {
|
||||
|
||||
RequestConfig config = RequestConfig.custom().setConnectTimeout(5000).setSocketTimeout(5000).build();
|
||||
|
||||
HttpClient httpClient = HttpClientBuilder.create().setDefaultRequestConfig(config).build();
|
||||
|
||||
ClientHttpRequestFactory requestFactory = new HttpComponentsClientHttpRequestFactory(httpClient);
|
||||
|
||||
// SimpleClientHttpRequestFactory re = new
|
||||
// SimpleClientHttpRequestFactory();
|
||||
// re.setConnectTimeout(5000);
|
||||
// re.setReadTimeout(5000);
|
||||
return new RestTemplate(requestFactory);
|
||||
|
||||
}
|
||||
}
|
||||
+1621
File diff suppressed because it is too large
Load Diff
+1722
File diff suppressed because it is too large
Load Diff
+390
@@ -0,0 +1,390 @@
|
||||
package abacus.springboot.example.api.view;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import abacus.springboot.example.dao.JcBillPhoto;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
@Schema(description = "回购主单" , name = "ApiBillHg")
|
||||
public class ApiBillHg {
|
||||
|
||||
@Schema(description="回购单单号", required = false, example="HG202411180001")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "稽查单号", required = false, example = "JC202411180001")
|
||||
private String billid;
|
||||
|
||||
@Schema(description="状态", required = false, pattern = "待提交:1,待付款:2,待分仓(已付款):3,已分仓(待出库):4,已出库:5", example = "1")
|
||||
private int status;
|
||||
|
||||
@Schema(description = "订单来源", required = false, example = "掌上华致")
|
||||
private String source;
|
||||
|
||||
@Schema(description = "客户编码", required = false, example = "20200089")
|
||||
private String account;
|
||||
|
||||
@Schema(description = "客户名称", required = false, example = "广东众之品酒有限公司")
|
||||
private String accountname;
|
||||
|
||||
@Schema(description = "总数量", required = false, example = "6")
|
||||
private double quantity;
|
||||
|
||||
@Schema(description = "总金额", required = false, example = "4800")
|
||||
private double subtotal;
|
||||
|
||||
@Schema(description = "运费", required = false, example = "50")
|
||||
private double freight;
|
||||
|
||||
@Schema(description = "运营经理编码", required = false, example = "zhangsan")
|
||||
private String manager;
|
||||
|
||||
@Schema(description = "运营经理名称", required = false, example = "张三")
|
||||
private String managername;
|
||||
|
||||
@Schema(description = "收货人姓名", required = false, example = "李四")
|
||||
private String consignee;
|
||||
|
||||
@Schema(description = "收货人电话", required = false, example = "1888888888")
|
||||
private String consigneephone;
|
||||
|
||||
@Schema(description = "省", required = false, example = "10001")
|
||||
private String province;
|
||||
|
||||
@Schema(description = "省", required = false, example = "广东")
|
||||
private String provincename;
|
||||
|
||||
@Schema(description = "市", required = false, example = "1000101")
|
||||
private String city;
|
||||
|
||||
@Schema(description = "市", required = false, example = "广州")
|
||||
private String cityname;
|
||||
|
||||
@Schema(description = "区", required = false, example = "100010101")
|
||||
private String area;
|
||||
|
||||
@Schema(description = "区", required = false, example = "越秀区")
|
||||
private String areaname;
|
||||
|
||||
@Schema(description = "详细地址", required = false, example = "东风24路")
|
||||
private String address;
|
||||
|
||||
@Schema(description = "收货方式", required = false, example = "送货上门")
|
||||
private String receiveway;
|
||||
|
||||
@Schema(description = "订单备注", required = false, example = "订单备注~~~")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "运营备注", required = false, example = "运营备注~~~")
|
||||
private String remark1;
|
||||
|
||||
@Schema(description = "物流公司名称", required = false, example = "京东快递")
|
||||
private String logisticsname;
|
||||
|
||||
@Schema(description = "物流公司代码", required = false, example = "JD")
|
||||
private String logisticscode;
|
||||
|
||||
@Schema(description = "物流方式", required = false, example = "")
|
||||
private String logisticstype;
|
||||
|
||||
@Schema(description = "物流单号", required = false, example = "JD00001")
|
||||
private String logisticsno;
|
||||
|
||||
@Schema(description="回购明细", required = false, example="")
|
||||
private List<ApiBillHgItem> items;
|
||||
|
||||
@Schema(description="回购支付明细", required = false, example="")
|
||||
private List<ApiBillHgPayment> payments;
|
||||
|
||||
@Schema(description="回购通知函", required = false, example="")
|
||||
private List<JcBillPhoto> tzhUrl;
|
||||
|
||||
@Schema(description="违规回购通知函", required = false, example="")
|
||||
private List<JcBillPhoto> wgtzhUrl;
|
||||
|
||||
@Schema(description="支付凭证", required = false, example="")
|
||||
private List<JcBillPhoto> zfpzUrl;
|
||||
|
||||
@Schema(description="回购通知函", required = false, example="")
|
||||
private String tzhUrls;
|
||||
//
|
||||
// @Schema(description="违规回购通知函", required = false, example="")
|
||||
// private String wgtzhUrl;
|
||||
//
|
||||
// @Schema(description="支付凭证", required = false, example="")
|
||||
// private List<String> zfpzUrl;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public String getTzhUrls() {
|
||||
return tzhUrls;
|
||||
}
|
||||
|
||||
public void setTzhUrls(String tzhUrls) {
|
||||
this.tzhUrls = tzhUrls;
|
||||
}
|
||||
|
||||
public List<JcBillPhoto> getTzhUrl() {
|
||||
return tzhUrl;
|
||||
}
|
||||
|
||||
public void setTzhUrl(List<JcBillPhoto> tzhUrl) {
|
||||
this.tzhUrl = tzhUrl;
|
||||
}
|
||||
|
||||
public List<JcBillPhoto> getWgtzhUrl() {
|
||||
return wgtzhUrl;
|
||||
}
|
||||
|
||||
public void setWgtzhUrl(List<JcBillPhoto> wgtzhUrl) {
|
||||
this.wgtzhUrl = wgtzhUrl;
|
||||
}
|
||||
|
||||
public List<JcBillPhoto> getZfpzUrl() {
|
||||
return zfpzUrl;
|
||||
}
|
||||
|
||||
public void setZfpzUrl(List<JcBillPhoto> zfpzUrl) {
|
||||
this.zfpzUrl = zfpzUrl;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getBillid() {
|
||||
return billid;
|
||||
}
|
||||
|
||||
public void setBillid(String billid) {
|
||||
this.billid = billid;
|
||||
}
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(int status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getSource() {
|
||||
return source;
|
||||
}
|
||||
|
||||
public void setSource(String source) {
|
||||
this.source = source;
|
||||
}
|
||||
|
||||
public String getAccount() {
|
||||
return account;
|
||||
}
|
||||
|
||||
public void setAccount(String account) {
|
||||
this.account = account;
|
||||
}
|
||||
|
||||
public String getAccountname() {
|
||||
return accountname;
|
||||
}
|
||||
|
||||
public void setAccountname(String accountname) {
|
||||
this.accountname = accountname;
|
||||
}
|
||||
|
||||
public double getQuantity() {
|
||||
return quantity;
|
||||
}
|
||||
|
||||
public void setQuantity(double quantity) {
|
||||
this.quantity = quantity;
|
||||
}
|
||||
|
||||
public double getSubtotal() {
|
||||
return subtotal;
|
||||
}
|
||||
|
||||
public void setSubtotal(double subtotal) {
|
||||
this.subtotal = subtotal;
|
||||
}
|
||||
|
||||
public double getFreight() {
|
||||
return freight;
|
||||
}
|
||||
|
||||
public void setFreight(double freight) {
|
||||
this.freight = freight;
|
||||
}
|
||||
|
||||
public String getManager() {
|
||||
return manager;
|
||||
}
|
||||
|
||||
public void setManager(String manager) {
|
||||
this.manager = manager;
|
||||
}
|
||||
|
||||
public String getManagername() {
|
||||
return managername;
|
||||
}
|
||||
|
||||
public void setManagername(String managername) {
|
||||
this.managername = managername;
|
||||
}
|
||||
|
||||
public String getConsignee() {
|
||||
return consignee;
|
||||
}
|
||||
|
||||
public void setConsignee(String consignee) {
|
||||
this.consignee = consignee;
|
||||
}
|
||||
|
||||
public String getConsigneephone() {
|
||||
return consigneephone;
|
||||
}
|
||||
|
||||
public void setConsigneephone(String consigneephone) {
|
||||
this.consigneephone = consigneephone;
|
||||
}
|
||||
|
||||
public String getProvince() {
|
||||
return province;
|
||||
}
|
||||
|
||||
public void setProvince(String province) {
|
||||
this.province = province;
|
||||
}
|
||||
|
||||
public String getProvincename() {
|
||||
return provincename;
|
||||
}
|
||||
|
||||
public void setProvincename(String provincename) {
|
||||
this.provincename = provincename;
|
||||
}
|
||||
|
||||
public String getCity() {
|
||||
return city;
|
||||
}
|
||||
|
||||
public void setCity(String city) {
|
||||
this.city = city;
|
||||
}
|
||||
|
||||
public String getCityname() {
|
||||
return cityname;
|
||||
}
|
||||
|
||||
public void setCityname(String cityname) {
|
||||
this.cityname = cityname;
|
||||
}
|
||||
|
||||
public String getArea() {
|
||||
return area;
|
||||
}
|
||||
|
||||
public void setArea(String area) {
|
||||
this.area = area;
|
||||
}
|
||||
|
||||
public String getAreaname() {
|
||||
return areaname;
|
||||
}
|
||||
|
||||
public void setAreaname(String areaname) {
|
||||
this.areaname = areaname;
|
||||
}
|
||||
|
||||
public String getAddress() {
|
||||
return address;
|
||||
}
|
||||
|
||||
public void setAddress(String address) {
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
public String getReceiveway() {
|
||||
return receiveway;
|
||||
}
|
||||
|
||||
public void setReceiveway(String receiveway) {
|
||||
this.receiveway = receiveway;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public String getRemark1() {
|
||||
return remark1;
|
||||
}
|
||||
|
||||
public void setRemark1(String remark1) {
|
||||
this.remark1 = remark1;
|
||||
}
|
||||
|
||||
public String getLogisticsname() {
|
||||
return logisticsname;
|
||||
}
|
||||
|
||||
public void setLogisticsname(String logisticsname) {
|
||||
this.logisticsname = logisticsname;
|
||||
}
|
||||
|
||||
public String getLogisticscode() {
|
||||
return logisticscode;
|
||||
}
|
||||
|
||||
public void setLogisticscode(String logisticscode) {
|
||||
this.logisticscode = logisticscode;
|
||||
}
|
||||
|
||||
public String getLogisticstype() {
|
||||
return logisticstype;
|
||||
}
|
||||
|
||||
public void setLogisticstype(String logisticstype) {
|
||||
this.logisticstype = logisticstype;
|
||||
}
|
||||
|
||||
public String getLogisticsno() {
|
||||
return logisticsno;
|
||||
}
|
||||
|
||||
public void setLogisticsno(String logisticsno) {
|
||||
this.logisticsno = logisticsno;
|
||||
}
|
||||
|
||||
public List<ApiBillHgItem> getItems() {
|
||||
return items;
|
||||
}
|
||||
|
||||
public void setItems(List<ApiBillHgItem> items) {
|
||||
this.items = items;
|
||||
}
|
||||
|
||||
public List<ApiBillHgPayment> getPayments() {
|
||||
return payments;
|
||||
}
|
||||
|
||||
public void setPayments(List<ApiBillHgPayment> payments) {
|
||||
this.payments = payments;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
package abacus.springboot.example.api.view;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
@Schema(description = "回购Id列表" , name = "ApiBillHgId")
|
||||
public class ApiBillHgId {
|
||||
|
||||
@Schema(description="回购单单号", required = false, example="HG202411180001")
|
||||
private String id;
|
||||
|
||||
public ApiBillHgId() {
|
||||
super();
|
||||
}
|
||||
|
||||
public ApiBillHgId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
}
|
||||
+130
@@ -0,0 +1,130 @@
|
||||
package abacus.springboot.example.api.view;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
@Schema(description = "回购明细" , name = "ApiBillHgItem")
|
||||
public class ApiBillHgItem {
|
||||
|
||||
@Schema(description = "明细序号", required = false, hidden = true, example = "2")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "状态", required = false, pattern = "终止:-1,待通知回购:1,已通知回购:2", example = "2")
|
||||
private int status;
|
||||
|
||||
@Schema(description = "商品编码", required = false, example = "00001")
|
||||
private String product;
|
||||
|
||||
@Schema(description = "商品名称", required = false, example = "钓鱼台")
|
||||
private String productname;
|
||||
|
||||
@Schema(description = "商品规格", required = false, example = "500ml*6")
|
||||
private String spec;
|
||||
|
||||
@Schema(description = "商品图片地址", required = false, example = "")
|
||||
private JSONObject productphoto;
|
||||
|
||||
@Schema(description = "收货单价", required = false, example = "10")
|
||||
private double price;
|
||||
|
||||
@Schema(description = "入库数量", required = false, example = "1")
|
||||
private double quantity;
|
||||
|
||||
@Schema(description = "入库件数", required = false, example = "1")
|
||||
private double numbers;
|
||||
|
||||
@Schema(description = "回购单价", required = false, example = "100")
|
||||
private double hgprice;
|
||||
|
||||
@Schema(description = "回购金额", required = false, example = "100")
|
||||
private double hgamount;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public JSONObject getProductphoto() {
|
||||
return productphoto;
|
||||
}
|
||||
|
||||
public void setProductphoto(JSONObject productphoto) {
|
||||
this.productphoto = productphoto;
|
||||
}
|
||||
|
||||
public String getSpec() {
|
||||
return spec;
|
||||
}
|
||||
|
||||
public void setSpec(String spec) {
|
||||
this.spec = spec;
|
||||
}
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(int status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getProduct() {
|
||||
return product;
|
||||
}
|
||||
|
||||
public void setProduct(String product) {
|
||||
this.product = product;
|
||||
}
|
||||
|
||||
public String getProductname() {
|
||||
return productname;
|
||||
}
|
||||
|
||||
public void setProductname(String productname) {
|
||||
this.productname = productname;
|
||||
}
|
||||
|
||||
public double getPrice() {
|
||||
return price;
|
||||
}
|
||||
|
||||
public void setPrice(double price) {
|
||||
this.price = price;
|
||||
}
|
||||
|
||||
public double getQuantity() {
|
||||
return quantity;
|
||||
}
|
||||
|
||||
public void setQuantity(double quantity) {
|
||||
this.quantity = quantity;
|
||||
}
|
||||
|
||||
public double getNumbers() {
|
||||
return numbers;
|
||||
}
|
||||
|
||||
public void setNumbers(double numbers) {
|
||||
this.numbers = numbers;
|
||||
}
|
||||
|
||||
public double getHgprice() {
|
||||
return hgprice;
|
||||
}
|
||||
|
||||
public void setHgprice(double hgprice) {
|
||||
this.hgprice = hgprice;
|
||||
}
|
||||
|
||||
public double getHgamount() {
|
||||
return hgamount;
|
||||
}
|
||||
|
||||
public void setHgamount(double hgamount) {
|
||||
this.hgamount = hgamount;
|
||||
}
|
||||
}
|
||||
+74
@@ -0,0 +1,74 @@
|
||||
package abacus.springboot.example.api.view;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
@Schema(description = "回购支付明细" , name = "ApiBillHgPayment")
|
||||
public class ApiBillHgPayment {
|
||||
|
||||
@Schema(description = "回购单号", required = false, example = "线下支付")
|
||||
private String billhg;
|
||||
|
||||
@Schema(description = "支付方式", required = false, example = "线下支付")
|
||||
private String payment;
|
||||
|
||||
@Schema(description = "支付金额", required = false, example = "1000")
|
||||
private Double amount;
|
||||
|
||||
@Schema(description = "账号名称", required = false, example = "张三")
|
||||
private String zhmc;
|
||||
|
||||
@Schema(description = "开发银行", required = false, example = "工商银行")
|
||||
private String khyh;
|
||||
|
||||
@Schema(description = "银行账号", required = false, example = "10102010201201021020101")
|
||||
private String yhzh;
|
||||
|
||||
|
||||
public String getBillhg() {
|
||||
return billhg;
|
||||
}
|
||||
|
||||
public void setBillhg(String billhg) {
|
||||
this.billhg = billhg;
|
||||
}
|
||||
|
||||
public String getPayment() {
|
||||
return payment;
|
||||
}
|
||||
|
||||
public void setPayment(String payment) {
|
||||
this.payment = payment;
|
||||
}
|
||||
|
||||
public Double getAmount() {
|
||||
return amount;
|
||||
}
|
||||
|
||||
public void setAmount(Double amount) {
|
||||
this.amount = amount;
|
||||
}
|
||||
|
||||
public String getZhmc() {
|
||||
return zhmc;
|
||||
}
|
||||
|
||||
public void setZhmc(String zhmc) {
|
||||
this.zhmc = zhmc;
|
||||
}
|
||||
|
||||
public String getKhyh() {
|
||||
return khyh;
|
||||
}
|
||||
|
||||
public void setKhyh(String khyh) {
|
||||
this.khyh = khyh;
|
||||
}
|
||||
|
||||
public String getYhzh() {
|
||||
return yhzh;
|
||||
}
|
||||
|
||||
public void setYhzh(String yhzh) {
|
||||
this.yhzh = yhzh;
|
||||
}
|
||||
}
|
||||
+142
@@ -0,0 +1,142 @@
|
||||
package abacus.springboot.example.api.view;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
@Schema(description = "稽查收货主单" , name = "ApiJcBill")
|
||||
public class ApiJcBill {
|
||||
|
||||
@Schema(description="稽查单号", required = false, example="JC202411180001")
|
||||
private String id;
|
||||
|
||||
@Schema(description="状态", required = false, pattern = "溯源驳回:-2,待提交:0,系统溯源验证通过:1,待溯源:2,待入库:3,入库待审核:4,已入库:5 ,部分回购:6,回购完成:7", example = "1")
|
||||
private int status;
|
||||
|
||||
@Schema(description = "收货产品", required = false, example = "钓鱼台")
|
||||
private String goods;
|
||||
|
||||
@Schema(description = "收货仓库编码", required = false, example = "9090025")
|
||||
private String warehouse;
|
||||
|
||||
@Schema(description = "收货仓库名称", required = false, example = "精品广州库")
|
||||
private String warehousename;
|
||||
|
||||
@Schema(description = "收货日期", required = false, example = "2024-11-11")
|
||||
private String receivedt;
|
||||
|
||||
@Schema(description = "收货数量", required = false, example = "10")
|
||||
private double quantity;
|
||||
|
||||
@Schema(description = "收货总金额", required = false, example = "9609")
|
||||
private double subtotal;
|
||||
|
||||
@Schema(description = "申请人编码", required = false, example = "zhangsan")
|
||||
private String applicant;
|
||||
|
||||
@Schema(description = "申请人名称", required = false, example = "张三")
|
||||
private String applicantname;
|
||||
|
||||
@Schema(description = "申请人时间", required = false, example = "2024-11-11 00:00:00")
|
||||
private Date applicantdt;
|
||||
|
||||
@Schema(description="稽查收货明细", required = false, example="")
|
||||
private List<ApiJcBillItem> items;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(int status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getGoods() {
|
||||
return goods;
|
||||
}
|
||||
|
||||
public void setGoods(String goods) {
|
||||
this.goods = goods;
|
||||
}
|
||||
|
||||
public String getWarehouse() {
|
||||
return warehouse;
|
||||
}
|
||||
|
||||
public void setWarehouse(String warehouse) {
|
||||
this.warehouse = warehouse;
|
||||
}
|
||||
|
||||
public String getWarehousename() {
|
||||
return warehousename;
|
||||
}
|
||||
|
||||
public void setWarehousename(String warehousename) {
|
||||
this.warehousename = warehousename;
|
||||
}
|
||||
|
||||
public String getReceivedt() {
|
||||
return receivedt;
|
||||
}
|
||||
|
||||
public void setReceivedt(String receivedt) {
|
||||
this.receivedt = receivedt;
|
||||
}
|
||||
|
||||
public double getQuantity() {
|
||||
return quantity;
|
||||
}
|
||||
|
||||
public void setQuantity(double quantity) {
|
||||
this.quantity = quantity;
|
||||
}
|
||||
|
||||
public double getSubtotal() {
|
||||
return subtotal;
|
||||
}
|
||||
|
||||
public void setSubtotal(double subtotal) {
|
||||
this.subtotal = subtotal;
|
||||
}
|
||||
|
||||
public String getApplicant() {
|
||||
return applicant;
|
||||
}
|
||||
|
||||
public void setApplicant(String applicant) {
|
||||
this.applicant = applicant;
|
||||
}
|
||||
|
||||
public String getApplicantname() {
|
||||
return applicantname;
|
||||
}
|
||||
|
||||
public void setApplicantname(String applicantname) {
|
||||
this.applicantname = applicantname;
|
||||
}
|
||||
|
||||
public Date getApplicantdt() {
|
||||
return applicantdt;
|
||||
}
|
||||
|
||||
public void setApplicantdt(Date applicantdt) {
|
||||
this.applicantdt = applicantdt;
|
||||
}
|
||||
|
||||
public List<ApiJcBillItem> getItems() {
|
||||
return items;
|
||||
}
|
||||
|
||||
public void setItems(List<ApiJcBillItem> items) {
|
||||
this.items = items;
|
||||
}
|
||||
}
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
package abacus.springboot.example.api.view;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
@Schema(description = "分页对象" , name = "ApiJcBillCollect")
|
||||
public class ApiJcBillCollect {
|
||||
|
||||
@Schema(description="总数", required = false, example="100")
|
||||
private long total;
|
||||
|
||||
@Schema(description="总页数", required = false, example="10")
|
||||
private int totalPages;
|
||||
|
||||
@Schema(description="稽查收货列表", required = false, example="")
|
||||
private List<ApiJcBillSearch> bills;
|
||||
|
||||
public long getTotal() {
|
||||
return total;
|
||||
}
|
||||
|
||||
public void setTotal(long total) {
|
||||
this.total = total;
|
||||
}
|
||||
|
||||
public int getTotalPages() {
|
||||
return totalPages;
|
||||
}
|
||||
|
||||
public void setTotalPages(int totalPages) {
|
||||
this.totalPages = totalPages;
|
||||
}
|
||||
|
||||
public List<ApiJcBillSearch> getBills() {
|
||||
return bills;
|
||||
}
|
||||
|
||||
public void setBills(List<ApiJcBillSearch> bills) {
|
||||
this.bills = bills;
|
||||
}
|
||||
}
|
||||
+75
@@ -0,0 +1,75 @@
|
||||
package abacus.springboot.example.api.view;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
@Schema(description = "货品图片" , name = "ApiJcBillGoodsPhoto")
|
||||
public class ApiJcBillGoodsPhoto {
|
||||
|
||||
@Schema(description = "明细序号", required = false, hidden = true, example = "2")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "状态", required = false, pattern = "人工朔源驳回:-2,系统朔源验证未通过(无结果):-1,系统溯源未验证:0,系统朔源验证通过:1,人工朔源待确认:2,人工朔源已确认:3", example = "2")
|
||||
private int status;
|
||||
|
||||
@Schema(description = "货品编号", required = false, example = "B20181118-001")
|
||||
private String goodsid;
|
||||
|
||||
@Schema(description = "物流码", required = false, example = "HTTPS://M.DIAOYUTAIJI")
|
||||
private String logisticsid;
|
||||
|
||||
@Schema(description = "驳回原因", required = true, example = "")
|
||||
private String reason;
|
||||
|
||||
@Schema(description = "货品图片", required = false, pattern = "这是个JSON数组,不是JSONArray对象", example = "[\"44444\",\"aaaaa\"]")
|
||||
private List<String> goodsPhotos;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getReason() {
|
||||
return reason;
|
||||
}
|
||||
|
||||
public void setReason(String reason) {
|
||||
this.reason = reason;
|
||||
}
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(int status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getLogisticsid() {
|
||||
return logisticsid;
|
||||
}
|
||||
|
||||
public void setLogisticsid(String logisticsid) {
|
||||
this.logisticsid = logisticsid;
|
||||
}
|
||||
|
||||
public String getGoodsid() {
|
||||
return goodsid;
|
||||
}
|
||||
|
||||
public void setGoodsid(String goodsid) {
|
||||
this.goodsid = goodsid;
|
||||
}
|
||||
|
||||
public List<String> getGoodsPhotos() {
|
||||
return goodsPhotos;
|
||||
}
|
||||
|
||||
public void setGoodsPhotos(List<String> goodsPhotos) {
|
||||
this.goodsPhotos = goodsPhotos;
|
||||
}
|
||||
}
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
package abacus.springboot.example.api.view;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
@Schema(description = "分页对象" , name = "ApiJcBillHgSearch")
|
||||
public class ApiJcBillHgSearch {
|
||||
|
||||
@Schema(description="总数", required = false, example="100")
|
||||
private long total;
|
||||
|
||||
@Schema(description="总页数", required = false, example="10")
|
||||
private int totalPages;
|
||||
|
||||
@Schema(description="回购订单列表", required = false, example="")
|
||||
private List<ApiJcBillHgSearchItem> items;
|
||||
|
||||
public long getTotal() {
|
||||
return total;
|
||||
}
|
||||
|
||||
public void setTotal(long total) {
|
||||
this.total = total;
|
||||
}
|
||||
|
||||
public int getTotalPages() {
|
||||
return totalPages;
|
||||
}
|
||||
|
||||
public void setTotalPages(int totalPages) {
|
||||
this.totalPages = totalPages;
|
||||
}
|
||||
|
||||
public List<ApiJcBillHgSearchItem> getItems() {
|
||||
return items;
|
||||
}
|
||||
|
||||
public void setItems(List<ApiJcBillHgSearchItem> items) {
|
||||
this.items = items;
|
||||
}
|
||||
}
|
||||
+176
@@ -0,0 +1,176 @@
|
||||
package abacus.springboot.example.api.view;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import abacus.springboot.example.dao.JcBillPhoto;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
@Schema(description = "回购订单列表" , name = "ApiJcBillHgSearchItem")
|
||||
public class ApiJcBillHgSearchItem {
|
||||
|
||||
@Schema(description="回购订单号", required = false, example="HG202412080001")
|
||||
private String billHg;
|
||||
|
||||
@Schema(description="状态", required = false, pattern = "待提交:1,待付款:2,待分仓(已付款):3,已分仓(待出库):4,已出库:5", example = "1")
|
||||
private int status;
|
||||
|
||||
@Schema(description="客户编码", required = false, example="2020089")
|
||||
private String account;
|
||||
|
||||
@Schema(description="回购订单号", required = false, example="广东众之品酒有限公司")
|
||||
private String accountname;
|
||||
|
||||
@Schema(description="运营经理编码", required = false, example="zhangsan")
|
||||
private String manager;
|
||||
|
||||
@Schema(description="运营经理名称", required = false, example="张三")
|
||||
private String managername;
|
||||
|
||||
@Schema(description="品种个数", required = false, example="1")
|
||||
private int breednum;
|
||||
|
||||
@Schema(description="件数", required = false, example="2")
|
||||
private int numbers;
|
||||
|
||||
@Schema(description = "物流公司名称", required = false, example = "京东")
|
||||
private String logisticsname;
|
||||
|
||||
@Schema(description = "物流单号", required = false, example = "JD20240000001")
|
||||
private String logisticsno;
|
||||
|
||||
@Schema(description = "金额", required = false, example = "1000")
|
||||
private double subtotal;
|
||||
|
||||
@Schema(description="回购通知函", required = false, example="")
|
||||
private String tzhUrl;
|
||||
|
||||
@Schema(description="违规回购通知函", required = false, example="")
|
||||
private List<JcBillPhoto> wgtzhUrl;
|
||||
|
||||
@Schema(description="支付凭证", required = false, example="")
|
||||
private List<JcBillPhoto> zfpzUrl;
|
||||
|
||||
@Schema(description="支付方式", required = false, example="")
|
||||
private List<ApiBillHgPayment> payments;
|
||||
|
||||
public double getSubtotal() {
|
||||
return subtotal;
|
||||
}
|
||||
|
||||
public void setSubtotal(double subtotal) {
|
||||
this.subtotal = subtotal;
|
||||
}
|
||||
|
||||
public List<ApiBillHgPayment> getPayments() {
|
||||
return payments;
|
||||
}
|
||||
|
||||
public void setPayments(List<ApiBillHgPayment> payments) {
|
||||
this.payments = payments;
|
||||
}
|
||||
|
||||
public String getTzhUrl() {
|
||||
return tzhUrl;
|
||||
}
|
||||
|
||||
public void setTzhUrl(String tzhUrl) {
|
||||
this.tzhUrl = tzhUrl;
|
||||
}
|
||||
|
||||
public List<JcBillPhoto> getWgtzhUrl() {
|
||||
return wgtzhUrl;
|
||||
}
|
||||
|
||||
public void setWgtzhUrl(List<JcBillPhoto> wgtzhUrl) {
|
||||
this.wgtzhUrl = wgtzhUrl;
|
||||
}
|
||||
|
||||
public List<JcBillPhoto> getZfpzUrl() {
|
||||
return zfpzUrl;
|
||||
}
|
||||
|
||||
public void setZfpzUrl(List<JcBillPhoto> zfpzUrl) {
|
||||
this.zfpzUrl = zfpzUrl;
|
||||
}
|
||||
|
||||
public String getBillHg() {
|
||||
return billHg;
|
||||
}
|
||||
|
||||
public void setBillHg(String billHg) {
|
||||
this.billHg = billHg;
|
||||
}
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(int status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getAccount() {
|
||||
return account;
|
||||
}
|
||||
|
||||
public void setAccount(String account) {
|
||||
this.account = account;
|
||||
}
|
||||
|
||||
public String getAccountname() {
|
||||
return accountname;
|
||||
}
|
||||
|
||||
public void setAccountname(String accountname) {
|
||||
this.accountname = accountname;
|
||||
}
|
||||
|
||||
public String getManager() {
|
||||
return manager;
|
||||
}
|
||||
|
||||
public void setManager(String manager) {
|
||||
this.manager = manager;
|
||||
}
|
||||
|
||||
public String getManagername() {
|
||||
return managername;
|
||||
}
|
||||
|
||||
public void setManagername(String managername) {
|
||||
this.managername = managername;
|
||||
}
|
||||
|
||||
public int getBreednum() {
|
||||
return breednum;
|
||||
}
|
||||
|
||||
public void setBreednum(int breednum) {
|
||||
this.breednum = breednum;
|
||||
}
|
||||
|
||||
public int getNumbers() {
|
||||
return numbers;
|
||||
}
|
||||
|
||||
public void setNumbers(int numbers) {
|
||||
this.numbers = numbers;
|
||||
}
|
||||
|
||||
public String getLogisticsname() {
|
||||
return logisticsname;
|
||||
}
|
||||
|
||||
public void setLogisticsname(String logisticsname) {
|
||||
this.logisticsname = logisticsname;
|
||||
}
|
||||
|
||||
public String getLogisticsno() {
|
||||
return logisticsno;
|
||||
}
|
||||
|
||||
public void setLogisticsno(String logisticsno) {
|
||||
this.logisticsno = logisticsno;
|
||||
}
|
||||
|
||||
}
|
||||
+130
@@ -0,0 +1,130 @@
|
||||
package abacus.springboot.example.api.view;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
@Schema(description = "稽查收货明细" , name = "ApiJcBillItem")
|
||||
public class ApiJcBillItem {
|
||||
|
||||
@Schema(description = "明细序号", required = false, hidden = true, example = "2")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "行号", required = false, pattern = "修改时必填", example = "2")
|
||||
private int indexno;
|
||||
|
||||
@Schema(description = "收货来源", required = false, example = "掌上华致")
|
||||
private String recsource;
|
||||
|
||||
@Schema(description = "收货渠道", required = false, example = "线下")
|
||||
private String channel;
|
||||
|
||||
@Schema(description = "收货平台", required = true, example = "")
|
||||
private String recplatform;
|
||||
|
||||
@Schema(description = "收货单价", required = false, example = "100")
|
||||
private double price;
|
||||
|
||||
@Schema(description = "收货数量", required = false, example = "10")
|
||||
private double quantity;
|
||||
|
||||
@Schema(description = "收货件数", required = false, example = "1")
|
||||
private double numbers;
|
||||
|
||||
@Schema(description = "收货金额", required = false, example = "1000")
|
||||
private double subtotal;
|
||||
|
||||
@Schema(description = "付款图片", required = false, pattern = "这是个JSON数组,不是JSONArray对象", example = "[\"44444\",\"aaaaa\"]")
|
||||
private List<String> paymentPhoto;
|
||||
|
||||
@Schema(description = "货品图片", required = false, pattern = "", example = "")
|
||||
private List<ApiJcBillGoodsPhoto> goodsPhotos;
|
||||
|
||||
public String getRecplatform() {
|
||||
return recplatform;
|
||||
}
|
||||
|
||||
public void setRecplatform(String recplatform) {
|
||||
this.recplatform = recplatform;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getRecsource() {
|
||||
return recsource;
|
||||
}
|
||||
|
||||
public void setRecsource(String recsource) {
|
||||
this.recsource = recsource;
|
||||
}
|
||||
|
||||
public String getChannel() {
|
||||
return channel;
|
||||
}
|
||||
|
||||
public void setChannel(String channel) {
|
||||
this.channel = channel;
|
||||
}
|
||||
|
||||
public double getPrice() {
|
||||
return price;
|
||||
}
|
||||
|
||||
public void setPrice(double price) {
|
||||
this.price = price;
|
||||
}
|
||||
|
||||
public double getQuantity() {
|
||||
return quantity;
|
||||
}
|
||||
|
||||
public void setQuantity(double quantity) {
|
||||
this.quantity = quantity;
|
||||
}
|
||||
|
||||
public double getNumbers() {
|
||||
return numbers;
|
||||
}
|
||||
|
||||
public void setNumbers(double numbers) {
|
||||
this.numbers = numbers;
|
||||
}
|
||||
|
||||
public double getSubtotal() {
|
||||
return subtotal;
|
||||
}
|
||||
|
||||
public void setSubtotal(double subtotal) {
|
||||
this.subtotal = subtotal;
|
||||
}
|
||||
|
||||
public List<String> getPaymentPhoto() {
|
||||
return paymentPhoto;
|
||||
}
|
||||
|
||||
public void setPaymentPhoto(List<String> paymentPhoto) {
|
||||
this.paymentPhoto = paymentPhoto;
|
||||
}
|
||||
|
||||
public int getIndexno() {
|
||||
return indexno;
|
||||
}
|
||||
|
||||
public void setIndexno(int indexno) {
|
||||
this.indexno = indexno;
|
||||
}
|
||||
|
||||
public List<ApiJcBillGoodsPhoto> getGoodsPhotos() {
|
||||
return goodsPhotos;
|
||||
}
|
||||
|
||||
public void setGoodsPhotos(List<ApiJcBillGoodsPhoto> goodsPhotos) {
|
||||
this.goodsPhotos = goodsPhotos;
|
||||
}
|
||||
}
|
||||
+73
@@ -0,0 +1,73 @@
|
||||
package abacus.springboot.example.api.view;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
@Schema(description = "稽查收货列表" , name = "ApiJcBillSearch")
|
||||
public class ApiJcBillSearch {
|
||||
|
||||
@Schema(description="稽查单号", required = false, example="JC202411180001")
|
||||
private String billid;
|
||||
|
||||
@Schema(description = "收货日期", required = false, example = "2024-11-11")
|
||||
private String receivedt;
|
||||
|
||||
@Schema(description = "收货产品", required = false, example = "荷花")
|
||||
private String goods;
|
||||
|
||||
@Schema(description = "收货数量", required = false, example = "6")
|
||||
private double quantity;
|
||||
|
||||
@Schema(description="状态", required = false, pattern = "溯源驳回:-2,待提交:0,系统溯源验证通过:1,待溯源:2,待入库:3,入库待审核:4,已入库:5 ,部分回购:6,回购完成:7", example = "1")
|
||||
private int status;
|
||||
|
||||
@Schema(hidden = true)
|
||||
private int hgstatus;
|
||||
|
||||
public int getHgstatus() {
|
||||
return hgstatus;
|
||||
}
|
||||
|
||||
public void setHgstatus(int hgstatus) {
|
||||
this.hgstatus = hgstatus;
|
||||
}
|
||||
|
||||
public String getBillid() {
|
||||
return billid;
|
||||
}
|
||||
|
||||
public void setBillid(String billid) {
|
||||
this.billid = billid;
|
||||
}
|
||||
|
||||
public String getReceivedt() {
|
||||
return receivedt;
|
||||
}
|
||||
|
||||
public void setReceivedt(String receivedt) {
|
||||
this.receivedt = receivedt;
|
||||
}
|
||||
|
||||
public String getGoods() {
|
||||
return goods;
|
||||
}
|
||||
|
||||
public void setGoods(String goods) {
|
||||
this.goods = goods;
|
||||
}
|
||||
|
||||
public double getQuantity() {
|
||||
return quantity;
|
||||
}
|
||||
|
||||
public void setQuantity(double quantity) {
|
||||
this.quantity = quantity;
|
||||
}
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(int status) {
|
||||
this.status = status;
|
||||
}
|
||||
}
|
||||
+97
@@ -0,0 +1,97 @@
|
||||
package abacus.springboot.example.api.view;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
@Schema(description = "稽查收货主单" , name = "ApiReqJcBill")
|
||||
public class ApiReqJcBill {
|
||||
|
||||
@Schema(description="稽查单号", required = false, pattern = "修改时必填", example="JC202411180001")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "收货产品", required = false, example = "钓鱼台")
|
||||
private String goods;
|
||||
|
||||
@Schema(description = "收货日期", required = false, example = "2024-11-11")
|
||||
private String receivedt;
|
||||
|
||||
@Schema(description = "收货仓库编码", required = false, example = "9090025")
|
||||
private String warehouse;
|
||||
|
||||
@Schema(description = "收货仓库名称", required = false, example = "精品广州库")
|
||||
private String warehousename;
|
||||
|
||||
@Schema(description = "申请人编码", required = true, example = "zhangsan")
|
||||
private String applicant;
|
||||
|
||||
@Schema(description = "申请人名称", required = true, example = "张三")
|
||||
private String applicantname;
|
||||
|
||||
@Schema(description="稽查收货明细", required = false, example="")
|
||||
private List<ApiReqJcBillItem> items;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getGoods() {
|
||||
return goods;
|
||||
}
|
||||
|
||||
public void setGoods(String goods) {
|
||||
this.goods = goods;
|
||||
}
|
||||
|
||||
public String getReceivedt() {
|
||||
return receivedt;
|
||||
}
|
||||
|
||||
public void setReceivedt(String receivedt) {
|
||||
this.receivedt = receivedt;
|
||||
}
|
||||
|
||||
public String getWarehouse() {
|
||||
return warehouse;
|
||||
}
|
||||
|
||||
public void setWarehouse(String warehouse) {
|
||||
this.warehouse = warehouse;
|
||||
}
|
||||
|
||||
public String getWarehousename() {
|
||||
return warehousename;
|
||||
}
|
||||
|
||||
public void setWarehousename(String warehousename) {
|
||||
this.warehousename = warehousename;
|
||||
}
|
||||
|
||||
public String getApplicant() {
|
||||
return applicant;
|
||||
}
|
||||
|
||||
public void setApplicant(String applicant) {
|
||||
this.applicant = applicant;
|
||||
}
|
||||
|
||||
public String getApplicantname() {
|
||||
return applicantname;
|
||||
}
|
||||
|
||||
public void setApplicantname(String applicantname) {
|
||||
this.applicantname = applicantname;
|
||||
}
|
||||
|
||||
public List<ApiReqJcBillItem> getItems() {
|
||||
return items;
|
||||
}
|
||||
|
||||
public void setItems(List<ApiReqJcBillItem> items) {
|
||||
this.items = items;
|
||||
}
|
||||
}
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
package abacus.springboot.example.api.view;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
@Schema(description = "货品图片" , name = "ApiReqJcBillGoodsPhoto")
|
||||
public class ApiReqJcBillGoodsPhoto {
|
||||
|
||||
@Schema(description = "货品编号", required = false, example = "B20181118-001")
|
||||
private String goodsid;
|
||||
|
||||
@Schema(description = "物流码", required = false, example = "HTTPS://M.DIAOYUTAIJI")
|
||||
private String logisticsid;
|
||||
|
||||
@Schema(description = "货品图片", required = false, pattern = "这是个JSON数组,不是JSONArray对象", example = "[\"44444\",\"aaaaa\"]")
|
||||
private List<String> goodsPhotos;
|
||||
|
||||
public String getLogisticsid() {
|
||||
return logisticsid;
|
||||
}
|
||||
|
||||
public void setLogisticsid(String logisticsid) {
|
||||
this.logisticsid = logisticsid;
|
||||
}
|
||||
|
||||
public String getGoodsid() {
|
||||
return goodsid;
|
||||
}
|
||||
|
||||
public void setGoodsid(String goodsid) {
|
||||
this.goodsid = goodsid;
|
||||
}
|
||||
|
||||
public List<String> getGoodsPhotos() {
|
||||
return goodsPhotos;
|
||||
}
|
||||
|
||||
public void setGoodsPhotos(List<String> goodsPhotos) {
|
||||
this.goodsPhotos = goodsPhotos;
|
||||
}
|
||||
}
|
||||
+196
@@ -0,0 +1,196 @@
|
||||
package abacus.springboot.example.api.view;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
@Schema(description = "回购单主单" , name = "ApiReqJcBillHg")
|
||||
public class ApiReqJcBillHg {
|
||||
|
||||
@Schema(description="回购单单号", required = true, example="HG202411180001")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "商品总金额", required = false, example = "4800")
|
||||
private Double subtotal;
|
||||
|
||||
@Schema(description = "运费", required = true, example = "50")
|
||||
private Double freight;
|
||||
|
||||
@Schema(description = "收货人姓名", required = true, example = "李四")
|
||||
private String consignee;
|
||||
|
||||
@Schema(description = "收货人电话", required = true, example = "1888888888")
|
||||
private String consigneephone;
|
||||
|
||||
@Schema(description = "省", required = false, example = "10001")
|
||||
private String province;
|
||||
|
||||
@Schema(description = "省", required = true, example = "广东")
|
||||
private String provincename;
|
||||
|
||||
@Schema(description = "市", required = false, example = "1000101")
|
||||
private String city;
|
||||
|
||||
@Schema(description = "市", required = true, example = "广州")
|
||||
private String cityname;
|
||||
|
||||
@Schema(description = "区", required = false, example = "100010101")
|
||||
private String area;
|
||||
|
||||
@Schema(description = "区", required = true, example = "越秀区")
|
||||
private String areaname;
|
||||
|
||||
@Schema(description = "详细地址", required = true, example = "东风24路")
|
||||
private String address;
|
||||
|
||||
@Schema(description = "订单备注", required = false, example = "订单备注~~~")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "运营备注", required = false, example = "运营备注~~~")
|
||||
private String remark1;
|
||||
|
||||
@Schema(description = "提交人编码", required = true, example = "zhangsan")
|
||||
private String submit;
|
||||
|
||||
@Schema(description = "提交人名称", required = true, example = "张三")
|
||||
private String submitname;
|
||||
|
||||
@Schema(description = "回购支付明细", required = true, example = "")
|
||||
private List<ApiReqJcBillPayment> payments;
|
||||
|
||||
public List<ApiReqJcBillPayment> getPayments() {
|
||||
return payments;
|
||||
}
|
||||
|
||||
public void setPayments(List<ApiReqJcBillPayment> payments) {
|
||||
this.payments = payments;
|
||||
}
|
||||
|
||||
public String getSubmit() {
|
||||
return submit;
|
||||
}
|
||||
|
||||
public void setSubmit(String submit) {
|
||||
this.submit = submit;
|
||||
}
|
||||
|
||||
public String getSubmitname() {
|
||||
return submitname;
|
||||
}
|
||||
|
||||
public void setSubmitname(String submitname) {
|
||||
this.submitname = submitname;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Double getSubtotal() {
|
||||
return subtotal;
|
||||
}
|
||||
|
||||
public void setSubtotal(Double subtotal) {
|
||||
this.subtotal = subtotal;
|
||||
}
|
||||
|
||||
public Double getFreight() {
|
||||
return freight;
|
||||
}
|
||||
|
||||
public void setFreight(Double freight) {
|
||||
this.freight = freight;
|
||||
}
|
||||
|
||||
public String getConsignee() {
|
||||
return consignee;
|
||||
}
|
||||
|
||||
public void setConsignee(String consignee) {
|
||||
this.consignee = consignee;
|
||||
}
|
||||
|
||||
public String getConsigneephone() {
|
||||
return consigneephone;
|
||||
}
|
||||
|
||||
public void setConsigneephone(String consigneephone) {
|
||||
this.consigneephone = consigneephone;
|
||||
}
|
||||
|
||||
public String getProvince() {
|
||||
return province;
|
||||
}
|
||||
|
||||
public void setProvince(String province) {
|
||||
this.province = province;
|
||||
}
|
||||
|
||||
public String getProvincename() {
|
||||
return provincename;
|
||||
}
|
||||
|
||||
public void setProvincename(String provincename) {
|
||||
this.provincename = provincename;
|
||||
}
|
||||
|
||||
public String getCity() {
|
||||
return city;
|
||||
}
|
||||
|
||||
public void setCity(String city) {
|
||||
this.city = city;
|
||||
}
|
||||
|
||||
public String getCityname() {
|
||||
return cityname;
|
||||
}
|
||||
|
||||
public void setCityname(String cityname) {
|
||||
this.cityname = cityname;
|
||||
}
|
||||
|
||||
public String getArea() {
|
||||
return area;
|
||||
}
|
||||
|
||||
public void setArea(String area) {
|
||||
this.area = area;
|
||||
}
|
||||
|
||||
public String getAreaname() {
|
||||
return areaname;
|
||||
}
|
||||
|
||||
public void setAreaname(String areaname) {
|
||||
this.areaname = areaname;
|
||||
}
|
||||
|
||||
public String getAddress() {
|
||||
return address;
|
||||
}
|
||||
|
||||
public void setAddress(String address) {
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public String getRemark1() {
|
||||
return remark1;
|
||||
}
|
||||
|
||||
public void setRemark1(String remark1) {
|
||||
this.remark1 = remark1;
|
||||
}
|
||||
}
|
||||
+130
@@ -0,0 +1,130 @@
|
||||
package abacus.springboot.example.api.view;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
@Schema(description = "稽查收货明细" , name = "ApiReqJcBillItem")
|
||||
public class ApiReqJcBillItem {
|
||||
|
||||
@Schema(description = "明细序号", required = false, pattern = "修改时必填", example = "2")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "行号", required = false, pattern = "修改时必填", example = "2")
|
||||
private int indexno;
|
||||
|
||||
@Schema(description = "收货来源", required = false, example = "线下")
|
||||
private String recsource;
|
||||
|
||||
@Schema(description = "收货平台", required = false, example = "")
|
||||
private String recplatform;
|
||||
|
||||
@Schema(description = "收货渠道", required = false, example = "XXX烟酒店")
|
||||
private String channel;
|
||||
|
||||
@Schema(description = "收货单价", required = false, example = "100")
|
||||
private Double price;
|
||||
|
||||
@Schema(description = "收货数量", required = false, example = "10")
|
||||
private Double quantity;
|
||||
|
||||
@Schema(description = "收货件数", required = false, example = "1")
|
||||
private Double numbers;
|
||||
|
||||
@Schema(description = "收货金额", required = false, example = "1000")
|
||||
private Double subtotal;
|
||||
|
||||
@Schema(description = "付款图片", required = false, pattern = "这是个JSON数组,不是JSONArray对象", example = "[\"44444\",\"aaaaa\"]")
|
||||
private List<String> paymentPhoto;
|
||||
|
||||
@Schema(description = "货品图片", required = false, pattern = "", example = "")
|
||||
private List<ApiReqJcBillGoodsPhoto> goodsPhotos;
|
||||
|
||||
public List<ApiReqJcBillGoodsPhoto> getGoodsPhotos() {
|
||||
return goodsPhotos;
|
||||
}
|
||||
|
||||
public void setGoodsPhotos(List<ApiReqJcBillGoodsPhoto> goodsPhotos) {
|
||||
this.goodsPhotos = goodsPhotos;
|
||||
}
|
||||
|
||||
public int getIndexno() {
|
||||
return indexno;
|
||||
}
|
||||
|
||||
public void setIndexno(int indexno) {
|
||||
this.indexno = indexno;
|
||||
}
|
||||
|
||||
public String getRecplatform() {
|
||||
return recplatform;
|
||||
}
|
||||
|
||||
public void setRecplatform(String recplatform) {
|
||||
this.recplatform = recplatform;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getRecsource() {
|
||||
return recsource;
|
||||
}
|
||||
|
||||
public void setRecsource(String recsource) {
|
||||
this.recsource = recsource;
|
||||
}
|
||||
|
||||
public String getChannel() {
|
||||
return channel;
|
||||
}
|
||||
|
||||
public void setChannel(String channel) {
|
||||
this.channel = channel;
|
||||
}
|
||||
|
||||
public Double getPrice() {
|
||||
return price;
|
||||
}
|
||||
|
||||
public void setPrice(Double price) {
|
||||
this.price = price;
|
||||
}
|
||||
|
||||
public Double getQuantity() {
|
||||
return quantity;
|
||||
}
|
||||
|
||||
public void setQuantity(Double quantity) {
|
||||
this.quantity = quantity;
|
||||
}
|
||||
|
||||
public Double getNumbers() {
|
||||
return numbers;
|
||||
}
|
||||
|
||||
public void setNumbers(Double numbers) {
|
||||
this.numbers = numbers;
|
||||
}
|
||||
|
||||
public Double getSubtotal() {
|
||||
return subtotal;
|
||||
}
|
||||
|
||||
public void setSubtotal(Double subtotal) {
|
||||
this.subtotal = subtotal;
|
||||
}
|
||||
|
||||
public List<String> getPaymentPhoto() {
|
||||
return paymentPhoto;
|
||||
}
|
||||
|
||||
public void setPaymentPhoto(List<String> paymentPhoto) {
|
||||
this.paymentPhoto = paymentPhoto;
|
||||
}
|
||||
}
|
||||
+62
@@ -0,0 +1,62 @@
|
||||
package abacus.springboot.example.api.view;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
@Schema(description = "回购支付明细" , name = "ApiReqJcBillPayment")
|
||||
public class ApiReqJcBillPayment {
|
||||
|
||||
@Schema(description = "支付方式", required = true, example = "线下付款")
|
||||
private String payment;
|
||||
|
||||
@Schema(description = "支付金额", required = true, example = "4820")
|
||||
private Double amount;
|
||||
|
||||
@Schema(description = "账号名称", required = true, example = "张三")
|
||||
private String zhmc;
|
||||
|
||||
@Schema(description = "开发银行", required = true, example = "工商银行")
|
||||
private String khyh;
|
||||
|
||||
@Schema(description = "银行账号", required = true, example = "0101020102102010210201")
|
||||
private String yhzh;
|
||||
|
||||
public String getPayment() {
|
||||
return payment;
|
||||
}
|
||||
|
||||
public void setPayment(String payment) {
|
||||
this.payment = payment;
|
||||
}
|
||||
|
||||
public Double getAmount() {
|
||||
return amount;
|
||||
}
|
||||
|
||||
public void setAmount(Double amount) {
|
||||
this.amount = amount;
|
||||
}
|
||||
|
||||
public String getZhmc() {
|
||||
return zhmc;
|
||||
}
|
||||
|
||||
public void setZhmc(String zhmc) {
|
||||
this.zhmc = zhmc;
|
||||
}
|
||||
|
||||
public String getKhyh() {
|
||||
return khyh;
|
||||
}
|
||||
|
||||
public void setKhyh(String khyh) {
|
||||
this.khyh = khyh;
|
||||
}
|
||||
|
||||
public String getYhzh() {
|
||||
return yhzh;
|
||||
}
|
||||
|
||||
public void setYhzh(String yhzh) {
|
||||
this.yhzh = yhzh;
|
||||
}
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
package abacus.springboot.example.api.view;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
@Schema(description = "图片对象" , name = "ApiReqJcBillPhoto")
|
||||
public class ApiReqJcBillPhoto {
|
||||
|
||||
@Schema(description = "回购单号、溯源入库单号", pattern="type=1时,为溯源入库单号,type=2时,为回购单号",required = true, example = "HG202411180001")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "图片明细", required = true, example = "")
|
||||
private List<ApiReqJcBillPhotoItem> items;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
public List<ApiReqJcBillPhotoItem> getItems() {
|
||||
return items;
|
||||
}
|
||||
|
||||
public void setItems(List<ApiReqJcBillPhotoItem> items) {
|
||||
this.items = items;
|
||||
}
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
package abacus.springboot.example.api.view;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
@Schema(description = "图片明细" , name = "ApiReqJcBillPhotoItem")
|
||||
public class ApiReqJcBillPhotoItem {
|
||||
|
||||
@Schema(description = "货品编号", pattern="type=1时,必填",required = false, example = "HG202411180001")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "图片类型", required = true, pattern = "回购违规通知函、回购支付凭证、稽查付款截图、稽查货品图", example = "回购违规通知函")
|
||||
private String typePhoto;
|
||||
|
||||
@Schema(description = "图片地址", required = true, example = "http:ip/1.jpg")
|
||||
private String urlPhoto;
|
||||
|
||||
public String getTypePhoto() {
|
||||
return typePhoto;
|
||||
}
|
||||
|
||||
public void setTypePhoto(String typePhoto) {
|
||||
this.typePhoto = typePhoto;
|
||||
}
|
||||
|
||||
public String getUrlPhoto() {
|
||||
return urlPhoto;
|
||||
}
|
||||
|
||||
public void setUrlPhoto(String urlPhoto) {
|
||||
this.urlPhoto = urlPhoto;
|
||||
}
|
||||
}
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
package abacus.springboot.example.api.view;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
@Schema(description = "回购支付方式" , name = "ApiRespBillHgPay")
|
||||
public class ApiRespBillHgPay {
|
||||
|
||||
@Schema(description = "支付方式", required = false, example = "线下支付")
|
||||
private String payment;
|
||||
|
||||
@Schema(description = "账号名称", required = false, example = "张三")
|
||||
private String zhmc;
|
||||
|
||||
@Schema(description = "开发银行", required = false, example = "工商银行")
|
||||
private String khyh;
|
||||
|
||||
@Schema(description = "银行账号", required = false, example = "10021020120102102012010")
|
||||
private String yhzh;
|
||||
|
||||
public String getPayment() {
|
||||
return payment;
|
||||
}
|
||||
|
||||
public void setPayment(String payment) {
|
||||
this.payment = payment;
|
||||
}
|
||||
|
||||
public String getZhmc() {
|
||||
return zhmc;
|
||||
}
|
||||
|
||||
public void setZhmc(String zhmc) {
|
||||
this.zhmc = zhmc;
|
||||
}
|
||||
|
||||
public String getKhyh() {
|
||||
return khyh;
|
||||
}
|
||||
|
||||
public void setKhyh(String khyh) {
|
||||
this.khyh = khyh;
|
||||
}
|
||||
|
||||
public String getYhzh() {
|
||||
return yhzh;
|
||||
}
|
||||
|
||||
public void setYhzh(String yhzh) {
|
||||
this.yhzh = yhzh;
|
||||
}
|
||||
}
|
||||
+64
@@ -0,0 +1,64 @@
|
||||
package abacus.springboot.example.api.view;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
@Schema(description = "稽查货品" , name = "ApiRespJcPorduct")
|
||||
public class ApiRespJcPorduct {
|
||||
|
||||
@Schema(description="稽查单号", required = false, example="JC202501090002")
|
||||
private String billId;
|
||||
|
||||
@Schema(description="入库单号", required = false, example="WDT2292992992")
|
||||
private String stockInId;
|
||||
|
||||
@Schema(description="回购单号", required = false, example="HG202501090002")
|
||||
private String hgId;
|
||||
|
||||
@Schema(description="出库单号", required = false, example="WDTCK202501090001")
|
||||
private String stockOutId;
|
||||
|
||||
@Schema(description="客户信息", required = false, example="")
|
||||
private List<ApiRespJcPorductAcount> accounts;
|
||||
|
||||
public String getBillId() {
|
||||
return billId;
|
||||
}
|
||||
|
||||
public void setBillId(String billId) {
|
||||
this.billId = billId;
|
||||
}
|
||||
|
||||
public String getStockInId() {
|
||||
return stockInId;
|
||||
}
|
||||
|
||||
public void setStockInId(String stockInId) {
|
||||
this.stockInId = stockInId;
|
||||
}
|
||||
|
||||
public String getHgId() {
|
||||
return hgId;
|
||||
}
|
||||
|
||||
public void setHgId(String hgId) {
|
||||
this.hgId = hgId;
|
||||
}
|
||||
|
||||
public String getStockOutId() {
|
||||
return stockOutId;
|
||||
}
|
||||
|
||||
public void setStockOutId(String stockOutId) {
|
||||
this.stockOutId = stockOutId;
|
||||
}
|
||||
|
||||
public List<ApiRespJcPorductAcount> getAccounts() {
|
||||
return accounts;
|
||||
}
|
||||
|
||||
public void setAccounts(List<ApiRespJcPorductAcount> accounts) {
|
||||
this.accounts = accounts;
|
||||
}
|
||||
}
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
package abacus.springboot.example.api.view;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
@Schema(description = "稽查货品-客户信息" , name = "ApiRespJcPorductAcount")
|
||||
public class ApiRespJcPorductAcount {
|
||||
|
||||
@Schema(description="客户编码", required = false, example="1050000322")
|
||||
private String account;
|
||||
|
||||
@Schema(description="客户名称", required = false, example="四川有限公司")
|
||||
private String accountName;
|
||||
|
||||
@Schema(description="商品信息", required = false, example="")
|
||||
private List<ApiRespJcPorductProduct> products;
|
||||
|
||||
public String getAccount() {
|
||||
return account;
|
||||
}
|
||||
|
||||
public void setAccount(String account) {
|
||||
this.account = account;
|
||||
}
|
||||
|
||||
public String getAccountName() {
|
||||
return accountName;
|
||||
}
|
||||
|
||||
public void setAccountName(String accountName) {
|
||||
this.accountName = accountName;
|
||||
}
|
||||
|
||||
public List<ApiRespJcPorductProduct> getProducts() {
|
||||
return products;
|
||||
}
|
||||
|
||||
public void setProducts(List<ApiRespJcPorductProduct> products) {
|
||||
this.products = products;
|
||||
}
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
package abacus.springboot.example.api.view;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
@Schema(description = "稽查货品-货品信息" , name = "ApiRespJcPorductItem")
|
||||
public class ApiRespJcPorductItem {
|
||||
|
||||
@Schema(description = "货品图片", required = true, example = "")
|
||||
private List<String> photos;
|
||||
|
||||
@Schema(description = "货品编号", required = true, example = "")
|
||||
private String goodsId;
|
||||
|
||||
public List<String> getPhotos() {
|
||||
return photos;
|
||||
}
|
||||
|
||||
public void setPhotos(List<String> photos) {
|
||||
this.photos = photos;
|
||||
}
|
||||
|
||||
public String getGoodsId() {
|
||||
return goodsId;
|
||||
}
|
||||
|
||||
public void setGoodsId(String goodsId) {
|
||||
this.goodsId = goodsId;
|
||||
}
|
||||
}
|
||||
+53
@@ -0,0 +1,53 @@
|
||||
package abacus.springboot.example.api.view;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
@Schema(description = "稽查货品-商品信息" , name = "ApiRespJcPorductProduct")
|
||||
public class ApiRespJcPorductProduct {
|
||||
|
||||
@Schema(description="商品编码", required = false, example="1010400021")
|
||||
private String product;
|
||||
|
||||
@Schema(description="商品名称", required = false, example="52度500ml五粮液")
|
||||
private String productName;
|
||||
|
||||
@Schema(description="数量", required = false, example="12瓶/2件")
|
||||
private String quantity;
|
||||
|
||||
@Schema(description="货品信息", required = false, example="")
|
||||
private List<ApiRespJcPorductItem> items;
|
||||
|
||||
public String getProduct() {
|
||||
return product;
|
||||
}
|
||||
|
||||
public void setProduct(String product) {
|
||||
this.product = product;
|
||||
}
|
||||
|
||||
public String getProductName() {
|
||||
return productName;
|
||||
}
|
||||
|
||||
public void setProductName(String productName) {
|
||||
this.productName = productName;
|
||||
}
|
||||
|
||||
public String getQuantity() {
|
||||
return quantity;
|
||||
}
|
||||
|
||||
public void setQuantity(String quantity) {
|
||||
this.quantity = quantity;
|
||||
}
|
||||
|
||||
public List<ApiRespJcPorductItem> getItems() {
|
||||
return items;
|
||||
}
|
||||
|
||||
public void setItems(List<ApiRespJcPorductItem> items) {
|
||||
this.items = items;
|
||||
}
|
||||
}
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
package abacus.springboot.example.api.view;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
@Schema(description = "收货信息" , name = "ApiRespReceiveGoods")
|
||||
public class ApiRespReceiveGoods {
|
||||
|
||||
@Schema(description = "稽查单号", required = false, example = "JC202411180001")
|
||||
private String billid;
|
||||
|
||||
@Schema(description = "物流码", required = true, example = "")
|
||||
private String logisticsid;
|
||||
|
||||
@Schema(description = "出库单号", required = true, example = "")
|
||||
private String billout;
|
||||
|
||||
public String getBillid() {
|
||||
return billid;
|
||||
}
|
||||
|
||||
public void setBillid(String billid) {
|
||||
this.billid = billid;
|
||||
}
|
||||
|
||||
public String getLogisticsid() {
|
||||
return logisticsid;
|
||||
}
|
||||
|
||||
public void setLogisticsid(String logisticsid) {
|
||||
this.logisticsid = logisticsid;
|
||||
}
|
||||
|
||||
public String getBillout() {
|
||||
return billout;
|
||||
}
|
||||
|
||||
public void setBillout(String billout) {
|
||||
this.billout = billout;
|
||||
}
|
||||
}
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
package abacus.springboot.example.api.view;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
@Schema(description = "收货仓库" , name = "ApiRespWarehouse")
|
||||
public class ApiRespWarehouse {
|
||||
|
||||
@Schema(description = "收货仓库编码", required = false, example = "0001")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "收货仓库名称", required = false, example = "四川仓")
|
||||
private String name;
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
}
|
||||
+123
@@ -0,0 +1,123 @@
|
||||
package abacus.springboot.example.api.view;
|
||||
|
||||
/**
|
||||
* <p>Title:EdgBcsCode</p>
|
||||
<p>Description:睿治物流码溯源查询接口-返回参数</p>
|
||||
@author chuanZeng
|
||||
@date 2024年12月11日
|
||||
*/
|
||||
public class EdgBcsCode {
|
||||
private String code;// 物流码字符串
|
||||
private String ck_id;// 出库单号字符串
|
||||
private String dccw_id;// 出库仓编码字符串
|
||||
private String dccw_name;// 出库仓名称字符串
|
||||
private String cdt;// 出库⽇期字符串
|
||||
private String productid;// 商品编码字符串
|
||||
private String productname;// 商品名称字符串
|
||||
private String customerid;// 客户编码字符串
|
||||
private String customername;// 客户名称字符串
|
||||
private String employeeid;// 业务员编码字符串
|
||||
private String employeename;// 业务员名称字符串
|
||||
private String group_id;// 业务组编码字符串
|
||||
private String group_name;// 业务组名称字符串
|
||||
private String departmentid;// 分销区域编码字符串
|
||||
private String departmentname;// 分销区域名称字符串
|
||||
private String data_source;// 数据源来源字符串
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
public String getCk_id() {
|
||||
return ck_id;
|
||||
}
|
||||
public void setCk_id(String ck_id) {
|
||||
this.ck_id = ck_id;
|
||||
}
|
||||
public String getDccw_id() {
|
||||
return dccw_id;
|
||||
}
|
||||
public void setDccw_id(String dccw_id) {
|
||||
this.dccw_id = dccw_id;
|
||||
}
|
||||
public String getDccw_name() {
|
||||
return dccw_name;
|
||||
}
|
||||
public void setDccw_name(String dccw_name) {
|
||||
this.dccw_name = dccw_name;
|
||||
}
|
||||
public String getCdt() {
|
||||
return cdt;
|
||||
}
|
||||
public void setCdt(String cdt) {
|
||||
this.cdt = cdt;
|
||||
}
|
||||
public String getProductid() {
|
||||
return productid;
|
||||
}
|
||||
public void setProductid(String productid) {
|
||||
this.productid = productid;
|
||||
}
|
||||
public String getProductname() {
|
||||
return productname;
|
||||
}
|
||||
public void setProductname(String productname) {
|
||||
this.productname = productname;
|
||||
}
|
||||
public String getCustomerid() {
|
||||
return customerid;
|
||||
}
|
||||
public void setCustomerid(String customerid) {
|
||||
this.customerid = customerid;
|
||||
}
|
||||
public String getCustomername() {
|
||||
return customername;
|
||||
}
|
||||
public void setCustomername(String customername) {
|
||||
this.customername = customername;
|
||||
}
|
||||
public String getEmployeeid() {
|
||||
return employeeid;
|
||||
}
|
||||
public void setEmployeeid(String employeeid) {
|
||||
this.employeeid = employeeid;
|
||||
}
|
||||
public String getEmployeename() {
|
||||
return employeename;
|
||||
}
|
||||
public void setEmployeename(String employeename) {
|
||||
this.employeename = employeename;
|
||||
}
|
||||
public String getGroup_id() {
|
||||
return group_id;
|
||||
}
|
||||
public void setGroup_id(String group_id) {
|
||||
this.group_id = group_id;
|
||||
}
|
||||
public String getGroup_name() {
|
||||
return group_name;
|
||||
}
|
||||
public void setGroup_name(String group_name) {
|
||||
this.group_name = group_name;
|
||||
}
|
||||
public String getDepartmentid() {
|
||||
return departmentid;
|
||||
}
|
||||
public void setDepartmentid(String departmentid) {
|
||||
this.departmentid = departmentid;
|
||||
}
|
||||
public String getDepartmentname() {
|
||||
return departmentname;
|
||||
}
|
||||
public void setDepartmentname(String departmentname) {
|
||||
this.departmentname = departmentname;
|
||||
}
|
||||
public String getData_source() {
|
||||
return data_source;
|
||||
}
|
||||
public void setData_source(String data_source) {
|
||||
this.data_source = data_source;
|
||||
}
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
package abacus.springboot.example.api.view;
|
||||
|
||||
public class JcBillCount {
|
||||
private String id;// 回购单号
|
||||
private int breednum;// 品种个数
|
||||
private int numbers;// 件数
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
public int getBreednum() {
|
||||
return breednum;
|
||||
}
|
||||
public void setBreednum(int breednum) {
|
||||
this.breednum = breednum;
|
||||
}
|
||||
public int getNumbers() {
|
||||
return numbers;
|
||||
}
|
||||
public void setNumbers(int numbers) {
|
||||
this.numbers = numbers;
|
||||
}
|
||||
}
|
||||
+123
@@ -0,0 +1,123 @@
|
||||
package abacus.springboot.example.api.view;
|
||||
|
||||
/**
|
||||
* <p>Title:JcCodeFlow</p>
|
||||
<p>Description: 根据物流码查询出的</p>
|
||||
@author chuanZeng
|
||||
@date 2024年12月11日
|
||||
*/
|
||||
public class JcCodeFlow {
|
||||
|
||||
private String id;// 出库单号
|
||||
private String deposit;// 出库仓编码
|
||||
private String depositname;// 出库仓名称
|
||||
private String tdate;// 出库⽇期
|
||||
private String orderid;// 销售订单号
|
||||
private String customerid;// 客户编码
|
||||
private String customername;// 客户名称
|
||||
private String aprssalemanid;// 业务员编码
|
||||
private String aprssalemanname;// 业务员名称
|
||||
private String bizgroupid;// 业务组编码
|
||||
private String bizgroupname;// 业务组名称
|
||||
private String wsareaid;// 分销区域编码
|
||||
private String wsareaname;// 分销区域名称
|
||||
private String code;// 物流码
|
||||
private String productid;// 商品
|
||||
private String productname;// 商品名称
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
public String getDeposit() {
|
||||
return deposit;
|
||||
}
|
||||
public void setDeposit(String deposit) {
|
||||
this.deposit = deposit;
|
||||
}
|
||||
public String getDepositname() {
|
||||
return depositname;
|
||||
}
|
||||
public void setDepositname(String depositname) {
|
||||
this.depositname = depositname;
|
||||
}
|
||||
public String getTdate() {
|
||||
return tdate;
|
||||
}
|
||||
public void setTdate(String tdate) {
|
||||
this.tdate = tdate;
|
||||
}
|
||||
public String getOrderid() {
|
||||
return orderid;
|
||||
}
|
||||
public void setOrderid(String orderid) {
|
||||
this.orderid = orderid;
|
||||
}
|
||||
public String getCustomerid() {
|
||||
return customerid;
|
||||
}
|
||||
public void setCustomerid(String customerid) {
|
||||
this.customerid = customerid;
|
||||
}
|
||||
public String getCustomername() {
|
||||
return customername;
|
||||
}
|
||||
public void setCustomername(String customername) {
|
||||
this.customername = customername;
|
||||
}
|
||||
public String getAprssalemanid() {
|
||||
return aprssalemanid;
|
||||
}
|
||||
public void setAprssalemanid(String aprssalemanid) {
|
||||
this.aprssalemanid = aprssalemanid;
|
||||
}
|
||||
public String getAprssalemanname() {
|
||||
return aprssalemanname;
|
||||
}
|
||||
public void setAprssalemanname(String aprssalemanname) {
|
||||
this.aprssalemanname = aprssalemanname;
|
||||
}
|
||||
public String getBizgroupid() {
|
||||
return bizgroupid;
|
||||
}
|
||||
public void setBizgroupid(String bizgroupid) {
|
||||
this.bizgroupid = bizgroupid;
|
||||
}
|
||||
public String getBizgroupname() {
|
||||
return bizgroupname;
|
||||
}
|
||||
public void setBizgroupname(String bizgroupname) {
|
||||
this.bizgroupname = bizgroupname;
|
||||
}
|
||||
public String getWsareaid() {
|
||||
return wsareaid;
|
||||
}
|
||||
public void setWsareaid(String wsareaid) {
|
||||
this.wsareaid = wsareaid;
|
||||
}
|
||||
public String getWsareaname() {
|
||||
return wsareaname;
|
||||
}
|
||||
public void setWsareaname(String wsareaname) {
|
||||
this.wsareaname = wsareaname;
|
||||
}
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
public String getProductid() {
|
||||
return productid;
|
||||
}
|
||||
public void setProductid(String productid) {
|
||||
this.productid = productid;
|
||||
}
|
||||
public String getProductname() {
|
||||
return productname;
|
||||
}
|
||||
public void setProductname(String productname) {
|
||||
this.productname = productname;
|
||||
}
|
||||
}
|
||||
+84
@@ -0,0 +1,84 @@
|
||||
package abacus.springboot.example.api.view;
|
||||
|
||||
// 货品查询
|
||||
public class JcProduct {
|
||||
|
||||
private String billid;
|
||||
private String billin;
|
||||
private String billhg;
|
||||
private String account;
|
||||
private String accountname;
|
||||
private String product;
|
||||
private String productname;
|
||||
private String wdtbillout;
|
||||
private int quantity;
|
||||
private int numbers;
|
||||
private String goodsid;
|
||||
|
||||
public String getGoodsid() {
|
||||
return goodsid;
|
||||
}
|
||||
public void setGoodsid(String goodsid) {
|
||||
this.goodsid = goodsid;
|
||||
}
|
||||
public int getQuantity() {
|
||||
return quantity;
|
||||
}
|
||||
public void setQuantity(int quantity) {
|
||||
this.quantity = quantity;
|
||||
}
|
||||
public int getNumbers() {
|
||||
return numbers;
|
||||
}
|
||||
public void setNumbers(int numbers) {
|
||||
this.numbers = numbers;
|
||||
}
|
||||
public String getBillid() {
|
||||
return billid;
|
||||
}
|
||||
public void setBillid(String billid) {
|
||||
this.billid = billid;
|
||||
}
|
||||
public String getBillin() {
|
||||
return billin;
|
||||
}
|
||||
public void setBillin(String billin) {
|
||||
this.billin = billin;
|
||||
}
|
||||
public String getBillhg() {
|
||||
return billhg;
|
||||
}
|
||||
public void setBillhg(String billhg) {
|
||||
this.billhg = billhg;
|
||||
}
|
||||
public String getAccount() {
|
||||
return account;
|
||||
}
|
||||
public void setAccount(String account) {
|
||||
this.account = account;
|
||||
}
|
||||
public String getAccountname() {
|
||||
return accountname;
|
||||
}
|
||||
public void setAccountname(String accountname) {
|
||||
this.accountname = accountname;
|
||||
}
|
||||
public String getProduct() {
|
||||
return product;
|
||||
}
|
||||
public void setProduct(String product) {
|
||||
this.product = product;
|
||||
}
|
||||
public String getProductname() {
|
||||
return productname;
|
||||
}
|
||||
public void setProductname(String productname) {
|
||||
this.productname = productname;
|
||||
}
|
||||
public String getWdtbillout() {
|
||||
return wdtbillout;
|
||||
}
|
||||
public void setWdtbillout(String wdtbillout) {
|
||||
this.wdtbillout = wdtbillout;
|
||||
}
|
||||
}
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
package abacus.springboot.example.api.view;
|
||||
|
||||
public class JcProductBillSouce {
|
||||
|
||||
private String indexno;
|
||||
private String billid;
|
||||
private String account;
|
||||
private String product;
|
||||
private String goodsid;
|
||||
|
||||
public String getIndexno() {
|
||||
return indexno;
|
||||
}
|
||||
public void setIndexno(String indexno) {
|
||||
this.indexno = indexno;
|
||||
}
|
||||
public String getBillid() {
|
||||
return billid;
|
||||
}
|
||||
public void setBillid(String billid) {
|
||||
this.billid = billid;
|
||||
}
|
||||
public String getAccount() {
|
||||
return account;
|
||||
}
|
||||
public void setAccount(String account) {
|
||||
this.account = account;
|
||||
}
|
||||
public String getProduct() {
|
||||
return product;
|
||||
}
|
||||
public void setProduct(String product) {
|
||||
this.product = product;
|
||||
}
|
||||
public String getGoodsid() {
|
||||
return goodsid;
|
||||
}
|
||||
public void setGoodsid(String goodsid) {
|
||||
this.goodsid = goodsid;
|
||||
}
|
||||
}
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
package abacus.springboot.example.config;
|
||||
|
||||
/**
|
||||
* <p>Title:JcConfigKey</p>
|
||||
<p>Description: 配置key的值</p>
|
||||
@author chuanZeng
|
||||
@date 2026年8月18日
|
||||
*/
|
||||
public class JcConfigKey {
|
||||
|
||||
/** keyGroup:系统号*/
|
||||
public static final String KEY_GROUP = "jc";
|
||||
|
||||
/** 二维码域名*/
|
||||
public static final String KEY_JC_SCAN_SOURCE = "jc.scan.source";
|
||||
|
||||
/** 固定店铺编码*/
|
||||
public static final String KEY_JC_WDT_DEPT = "jc.wdt.dept";
|
||||
|
||||
/** 是否自动分仓*/
|
||||
public static final String KEY_JC_WDT_FCFLAGE = "jc.wdt.fcFlage";
|
||||
|
||||
/** ERP-url*/
|
||||
public static final String KEY_JC_ERP_URL = "jc.erp.url";
|
||||
|
||||
/** set:线下支付*/
|
||||
public static final String KEY_JC_PAYMENT_OFFLINE = "jc.payment.offline";
|
||||
/** jc.payment.offline:账号名称*/
|
||||
public static final String KEY_JC_ZHMC = "zhmc";
|
||||
/** jc.payment.offline:开户银行*/
|
||||
public static final String KEY_JC_KHYH = "khyh";
|
||||
/** jc.payment.offline:银行账号*/
|
||||
public static final String KEY_JC_YHZH = "yhzh";
|
||||
|
||||
/** set:稽查收货仓库*/
|
||||
public static final String KEY_JC_WAREHOUSE = "jc.warehouse";
|
||||
}
|
||||
+175
@@ -0,0 +1,175 @@
|
||||
package abacus.springboot.example.config;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import abacus.config.dao.AbacusConfig;
|
||||
import abacus.config.dao.AbacusConfigItem;
|
||||
import abacus.config.wso.AbacusConfigNote;
|
||||
|
||||
/**
|
||||
* <p>Title:JcConfiguration</p>
|
||||
<p>Description: 系统配置定义</p>
|
||||
@author chuanZeng
|
||||
@date 2024年12月9日
|
||||
*/
|
||||
@Configuration
|
||||
public class JcConfiguration {
|
||||
|
||||
@Bean
|
||||
public AbacusConfigNote key_jc_scan_source() {
|
||||
AbacusConfigNote abacusConfigNote = new AbacusConfigNote();
|
||||
|
||||
AbacusConfig abacusConfig = new AbacusConfig();
|
||||
abacusConfig.setKeyGroup(JcConfigKey.KEY_GROUP);
|
||||
abacusConfig.setKey(JcConfigKey.KEY_JC_SCAN_SOURCE);
|
||||
abacusConfig.setValueType(AbacusConfig._Value);
|
||||
abacusConfig.setValuees("http://c.ztyxkj.com/,https://scan.vatsliquor.com/logistic/,https://scan.vats.com.cn/scan/");
|
||||
abacusConfig.setProcedures("API");
|
||||
abacusConfig.setInsulate(null);
|
||||
abacusConfig.setDescribe("溯源:二维码域名IP");
|
||||
|
||||
abacusConfigNote.setAbacusConfig(abacusConfig);
|
||||
return abacusConfigNote;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public AbacusConfigNote key_jc_payment_offline() {
|
||||
AbacusConfigNote abacusConfigNote = new AbacusConfigNote();
|
||||
|
||||
AbacusConfig abacusConfig = new AbacusConfig();
|
||||
abacusConfig.setKeyGroup(JcConfigKey.KEY_GROUP);
|
||||
abacusConfig.setKey(JcConfigKey.KEY_JC_PAYMENT_OFFLINE);
|
||||
abacusConfig.setValueType(AbacusConfig._Set);
|
||||
abacusConfig.setValuees(null);
|
||||
abacusConfig.setProcedures("API");
|
||||
abacusConfig.setInsulate(null);
|
||||
abacusConfig.setDescribe("支付方式:线下支付");
|
||||
|
||||
List<AbacusConfigItem> abacusConfigItems = new ArrayList<AbacusConfigItem>();
|
||||
|
||||
AbacusConfigItem aci = new AbacusConfigItem();
|
||||
aci.setKeyGroup(JcConfigKey.KEY_GROUP);
|
||||
aci.setKey(JcConfigKey.KEY_JC_PAYMENT_OFFLINE);
|
||||
aci.setCode(JcConfigKey.KEY_JC_ZHMC);
|
||||
aci.setName("张三");
|
||||
aci.setInsulate(null);
|
||||
aci.setDescribe("账户名称");
|
||||
abacusConfigItems.add(aci);
|
||||
|
||||
AbacusConfigItem aci1 = new AbacusConfigItem();
|
||||
aci1.setKeyGroup(JcConfigKey.KEY_GROUP);
|
||||
aci1.setKey(JcConfigKey.KEY_JC_PAYMENT_OFFLINE);
|
||||
aci1.setCode(JcConfigKey.KEY_JC_KHYH);
|
||||
aci1.setName("工商银行");
|
||||
aci1.setInsulate(null);
|
||||
aci1.setDescribe("开户银行");
|
||||
abacusConfigItems.add(aci1);
|
||||
|
||||
AbacusConfigItem aci2 = new AbacusConfigItem();
|
||||
aci2.setKeyGroup(JcConfigKey.KEY_GROUP);
|
||||
aci2.setKey(JcConfigKey.KEY_JC_PAYMENT_OFFLINE);
|
||||
aci2.setCode(JcConfigKey.KEY_JC_YHZH);
|
||||
aci2.setName("0101010020023090");
|
||||
aci2.setInsulate(null);
|
||||
aci2.setDescribe("银行账户");
|
||||
abacusConfigItems.add(aci2);
|
||||
|
||||
abacusConfigNote.setAbacusConfig(abacusConfig);
|
||||
abacusConfigNote.setAbacusConfigItems(abacusConfigItems);
|
||||
return abacusConfigNote;
|
||||
}
|
||||
|
||||
|
||||
@Bean
|
||||
public AbacusConfigNote key_jc_wdt_dept() {
|
||||
AbacusConfigNote abacusConfigNote = new AbacusConfigNote();
|
||||
|
||||
AbacusConfig abacusConfig = new AbacusConfig();
|
||||
abacusConfig.setKeyGroup(JcConfigKey.KEY_GROUP);
|
||||
abacusConfig.setKey(JcConfigKey.KEY_JC_WDT_DEPT);
|
||||
abacusConfig.setValueType(AbacusConfig._Value);
|
||||
abacusConfig.setValuees("0001");
|
||||
abacusConfig.setProcedures("旺店通固定店铺编码");
|
||||
abacusConfig.setInsulate(null);
|
||||
abacusConfig.setDescribe("旺店通固定店铺编码");
|
||||
|
||||
abacusConfigNote.setAbacusConfig(abacusConfig);
|
||||
return abacusConfigNote;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public AbacusConfigNote key_jc_wdt_fcflage() {
|
||||
AbacusConfigNote abacusConfigNote = new AbacusConfigNote();
|
||||
|
||||
AbacusConfig abacusConfig = new AbacusConfig();
|
||||
abacusConfig.setKeyGroup(JcConfigKey.KEY_GROUP);
|
||||
abacusConfig.setKey(JcConfigKey.KEY_JC_WDT_FCFLAGE);
|
||||
abacusConfig.setValueType(AbacusConfig._Value);
|
||||
abacusConfig.setValuees("true");
|
||||
abacusConfig.setProcedures("是否自动分仓");
|
||||
abacusConfig.setInsulate(null);
|
||||
abacusConfig.setDescribe("是否自动分仓");
|
||||
|
||||
abacusConfigNote.setAbacusConfig(abacusConfig);
|
||||
return abacusConfigNote;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public AbacusConfigNote key_jc_erp_url() {
|
||||
AbacusConfigNote abacusConfigNote = new AbacusConfigNote();
|
||||
|
||||
AbacusConfig abacusConfig = new AbacusConfig();
|
||||
abacusConfig.setKeyGroup(JcConfigKey.KEY_GROUP);
|
||||
abacusConfig.setKey(JcConfigKey.KEY_JC_ERP_URL);
|
||||
abacusConfig.setValueType(AbacusConfig._Value);
|
||||
abacusConfig.setValuees("http://");
|
||||
abacusConfig.setProcedures("erp的IP");
|
||||
abacusConfig.setInsulate(null);
|
||||
abacusConfig.setDescribe("erp的IP");
|
||||
|
||||
abacusConfigNote.setAbacusConfig(abacusConfig);
|
||||
return abacusConfigNote;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public AbacusConfigNote key_jc_warehouse() {
|
||||
AbacusConfigNote abacusConfigNote = new AbacusConfigNote();
|
||||
|
||||
AbacusConfig abacusConfig = new AbacusConfig();
|
||||
abacusConfig.setKeyGroup(JcConfigKey.KEY_GROUP);
|
||||
abacusConfig.setKey(JcConfigKey.KEY_JC_WAREHOUSE);
|
||||
abacusConfig.setValueType(AbacusConfig._Set);
|
||||
abacusConfig.setValuees(null);
|
||||
abacusConfig.setProcedures("API");
|
||||
abacusConfig.setInsulate(null);
|
||||
abacusConfig.setDescribe("稽查收货仓库");
|
||||
|
||||
// List<AbacusConfigItem> abacusConfigItems = new ArrayList<AbacusConfigItem>();
|
||||
//
|
||||
// AbacusConfigItem aci = new AbacusConfigItem();
|
||||
// aci.setKeyGroup(JcConfigKey.KEY_GROUP);
|
||||
// aci.setKey(JcConfigKey.KEY_JC_WAREHOUSE);
|
||||
// aci.setCode("237881");
|
||||
// aci.setName("江苏致众盐城仓库");
|
||||
// aci.setInsulate(null);
|
||||
// aci.setDescribe("稽查收货仓库");
|
||||
// abacusConfigItems.add(aci);
|
||||
//
|
||||
// AbacusConfigItem aci1 = new AbacusConfigItem();
|
||||
// aci1.setKeyGroup(JcConfigKey.KEY_GROUP);
|
||||
// aci1.setKey(JcConfigKey.KEY_JC_WAREHOUSE);
|
||||
// aci1.setCode("288381");
|
||||
// aci1.setName("上海一区");
|
||||
// aci1.setInsulate(null);
|
||||
// aci1.setDescribe("稽查收货仓库");
|
||||
// abacusConfigItems.add(aci1);
|
||||
|
||||
abacusConfigNote.setAbacusConfig(abacusConfig);
|
||||
// abacusConfigNote.setAbacusConfigItems(abacusConfigItems);
|
||||
return abacusConfigNote;
|
||||
}
|
||||
}
|
||||
+50
@@ -0,0 +1,50 @@
|
||||
package abacus.springboot.example.config;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import com.abacus.xpos.foundation.pubs.DaoIdGenerator;
|
||||
|
||||
/**
|
||||
* <p>Title:JcIdGeneratorConfig</p>
|
||||
<p>Description: ID生成器</p>
|
||||
@author chuanZeng
|
||||
@date 2024年12月5日
|
||||
*/
|
||||
@Configuration
|
||||
public class JcIdGeneratorConfig {
|
||||
|
||||
@Autowired
|
||||
private EntityManager entityManager;
|
||||
|
||||
@Bean(name="jcBillIdGenerator")
|
||||
public DaoIdGenerator jcBillIdGenerator() {
|
||||
DaoIdGenerator daoIdGenerator = new DaoIdGenerator();
|
||||
daoIdGenerator.setTargetTableName("jc_bill");
|
||||
daoIdGenerator.setPrefix("JC");
|
||||
daoIdGenerator.setTargetIdColumnName("id");
|
||||
daoIdGenerator.setSerialLength(4);
|
||||
daoIdGenerator.setUseDAOId(false);
|
||||
daoIdGenerator.setUseDateFormat(true);
|
||||
//年月日
|
||||
daoIdGenerator.setDateFormat("yyyyMMdd");
|
||||
return daoIdGenerator;
|
||||
}
|
||||
|
||||
@Bean(name="jcBillHgIdGenerator")
|
||||
public DaoIdGenerator jcBillHgIdGenerator() {
|
||||
DaoIdGenerator daoIdGenerator = new DaoIdGenerator();
|
||||
daoIdGenerator.setTargetTableName("jc_billhg");
|
||||
daoIdGenerator.setPrefix("HG");
|
||||
daoIdGenerator.setTargetIdColumnName("id");
|
||||
daoIdGenerator.setSerialLength(4);
|
||||
daoIdGenerator.setUseDAOId(false);
|
||||
daoIdGenerator.setUseDateFormat(true);
|
||||
//年月日
|
||||
daoIdGenerator.setDateFormat("yyyyMMdd");
|
||||
return daoIdGenerator;
|
||||
}
|
||||
}
|
||||
+168
@@ -0,0 +1,168 @@
|
||||
package abacus.springboot.example.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.abacus.xpos.foundation.dao.Dept;
|
||||
import com.abacus.xpos.foundation.dao.Employee;
|
||||
|
||||
import abacus.config.dao.AbacusConfigItem;
|
||||
import abacus.springboot.example.config.JcConfigKey;
|
||||
import abacus.springboot.example.dao.JcBill;
|
||||
import abacus.springboot.example.pi.AutoCompleteAccessIF;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Title:AutoCompleteController
|
||||
* </p>
|
||||
* <p>
|
||||
* Description: 前端检索查询-api
|
||||
* </p>
|
||||
*
|
||||
* @author chuanZeng
|
||||
* @date 2022年4月26日
|
||||
*/
|
||||
@RestController()
|
||||
@RequestMapping(value = "/autoComplete")
|
||||
public class AutoCompleteController extends BaseServlet {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(AutoCompleteController.class);
|
||||
|
||||
@Autowired
|
||||
private AutoCompleteAccessIF autoCompleteAccess;
|
||||
|
||||
/**
|
||||
* 检索:收货仓库
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
* @throws Throwable
|
||||
*/
|
||||
@RequestMapping(value = "abacusConfigItemGroupAutoComplete", method = RequestMethod.POST)
|
||||
public List<AbacusConfigItem> abacusConfigItemGroupAutoComplete(@RequestParam(required = false) String keyCode) throws Throwable {
|
||||
try {
|
||||
List<AbacusConfigItem> objs = this.autoCompleteAccess.abacusConfigItemGroupAutoComplete(keyCode, JcConfigKey.KEY_GROUP, JcConfigKey.KEY_JC_WAREHOUSE);
|
||||
return objs;
|
||||
} catch (Throwable e) {
|
||||
LOG.error(e.getMessage(), e);
|
||||
e.printStackTrace();
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 检索:稽查
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
* @throws Throwable
|
||||
*/
|
||||
@RequestMapping(value = "jcBillAutoComplete", method = RequestMethod.POST)
|
||||
public List<JcBill> jcBillAutoComplete(@RequestParam(required = false) String keyCode) throws Throwable {
|
||||
try {
|
||||
List<JcBill> objs = this.autoCompleteAccess.jcBillAutoComplete(keyCode);
|
||||
return objs;
|
||||
} catch (Throwable e) {
|
||||
LOG.error(e.getMessage(), e);
|
||||
e.printStackTrace();
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 检索:门店
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
* @throws Throwable
|
||||
*/
|
||||
@RequestMapping(value = "deptAutoComplete", method = RequestMethod.POST)
|
||||
public List<Dept> deptAutoComplete(@RequestParam(required = false) String keyCode,
|
||||
@RequestParam(required = false) String type) throws Throwable {
|
||||
try {
|
||||
List<Dept> objs = this.autoCompleteAccess.deptAutoComplete(keyCode, type);
|
||||
return objs;
|
||||
} catch (Throwable e) {
|
||||
LOG.error(e.getMessage(), e);
|
||||
e.printStackTrace();
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 检索:分销门店
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
* @throws Throwable
|
||||
*/
|
||||
@RequestMapping(value = "deptFxAutoComplete", method = RequestMethod.POST)
|
||||
public List<Dept> deptFxAutoComplete(@RequestParam(required = false) String keyCode) throws Throwable {
|
||||
try {
|
||||
List<Dept> objs = this.autoCompleteAccess.deptAutoComplete(keyCode, "17");
|
||||
return objs;
|
||||
} catch (Throwable e) {
|
||||
LOG.error(e.getMessage(), e);
|
||||
e.printStackTrace();
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 检索:员工
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
* @throws Throwable
|
||||
*/
|
||||
@RequestMapping(value = "employeeAutoComplete", method = RequestMethod.POST)
|
||||
public List<Employee> employeeAutoComplete(@RequestParam(required = false) String keyCode) throws Throwable {
|
||||
try {
|
||||
List<Employee> objs = this.autoCompleteAccess.employeeAutoComplete(keyCode);
|
||||
return objs;
|
||||
} catch (Throwable e) {
|
||||
LOG.error(e.getMessage(), e);
|
||||
e.printStackTrace();
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+222
@@ -0,0 +1,222 @@
|
||||
package abacus.springboot.example.controller;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import com.abacus.xpos.foundation.pubs.UserContext;
|
||||
|
||||
import abacus.commons.exception.BusinessException;
|
||||
import abacus.config.ext.AbacusExtConfig;
|
||||
|
||||
/**
|
||||
* <p>Title:BaseServlet</p>
|
||||
<p>Description: 基础控制器</p>
|
||||
@author chuanZeng
|
||||
@date 2026年8月18日
|
||||
*/
|
||||
public class BaseServlet{
|
||||
|
||||
@Autowired
|
||||
private AbacusExtConfig abacusExtConfig;
|
||||
|
||||
/**
|
||||
* value-获取配置参数
|
||||
* @param configKey
|
||||
* @return
|
||||
* @throws WebserviceException
|
||||
*/
|
||||
protected String getConfigValue(String configKey) throws BusinessException {
|
||||
String configValueStr = abacusExtConfig.getAbacusConfigValue(configKey);
|
||||
if (StringUtils.isBlank(configValueStr)) {
|
||||
throw new BusinessException("配置参数[" + configKey + "]值不存在!");
|
||||
}
|
||||
return configValueStr;
|
||||
}
|
||||
|
||||
/**
|
||||
* set-获取配置参数
|
||||
* @param configKey
|
||||
* @return
|
||||
* @throws WebserviceException
|
||||
*/
|
||||
protected Map<String, String> getConfigSet(String keyGroup, String configKey) throws BusinessException {
|
||||
Map<String, String> configValueStr = abacusExtConfig.getAbacusConfigSetByKeyGroupByKey(keyGroup, configKey);
|
||||
if (configValueStr.isEmpty()) {
|
||||
throw new BusinessException("系统[" + keyGroup + "]配置参数[" + configKey + "]值不存在!");
|
||||
}
|
||||
return configValueStr;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取登陆用户id
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
protected String getUserId() throws BusinessException {
|
||||
String operatorId = UserContext.getUserId();
|
||||
if (StringUtils.isBlank(operatorId)){
|
||||
throw new BusinessException("操作员不存在,请重新登录!");
|
||||
}
|
||||
|
||||
return operatorId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取登陆用户姓名
|
||||
* @return
|
||||
*/
|
||||
protected String getUserName() throws BusinessException{
|
||||
String operatorName = UserContext.getUserName();
|
||||
if (StringUtils.isBlank(operatorName)){
|
||||
throw new BusinessException("操作员不存在,请重新登录!");
|
||||
}
|
||||
|
||||
return operatorName;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取登陆用户所属部门id
|
||||
* @return
|
||||
*/
|
||||
protected String getDeptId() throws BusinessException{
|
||||
String deptId = UserContext.getDeptId();
|
||||
if (StringUtils.isBlank(deptId)){
|
||||
throw new BusinessException("操作员所属部门不存在,请重新登录!");
|
||||
}
|
||||
|
||||
return deptId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取登陆用户所属部门名称
|
||||
* @return
|
||||
*/
|
||||
protected String getDeptName() throws BusinessException{
|
||||
String deptName = UserContext.getDeptName();
|
||||
if (StringUtils.isBlank(deptName)){
|
||||
throw new BusinessException("操作员所属部门不存在,请重新登录!");
|
||||
}
|
||||
|
||||
return deptName;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* 获取double型的参数
|
||||
*
|
||||
* @param request
|
||||
* @param paramName
|
||||
* @return
|
||||
*/
|
||||
protected Double getDoubleParameter(HttpServletRequest request, String paramName) {
|
||||
//
|
||||
String paramValue = request.getParameter(paramName);
|
||||
if (StringUtils.isBlank(paramValue)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return Double.valueOf(paramValue);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* 获取long型的参数
|
||||
*
|
||||
* @param request
|
||||
* @param paramName
|
||||
* @return
|
||||
*/
|
||||
protected Long getLongParameter(HttpServletRequest request, String paramName) {
|
||||
//
|
||||
String paramValue = request.getParameter(paramName);
|
||||
if (StringUtils.isBlank(paramValue)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return Long.valueOf(paramValue);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* 获取int型的参数
|
||||
*
|
||||
* @param request
|
||||
* @param paramName
|
||||
* @return
|
||||
*/
|
||||
protected Integer getIntegerParameter(HttpServletRequest request, String paramName) {
|
||||
//
|
||||
String paramValue = request.getParameter(paramName);
|
||||
if (StringUtils.isBlank(paramValue)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return Integer.valueOf(paramValue);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* 获取Boolean型的参数
|
||||
*
|
||||
* @param request
|
||||
* @param paramName
|
||||
* @return
|
||||
*/
|
||||
protected Boolean getBooleanParameter(HttpServletRequest request, String paramName) {
|
||||
//
|
||||
String paramValue = request.getParameter(paramName);
|
||||
|
||||
if ("true".equalsIgnoreCase(paramValue)) {
|
||||
return true;
|
||||
}else if ("false".equalsIgnoreCase(paramValue)) {
|
||||
return false;
|
||||
}else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 正则表达式校验手机号码
|
||||
*
|
||||
* @return false 则手机号码不合法,true 则手机号码校验通过
|
||||
*/
|
||||
protected Boolean validatePhoneNumber(String phoneNumber) {
|
||||
if (phoneNumber.length() != 11) {
|
||||
System.out.print("手机号应为11位数 ");
|
||||
return false;
|
||||
} else {
|
||||
String regPattern = "^(1)\\d{10}$";
|
||||
Pattern pattern = Pattern.compile(regPattern);
|
||||
Matcher matcher = pattern.matcher(phoneNumber);
|
||||
boolean isMatch = matcher.matches();
|
||||
if (!isMatch) {
|
||||
System.out.print("请填入正确的手机号 ");
|
||||
}
|
||||
return isMatch;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 良友-crm回调函数
|
||||
*/
|
||||
protected Map<String, Object> crmReturn(int code, String message, String content) {
|
||||
Map<String, Object> map = new LinkedHashMap<String, Object>();
|
||||
|
||||
map.put("code", code);
|
||||
map.put("message", message);
|
||||
map.put("content", content);
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
+751
@@ -0,0 +1,751 @@
|
||||
package abacus.springboot.example.controller;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.abacus.pms.dao.Account;
|
||||
import com.abacus.pms.wsi.AccountServiceIF;
|
||||
import com.abacus.pms.wsi.ProductServiceIF;
|
||||
import com.abacus.xpos.foundation.pubs.DaoIdGenerator;
|
||||
import com.abacus.xpos.foundation.wsi.EmployeeServiceIF;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
import abacus.commons.exception.BusinessException;
|
||||
import abacus.springboot.example.config.JcConfigKey;
|
||||
import abacus.springboot.example.dao.JcBill;
|
||||
import abacus.springboot.example.dao.JcBillHg;
|
||||
import abacus.springboot.example.dao.JcBillInItem;
|
||||
import abacus.springboot.example.dao.JcBillPhoto;
|
||||
import abacus.springboot.example.dao.JcBillSourceItem;
|
||||
import abacus.springboot.example.util.DateToUpperChinese;
|
||||
import abacus.springboot.example.util.DateUtil;
|
||||
import abacus.springboot.example.vo.SiDepositlocation;
|
||||
import abacus.springboot.example.wsi.JcBillServiceIF;
|
||||
|
||||
/**
|
||||
* <p>Title:JcBillHgController</p>
|
||||
<p>Description: 前端相关-api</p>
|
||||
@author chuanZeng
|
||||
@date 2026年8月18日
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping(value = "/jc/billHg")
|
||||
public class JcBillHgController extends BaseServlet{
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(JcBillHgController.class);
|
||||
|
||||
@Autowired
|
||||
private JcBillServiceIF jcBillService;
|
||||
|
||||
@Autowired
|
||||
private AccountServiceIF accountService;
|
||||
|
||||
@Autowired
|
||||
private ProductServiceIF productService;
|
||||
|
||||
@Autowired
|
||||
private DaoIdGenerator jcBillHgIdGenerator;
|
||||
|
||||
@Autowired
|
||||
private EmployeeServiceIF employeeService;
|
||||
|
||||
/**
|
||||
* TODO 稽查入库(回购通知)明细
|
||||
* @param billId
|
||||
* @return
|
||||
* @throws Throwable
|
||||
*/
|
||||
@RequestMapping(value = "queryJcBillInItems", method = RequestMethod.POST)
|
||||
public JSONObject queryJcBillInItems(
|
||||
@RequestParam(required = true) String billId
|
||||
)
|
||||
throws Throwable {
|
||||
try {
|
||||
|
||||
List<JcBillInItem> items = jcBillService.queryJcBillInItemByBillId(billId);
|
||||
|
||||
if(items == null) throw new BusinessException("回购明细不存在!");
|
||||
|
||||
List<JcBillInItem> oneList = new ArrayList<JcBillInItem>();
|
||||
List<JcBillInItem> twoList = new ArrayList<JcBillInItem>();
|
||||
|
||||
|
||||
for(JcBillInItem item : items) {
|
||||
if(JcBillInItem.STATUS_TWO != item.getStatus()) {
|
||||
Account account = accountService.getAccount(item.getAccount());
|
||||
if(account != null) {
|
||||
item.setOperator(account.getOperator().getId());
|
||||
item.setOperatorname(account.getOperator().getName());
|
||||
item.setSalearea(account.getSalearea());
|
||||
} else {
|
||||
item.setSalearea("");
|
||||
item.setSaleareaname("");
|
||||
item.setGroupid("");
|
||||
item.setGroupname("");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
jcBillService.saveJcBillInItem(items);
|
||||
|
||||
// 分出,已通知或未通知
|
||||
for(JcBillInItem item : items) {
|
||||
if(JcBillInItem.STATUS_MINUS_ONE == item.getStatus() || JcBillInItem.STATUS_ONE == item.getStatus()) {
|
||||
// item.setPrice(new BigDecimal(String.valueOf(item.getPrice())).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
|
||||
oneList.add(item);
|
||||
} else {
|
||||
// item.setPrice(new BigDecimal(String.valueOf(item.getPrice())).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
|
||||
twoList.add(item);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
JSONObject obj = new JSONObject();
|
||||
|
||||
obj.put("oneList", oneList);
|
||||
obj.put("twoList", twoList);
|
||||
obj.put("threeList", items);
|
||||
|
||||
return obj;
|
||||
} catch(Throwable e){
|
||||
LOG.error(e.getMessage(), e);
|
||||
e.printStackTrace();
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO 查询回购明细对应的溯源信息
|
||||
* @param id
|
||||
* @return
|
||||
* @throws Throwable
|
||||
*/
|
||||
@RequestMapping(value = "queryHgSourceItems", method = RequestMethod.POST)
|
||||
public List<JcBillSourceItem> queryHgSourceItems(
|
||||
@RequestParam(required = true) String id
|
||||
)
|
||||
throws Throwable {
|
||||
try {
|
||||
JcBillInItem inItem = jcBillService.queryJcBillInItemById(Long.parseLong(id));
|
||||
|
||||
if(inItem == null) throw new BusinessException("回购明细不存在!");
|
||||
|
||||
List<JcBillSourceItem> billItems = jcBillService.queryJcBillSourceItemByBillId(inItem.getBillid());
|
||||
|
||||
if(billItems == null) throw new BusinessException("溯源信息不存在!");
|
||||
|
||||
// 按客户编码+商品编码+收货单价分组
|
||||
Map<String, List<JcBillSourceItem>> mapItems = billItems.stream()
|
||||
.collect(Collectors.groupingBy(e -> {
|
||||
return e.getAccount() + "#" + e.getProduct() + "#" + String.valueOf(e.getPrice());
|
||||
},
|
||||
Collectors.collectingAndThen(Collectors.toList(), value -> value)
|
||||
));
|
||||
|
||||
Map<String, List<JcBillPhoto>> mapPhoto = jcBillService.queryJcBillPhoto(inItem.getBillid());
|
||||
|
||||
// 找出对应的来源明细
|
||||
List<JcBillSourceItem> tempItems = mapItems.get(inItem.getAccount() + "#" + inItem.getProduct() + "#" + String.valueOf(inItem.getPrice()));
|
||||
|
||||
for(JcBillSourceItem item : tempItems) {
|
||||
|
||||
// 稽查付款截图
|
||||
List<JcBillPhoto> fkts = mapPhoto.get(JcBillPhoto.JC_FK + "#" + String.valueOf(item.getIndexno()));
|
||||
if(fkts != null && fkts.size() >= 1) {
|
||||
List<String> fkList = new ArrayList<String>();
|
||||
|
||||
for(JcBillPhoto fkt : fkts) {
|
||||
fkList.add(fkt.getUrlphoto());
|
||||
}
|
||||
|
||||
item.setPaymentPhoto(fkList);
|
||||
}
|
||||
|
||||
// 货品图
|
||||
List<JcBillPhoto> hpts = mapPhoto.get(JcBillPhoto.JC_HP + "#" + String.valueOf(item.getIndexno()) + "#" + item.getGoodsid());
|
||||
if(hpts != null && hpts.size() >= 1) {
|
||||
List<String> hpList = new ArrayList<String>();
|
||||
|
||||
for(JcBillPhoto hpt : hpts) {
|
||||
hpList.add(hpt.getUrlphoto());
|
||||
}
|
||||
|
||||
item.setGoodsPhotos(hpList);
|
||||
item.setHpts(hpts);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return tempItems;
|
||||
} catch(Throwable e){
|
||||
LOG.error(e.getMessage(), e);
|
||||
e.printStackTrace();
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* TODO 终止回购
|
||||
* @param id
|
||||
* @return
|
||||
* @throws Throwable
|
||||
*/
|
||||
@RequestMapping(value = "terminateHgInItem", method = RequestMethod.POST)
|
||||
public void terminateHgInItem(
|
||||
@RequestParam(required = true) String id
|
||||
)
|
||||
throws Throwable {
|
||||
try {
|
||||
|
||||
JcBillInItem inItem = jcBillService.queryJcBillInItemById(Long.parseLong(id));
|
||||
|
||||
if(inItem == null) throw new BusinessException("回购明细不存在!");
|
||||
|
||||
inItem.setStatus(JcBillInItem.STATUS_MINUS_ONE);
|
||||
|
||||
jcBillService.saveTerminateHgInItem(inItem);
|
||||
|
||||
} catch(Throwable e){
|
||||
LOG.error(e.getMessage(), e);
|
||||
e.printStackTrace();
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO 修改回购价格
|
||||
* @param id
|
||||
* @return
|
||||
* @throws Throwable
|
||||
*/
|
||||
@RequestMapping(value = "updateHgprice", method = RequestMethod.POST)
|
||||
public JcBillInItem updateHgprice(
|
||||
@RequestParam(required = true) String id,
|
||||
@RequestParam(required = true) String hgprice
|
||||
)
|
||||
throws Throwable {
|
||||
try {
|
||||
|
||||
JcBillInItem inItem = jcBillService.queryJcBillInItemById(Long.parseLong(id));
|
||||
if(inItem == null) throw new BusinessException("回购明细不存在!");
|
||||
|
||||
inItem.setOldhgprice(inItem.getHgprice());
|
||||
|
||||
BigDecimal bigHgprice = new BigDecimal(hgprice);
|
||||
|
||||
BigDecimal bigAmount = bigHgprice.multiply(new BigDecimal(String.valueOf(inItem.getQuantity())));
|
||||
|
||||
inItem.setHgprice(bigHgprice.doubleValue());
|
||||
inItem.setHgamount(bigAmount.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
|
||||
|
||||
jcBillService.updateHgprice(inItem);
|
||||
|
||||
return inItem;
|
||||
} catch(Throwable e){
|
||||
LOG.error(e.getMessage(), e);
|
||||
e.printStackTrace();
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* TODO 回购查询
|
||||
* @param id
|
||||
* @return
|
||||
* @throws Throwable
|
||||
*/
|
||||
@RequestMapping(value = "queryHg", method = RequestMethod.POST)
|
||||
public JSONObject queryHg(
|
||||
@RequestParam(required = false) String from,
|
||||
@RequestParam(required = false) String thru,
|
||||
|
||||
@RequestParam(required = false) String account,
|
||||
@RequestParam(required = false) String salearea,
|
||||
@RequestParam(required = false) String id,
|
||||
@RequestParam(required = false) String billId,
|
||||
@RequestParam(required = false) String status,
|
||||
@RequestParam(required = false) String product,
|
||||
@RequestParam(required = false) String manager,
|
||||
@RequestParam(required = true) int typ,
|
||||
|
||||
@RequestParam(required = true) int page,
|
||||
@RequestParam(required = true) int size
|
||||
)
|
||||
throws Throwable {
|
||||
try {
|
||||
|
||||
// 创建起始时间
|
||||
String fromDate = null;
|
||||
if (StringUtils.isNotBlank(from)) {
|
||||
fromDate = DateUtil.formatDateTime(DateUtil.getFromDate(DateUtil.toDate(from)));
|
||||
}
|
||||
// 创建截止时间
|
||||
String thruDate = null;
|
||||
if (StringUtils.isNotBlank(thru)) {
|
||||
thruDate = DateUtil.formatDateTime(DateUtil.getThruDate(DateUtil.toDate(thru)));
|
||||
}
|
||||
|
||||
// 当前页
|
||||
// int pageNumber = page/size + 1;
|
||||
Pageable pageable = PageRequest.of(page - 1, size);
|
||||
|
||||
Page<JcBillHg> pages = jcBillService.queryJcBillHg(fromDate, thruDate, account, salearea, id, billId,
|
||||
status, product, manager, typ, pageable);
|
||||
|
||||
for(JcBillHg hg : pages.getContent()) {
|
||||
hg.setAmount(hg.getSubtotal() + hg.getFreight());
|
||||
}
|
||||
|
||||
JSONObject obj = new JSONObject();
|
||||
|
||||
obj.put("list", pages.getContent());
|
||||
obj.put("total", pages.getTotalElements());
|
||||
|
||||
return obj;
|
||||
} catch(Throwable e){
|
||||
LOG.error(e.getMessage(), e);
|
||||
e.printStackTrace();
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* TODO 回购-驳回
|
||||
* 待提交-->回购通知节点
|
||||
* 待付款-->待提交,
|
||||
* 已付款-->待付款
|
||||
* 待分仓-->已付款
|
||||
* @param billId
|
||||
* @param typ 1-回购认款,2-回购分仓
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "rejectBillHg", method = RequestMethod.POST)
|
||||
public JcBillHg rejectBillHg(
|
||||
@RequestParam(required = false) String billHgId,
|
||||
@RequestParam(required = false) int status,
|
||||
@RequestParam(required = true) int typ
|
||||
)
|
||||
throws Throwable {
|
||||
try {
|
||||
|
||||
JcBillHg billHg = jcBillService.queryJcBillHg(billHgId);
|
||||
|
||||
if(billHg == null) throw new BusinessException("回购订单不存在!");
|
||||
|
||||
List<JcBillInItem> inItems = null;
|
||||
JcBill jcBill = null;
|
||||
if(JcBillHg.STATUS_ONE == status) {
|
||||
|
||||
inItems = jcBillService.queryJcBillInItemByBillId(billHg.getBillid());
|
||||
|
||||
if(inItems == null) throw new BusinessException("回购明细不存在!");
|
||||
|
||||
// 设置明细状态和回购单号为空
|
||||
|
||||
// 是否部分回购
|
||||
boolean informFlag = false;
|
||||
for(JcBillInItem item : inItems) {
|
||||
if(billHgId.equals(item.getBillhg())) {
|
||||
item.setStatus(JcBillInItem.STATUS_ONE);
|
||||
item.setBillhg(null);
|
||||
}
|
||||
if(item.getStatus() == JcBillInItem.STATUS_TWO) {
|
||||
informFlag = true;
|
||||
}
|
||||
}
|
||||
|
||||
jcBill = jcBillService.queryJcBillById(billHg.getBillid());
|
||||
|
||||
if(jcBill == null) throw new BusinessException("收货记录不存在!");
|
||||
|
||||
// 稽查收货记录修改状态
|
||||
// if(informFlag) jcBill.setStatus(JcBill.STATUS_SIX);
|
||||
// else jcBill.setStatus(JcBill.STATUS_FIVE);
|
||||
if(informFlag) jcBill.setHgstatus(JcBill.HGSTATUS_ONE);
|
||||
else jcBill.setStatus(JcBill.STATUS_FIVE);
|
||||
|
||||
billHg.setStatus(JcBillHg.STATUS_MINUS_ONE);
|
||||
|
||||
} else if(JcBillHg.STATUS_TWO == status) {
|
||||
|
||||
billHg.setStatus(JcBillHg.STATUS_ONE);
|
||||
|
||||
} else if(JcBillHg.STATUS_THREE == status || JcBillHg.STATUS_FOUR == status) {
|
||||
|
||||
billHg.setStatus(JcBillHg.STATUS_TWO);
|
||||
|
||||
} else if(JcBillHg.STATUS_FIVE == status) {
|
||||
|
||||
SiDepositlocation sd = jcBillService.querySiDepositlocationHGfc(billHg.getId());
|
||||
|
||||
if(sd == null) {// WDT
|
||||
throw new BusinessException("该单据需要通知仓库在旺店通删除入库单,并联系信息部撤回。");
|
||||
} else {
|
||||
if(sd.getPush() == 1) {// WMS
|
||||
|
||||
JSONObject obj = jcBillService.gwisSubCancelOrder(billHg.getId(), "B2BCK");
|
||||
|
||||
if(obj.getBooleanValue("success")) {
|
||||
|
||||
billHg.setStatus(JcBillHg.STATUS_FOUR);
|
||||
} else {
|
||||
throw new BusinessException(obj.getString("body"));
|
||||
}
|
||||
} else {
|
||||
throw new BusinessException("该单据需要通知仓库在旺店通删除入库单,并联系信息部撤回。");
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
throw new BusinessException("未知状态不能驳回!");
|
||||
}
|
||||
|
||||
jcBillService.saveRejectBillHg(status, typ, jcBill, billHg, inItems);
|
||||
|
||||
billHg.setAmount(billHg.getSubtotal() + billHg.getFreight());
|
||||
|
||||
return billHg;
|
||||
} catch(Throwable e){
|
||||
LOG.error(e.getMessage(), e);
|
||||
e.printStackTrace();
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO 确认收款
|
||||
* @param billId
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "querenSk", method = RequestMethod.POST)
|
||||
public JcBillHg querenSk(
|
||||
@RequestParam(required = false) String billHgId
|
||||
)
|
||||
throws Throwable {
|
||||
try {
|
||||
|
||||
JcBillHg billHg = jcBillService.queryJcBillHg(billHgId);
|
||||
|
||||
if(billHg == null) throw new BusinessException("回购订单不存在!");
|
||||
|
||||
String key_jc_wdt_fcflage = getConfigValue(JcConfigKey.KEY_JC_WDT_FCFLAGE);
|
||||
boolean fcFlag = Boolean.parseBoolean(key_jc_wdt_fcflage);
|
||||
|
||||
if(fcFlag) billHg.setStatus(JcBillHg.STATUS_FIVE);
|
||||
else billHg.setStatus(JcBillHg.STATUS_FOUR);
|
||||
|
||||
|
||||
jcBillService.saveQuerenSk(billHg, fcFlag);
|
||||
|
||||
|
||||
billHg.setAmount(billHg.getSubtotal() + billHg.getFreight());
|
||||
|
||||
return billHg;
|
||||
} catch(Throwable e){
|
||||
LOG.error(e.getMessage(), e);
|
||||
e.printStackTrace();
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO 分仓
|
||||
* @param billId
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "createFc", method = RequestMethod.POST)
|
||||
public JcBillHg createFc(
|
||||
@RequestParam(required = false) String billHgId
|
||||
)
|
||||
throws Throwable {
|
||||
try {
|
||||
|
||||
JcBillHg billHg = jcBillService.queryJcBillHg(billHgId);
|
||||
|
||||
if(billHg == null) throw new BusinessException("回购订单不存在!");
|
||||
|
||||
billHg.setStatus(JcBillHg.STATUS_FIVE);
|
||||
|
||||
jcBillService.savecreateFc(billHg);
|
||||
|
||||
billHg.setAmount(billHg.getSubtotal() + billHg.getFreight());
|
||||
|
||||
return billHg;
|
||||
} catch(Throwable e){
|
||||
LOG.error(e.getMessage(), e);
|
||||
e.printStackTrace();
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* TODO 修改分仓仓库
|
||||
* @param billId
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "updateFcWarehouse", method = RequestMethod.POST)
|
||||
public JcBillHg updateFcWarehouse(
|
||||
@RequestParam(required = true) String billHgId,
|
||||
@RequestParam(required = true) String warehouse,
|
||||
@RequestParam(required = true) String warehouseName
|
||||
)
|
||||
throws Throwable {
|
||||
try {
|
||||
JcBillHg billHg = jcBillService.queryJcBillHg(billHgId);
|
||||
|
||||
if(billHg == null) throw new BusinessException("回购订单不存在!");
|
||||
|
||||
// 老对象保存为JSONString
|
||||
String oldJsonStr = JSON.toJSONString(billHg);
|
||||
|
||||
billHg.setFhwarehouse(warehouse);
|
||||
billHg.setFhwarehousename(warehouseName);
|
||||
|
||||
jcBillService.updateFcWarehouse(oldJsonStr, billHg);
|
||||
|
||||
billHg.setAmount(billHg.getSubtotal() + billHg.getFreight());
|
||||
|
||||
return billHg;
|
||||
} catch(Throwable e){
|
||||
LOG.error(e.getMessage(), e);
|
||||
e.printStackTrace();
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO 修改运营备注
|
||||
* @param billId
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "updateRemark1", method = RequestMethod.POST)
|
||||
public JcBillHg updateRemark1(
|
||||
@RequestParam(required = true) String billHgId,
|
||||
@RequestParam(required = true) String remark
|
||||
)
|
||||
throws Throwable {
|
||||
try {
|
||||
JcBillHg billHg = jcBillService.queryJcBillHg(billHgId);
|
||||
|
||||
if(billHg == null) throw new BusinessException("回购订单不存在!");
|
||||
|
||||
// 老对象保存为JSONString
|
||||
String oldJsonStr = JSON.toJSONString(billHg);
|
||||
|
||||
billHg.setRemark1(remark);
|
||||
|
||||
jcBillService.updateFcWarehouse(oldJsonStr, billHg);
|
||||
|
||||
billHg.setAmount(billHg.getSubtotal() + billHg.getFreight());
|
||||
|
||||
return billHg;
|
||||
} catch(Throwable e){
|
||||
LOG.error(e.getMessage(), e);
|
||||
e.printStackTrace();
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO 修改收货地址
|
||||
* @param billId
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "updatePac", method = RequestMethod.POST)
|
||||
public JcBillHg updatePac(
|
||||
@RequestParam(required = true) String billHgId,
|
||||
@RequestParam(required = true) String provincename,
|
||||
@RequestParam(required = true) String cityname,
|
||||
@RequestParam(required = true) String areaname,
|
||||
@RequestParam(required = true) String address,
|
||||
@RequestParam(required = true) String consignee,
|
||||
@RequestParam(required = true) String consigneephone
|
||||
)
|
||||
throws Throwable {
|
||||
try {
|
||||
JcBillHg billHg = jcBillService.queryJcBillHg(billHgId);
|
||||
|
||||
if(billHg == null) throw new BusinessException("回购订单不存在!");
|
||||
|
||||
// 老对象保存为JSONString
|
||||
String oldJsonStr = JSON.toJSONString(billHg);
|
||||
|
||||
billHg.setProvincename(provincename);
|
||||
billHg.setCityname(cityname);
|
||||
billHg.setAreaname(areaname);
|
||||
billHg.setAddress(address);
|
||||
billHg.setConsignee(consignee);
|
||||
billHg.setConsigneephone(consigneephone);
|
||||
|
||||
jcBillService.updatePac(oldJsonStr, billHg);
|
||||
|
||||
billHg.setAmount(billHg.getSubtotal() + billHg.getFreight());
|
||||
|
||||
return billHg;
|
||||
} catch(Throwable e){
|
||||
LOG.error(e.getMessage(), e);
|
||||
e.printStackTrace();
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// TODO 创建通知函文章
|
||||
@RequestMapping(value="createTzh", method = RequestMethod.POST)
|
||||
public JSONObject createTzh(
|
||||
@RequestParam(required = true) String inItems,
|
||||
@RequestParam(required = false) String bzj
|
||||
) throws Exception {
|
||||
try {
|
||||
|
||||
if(StringUtils.isBlank(inItems)) throw new BusinessException("未勾选!");
|
||||
|
||||
List<JcBillInItem> items = JSON.parseArray(inItems, JcBillInItem.class);
|
||||
|
||||
List<JcBillSourceItem> billItems = jcBillService.queryJcBillSourceItemByBillId(items.get(0).getBillid());
|
||||
if(billItems == null) throw new BusinessException("稽查明细不存在!");
|
||||
|
||||
if(StringUtils.isBlank(bzj)) bzj = "2、在接到本通知函后一周内,缴纳1万元市场管理保证金,汇入我司对公账户。";
|
||||
|
||||
|
||||
return creatTzhObj(items, billItems.get(0), bzj);
|
||||
} catch (Exception e) {
|
||||
LOG.error(e.getMessage(), e);
|
||||
e.printStackTrace();
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成通知函个节点
|
||||
* @param item
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
private JSONObject creatTzhObj(List<JcBillInItem> items, JcBillSourceItem billItem, String bzj) throws Exception{
|
||||
try {
|
||||
JcBillInItem inItem = items.get(0);
|
||||
|
||||
JSONObject obj = new JSONObject();
|
||||
|
||||
// 客户
|
||||
obj.put("account", inItem.getAccount() + inItem.getAccountname());
|
||||
|
||||
// 回购单价
|
||||
obj.put("hgprice", String.valueOf(inItem.getHgprice()).replace("\\.0*$", ""));
|
||||
|
||||
// 年月日
|
||||
obj.put("dataz", DateToUpperChinese.getUpperDate(new Date()));
|
||||
|
||||
// 收货门店
|
||||
Map<String, String> mapChannel = items.stream()
|
||||
.collect(Collectors.groupingBy(e -> {
|
||||
return e.getChannel();
|
||||
},
|
||||
Collectors.collectingAndThen(Collectors.toList(), value -> value.get(0).getChannel())
|
||||
));
|
||||
String channelStr = "";
|
||||
for(String key : mapChannel.keySet()) {
|
||||
if("线上".equals(billItem.getRecsource())) {
|
||||
channelStr += billItem.getRecplatform() + key + "、";
|
||||
} else {
|
||||
channelStr += key + "、";
|
||||
}
|
||||
}
|
||||
obj.put("channel", channelStr.toString().substring(0, channelStr.length() - 1));
|
||||
|
||||
// 商品
|
||||
Map<String, JcBillInItem> mapPorduct = items.stream()
|
||||
.collect(Collectors.groupingBy(e -> {
|
||||
return e.getProduct() + String.valueOf(e.getPrice());
|
||||
},
|
||||
Collectors.collectingAndThen(Collectors.toList(), value -> value.get(0))
|
||||
));
|
||||
|
||||
double numbers = 0;
|
||||
StringBuffer productStr = new StringBuffer();
|
||||
for(String key : mapPorduct.keySet()) {
|
||||
JcBillInItem productItem = mapPorduct.get(key);
|
||||
BigDecimal price = new BigDecimal(String.valueOf(productItem.getPrice()));
|
||||
// BigDecimal amount = price.multiply(new BigDecimal(String.valueOf(productItem.getQuantity()))).setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
//
|
||||
// BigDecimal numPrice = amount.divide(new BigDecimal(String.valueOf(productItem.getNumbers())), 4, BigDecimal.ROUND_HALF_UP).setScale(4, BigDecimal.ROUND_HALF_UP);
|
||||
//
|
||||
// LOG.info(removeZeros(String.valueOf(numPrice.doubleValue())));
|
||||
|
||||
// productStr.append("收货价格" + removeZeros(String.valueOf(price.doubleValue())) + "元/瓶、");
|
||||
|
||||
// numbers += productItem.getNumbers();
|
||||
|
||||
numbers += productItem.getQuantity();
|
||||
}
|
||||
obj.put("product", inItem.getProductname());
|
||||
// obj.put("product", inItem.getProductname() + "," + productStr.toString().substring(0, productStr.length() - 1));
|
||||
|
||||
// 件数
|
||||
obj.put("numbers", numbers);
|
||||
|
||||
// 支付方式-打款信息
|
||||
Map<String, String> offlineMaps = getConfigSet(JcConfigKey.KEY_GROUP, JcConfigKey.KEY_JC_PAYMENT_OFFLINE);
|
||||
|
||||
obj.put("dkxx", offlineMaps.get("zhmc") + "、" + offlineMaps.get("khyh") + "、" + offlineMaps.get("yhzh"));
|
||||
|
||||
// 保证金
|
||||
obj.put("bzj", bzj);
|
||||
|
||||
return obj;
|
||||
} catch(Throwable e){
|
||||
LOG.error(e.getMessage(), e);
|
||||
e.printStackTrace();
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 去掉小数位0的数字
|
||||
* @param str
|
||||
* @return
|
||||
*/
|
||||
private String removeZeros(String str) {
|
||||
if(str.indexOf(".") > 0) {
|
||||
str = str.replace("0+?$", "");// 删除掉尾数为0的字符
|
||||
str = str.replace("[.]$", "");// 结尾如果是小数点,则去掉
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+595
@@ -0,0 +1,595 @@
|
||||
package abacus.springboot.example.controller;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.abacus.pms.wsi.AccountServiceIF;
|
||||
import com.abacus.pms.wsi.ProductServiceIF;
|
||||
import com.abacus.xpos.foundation.wsi.EmployeeServiceIF;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
import abacus.commons.exception.BusinessException;
|
||||
import abacus.springboot.example.dao.JcBill;
|
||||
import abacus.springboot.example.dao.JcBillInItem;
|
||||
import abacus.springboot.example.dao.JcBillPhoto;
|
||||
import abacus.springboot.example.dao.JcBillSourceItem;
|
||||
import abacus.springboot.example.dao.JcSourceItem;
|
||||
import abacus.springboot.example.util.DateUtil;
|
||||
import abacus.springboot.example.vo.SiDepositlocation;
|
||||
import abacus.springboot.example.wsi.JcBillServiceIF;
|
||||
|
||||
/**
|
||||
* <p>Title:JcBillInController</p>
|
||||
<p>Description: 前端相关-api</p>
|
||||
@author chuanZeng
|
||||
@date 2026年8月18日
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping(value = "/jc")
|
||||
public class JcBillInController extends BaseServlet{
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(JcBillInController.class);
|
||||
|
||||
@Autowired
|
||||
private JcBillServiceIF jcBillService;
|
||||
|
||||
@Autowired
|
||||
private EmployeeServiceIF employeeService;
|
||||
|
||||
@Autowired
|
||||
private ProductServiceIF productService;
|
||||
|
||||
@Autowired
|
||||
private AccountServiceIF accountService;
|
||||
|
||||
/**
|
||||
* TODO (溯源入库-回购通知)--页面查询
|
||||
* @param typ 1-溯源入库 2-回购通知
|
||||
* @return
|
||||
* @throws Throwable
|
||||
*/
|
||||
@RequestMapping(value = "queryJcBillPage", method = RequestMethod.POST)
|
||||
public JSONObject queryJcBillPage(
|
||||
@RequestParam(required = false) String from,
|
||||
@RequestParam(required = false) String thru,
|
||||
|
||||
@RequestParam(required = false) String applicant,
|
||||
@RequestParam(required = false) String goods,
|
||||
@RequestParam(required = false) String id,
|
||||
@RequestParam(required = false) String billin,
|
||||
@RequestParam(required = false) String goodsid,
|
||||
@RequestParam(required = false) String product,
|
||||
@RequestParam(required = false) String status,
|
||||
@RequestParam(required = true) int typ,
|
||||
|
||||
@RequestParam(required = true) int page,
|
||||
@RequestParam(required = true) int size
|
||||
)
|
||||
throws Throwable {
|
||||
try {
|
||||
|
||||
// 申请起始时间
|
||||
String fromDate = null;
|
||||
if (StringUtils.isNotBlank(from)) {
|
||||
fromDate = DateUtil.formatDateTime(DateUtil.getFromDate(DateUtil.toDate(from)));
|
||||
}
|
||||
// 申请截止时间
|
||||
String thruDate = null;
|
||||
if (StringUtils.isNotBlank(thru)) {
|
||||
thruDate = DateUtil.formatDateTime(DateUtil.getThruDate(DateUtil.toDate(thru)));
|
||||
}
|
||||
|
||||
// 当前页
|
||||
// int pageNumber = page/size + 1;
|
||||
Pageable pageable = PageRequest.of(page - 1, size);
|
||||
|
||||
Page<JcBill> pages = jcBillService.queryJcBill(fromDate, thruDate, id, applicant,
|
||||
goods, billin, goodsid, product, status, typ, pageable);
|
||||
|
||||
// 获取稽查单号集合
|
||||
List<String> billIds = pages.getContent().stream()
|
||||
.map(JcBill::getId)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
List<JcBillSourceItem> items = jcBillService.queryJcBillSourceItemInBillId(billIds);
|
||||
|
||||
Map<String, JcBillSourceItem> mapItem = items.stream()
|
||||
.collect(Collectors.groupingBy(e -> {
|
||||
return e.getBillid();
|
||||
},
|
||||
Collectors.collectingAndThen(Collectors.toList(), value -> value.get(0))
|
||||
));
|
||||
|
||||
for(JcBill jcBill : pages.getContent()) {
|
||||
JcBillSourceItem item = mapItem.get(jcBill.getId());
|
||||
if(item != null) {
|
||||
jcBill.setRecsource(item.getRecsource());
|
||||
jcBill.setRecplatform(item.getRecplatform());
|
||||
jcBill.setChannel(item.getChannel());
|
||||
}
|
||||
}
|
||||
|
||||
JSONObject obj = new JSONObject();
|
||||
|
||||
obj.put("list", pages.getContent());
|
||||
obj.put("total", pages.getTotalElements());
|
||||
|
||||
return obj;
|
||||
}catch(Throwable e){
|
||||
LOG.error(e.getMessage(), e);
|
||||
e.printStackTrace();
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO 查询溯源详情
|
||||
* @param billId
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "queryJcBillSourceItems", method = RequestMethod.POST)
|
||||
public List<JcBillSourceItem> queryJcBillSourceItems(
|
||||
@RequestParam(required = false) String billId
|
||||
)
|
||||
throws Throwable {
|
||||
try {
|
||||
|
||||
List<JcBillSourceItem> items = jcBillService.queryJcBillSourceItemByBillId(billId);
|
||||
|
||||
if(items == null) throw new BusinessException("溯源信息不存在!");
|
||||
|
||||
Map<String, List<JcBillPhoto>> mapPhoto = jcBillService.queryJcBillPhoto(billId);
|
||||
|
||||
for(JcBillSourceItem item : items) {
|
||||
|
||||
// 稽查付款截图
|
||||
List<JcBillPhoto> fkts = mapPhoto.get(JcBillPhoto.JC_FK + "#" + String.valueOf(item.getIndexno()));
|
||||
if(fkts != null && fkts.size() >= 1) {
|
||||
List<String> fkList = new ArrayList<String>();
|
||||
|
||||
for(JcBillPhoto fkt : fkts) {
|
||||
fkList.add(fkt.getUrlphoto());
|
||||
}
|
||||
|
||||
item.setPaymentPhoto(fkList);
|
||||
}
|
||||
|
||||
// 货品图
|
||||
List<JcBillPhoto> hpts = mapPhoto.get(JcBillPhoto.JC_HP + "#" + String.valueOf(item.getIndexno()) + "#" + item.getGoodsid());
|
||||
if(hpts != null && hpts.size() >= 1) {
|
||||
List<String> hpList = new ArrayList<String>();
|
||||
|
||||
for(JcBillPhoto hpt : hpts) {
|
||||
hpList.add(hpt.getUrlphoto());
|
||||
}
|
||||
|
||||
item.setGoodsPhotos(hpList);
|
||||
item.setHpts(hpts);
|
||||
}
|
||||
}
|
||||
|
||||
return items;
|
||||
} catch(Throwable e){
|
||||
LOG.error(e.getMessage(), e);
|
||||
e.printStackTrace();
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO 查询溯源明细
|
||||
* @param billId
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "queryJcSourceItems", method = RequestMethod.POST)
|
||||
public List<JcSourceItem> queryJcSourceItems(
|
||||
@RequestParam(required = true) String billId,
|
||||
@RequestParam(required = true) String srcItemId
|
||||
)
|
||||
throws Throwable {
|
||||
try {
|
||||
List<JcSourceItem> items = jcBillService.queryJcSourceItemByBillId(billId, srcItemId);
|
||||
|
||||
return items;
|
||||
} catch(Throwable e){
|
||||
LOG.error(e.getMessage(), e);
|
||||
e.printStackTrace();
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* TODO 确认溯源
|
||||
* @param billId
|
||||
* @param srcItemId
|
||||
* @return
|
||||
* @throws Throwable
|
||||
*/
|
||||
@RequestMapping(value = "querenSourceItems", method = RequestMethod.POST)
|
||||
public void querenSourceItems(
|
||||
@RequestParam(required = true) String billId,
|
||||
@RequestParam(required = true) String srcItemId,
|
||||
@RequestParam(required = true) String sourceItemId
|
||||
)
|
||||
throws Throwable {
|
||||
try {
|
||||
// JcBill jcBill = jcBillService.queryJcBillById(billId);
|
||||
|
||||
// if(jcBill == null) throw new BusinessException("收货记录不存在!");
|
||||
|
||||
JcBillSourceItem billItem = jcBillService.queryJcBillSourceItemById(Long.parseLong(srcItemId));
|
||||
|
||||
if(billItem == null) throw new BusinessException("溯源信息不存在!");
|
||||
|
||||
JcSourceItem sourceItem = jcBillService.queryJcSourceItemById(Long.parseLong(sourceItemId));
|
||||
|
||||
if(sourceItem == null) throw new BusinessException("溯源明细不存在!");
|
||||
|
||||
// 稽查收入记录
|
||||
|
||||
// 溯源信息更新
|
||||
billItem.setStatus(JcBillSourceItem.STATUS_THREE);
|
||||
billItem.setLogisticsid(sourceItem.getLogisticsid());
|
||||
billItem.setBillout(sourceItem.getBillout());
|
||||
billItem.setBilloutdt(sourceItem.getBilloutdt());
|
||||
billItem.setBilloutwh(sourceItem.getBilloutwh());
|
||||
billItem.setBilloutwhname(sourceItem.getBilloutwhname());
|
||||
billItem.setProduct(sourceItem.getProduct());
|
||||
billItem.setProductname(sourceItem.getProductname());
|
||||
billItem.setAccount(sourceItem.getAccount());
|
||||
billItem.setAccountname(sourceItem.getAccountname());
|
||||
billItem.setOperator(sourceItem.getOperator());
|
||||
billItem.setOperatorname(sourceItem.getOperatorname());
|
||||
billItem.setGroupid(sourceItem.getGroupid());
|
||||
billItem.setGroupname(sourceItem.getGroupname());
|
||||
billItem.setSalearea(sourceItem.getSalearea());
|
||||
billItem.setSaleareaname(sourceItem.getSaleareaname());
|
||||
billItem.setSource(sourceItem.getSource());
|
||||
|
||||
|
||||
// 确认溯源明细
|
||||
sourceItem.setStatus(JcSourceItem.STATUS_ONE);
|
||||
|
||||
jcBillService.saveQuerenBillSourceItem(billItem, sourceItem);
|
||||
|
||||
} catch(Throwable e){
|
||||
LOG.error(e.getMessage(), e);
|
||||
e.printStackTrace();
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* TODO 新增溯源明细信息
|
||||
* @param billId
|
||||
* @param srcItemId
|
||||
* @return
|
||||
* @throws Throwable
|
||||
*/
|
||||
@RequestMapping(value = "saveSourceItems", method = RequestMethod.POST)
|
||||
public JcSourceItem saveSourceItems(
|
||||
@RequestParam(required = true) String billid,
|
||||
@RequestParam(required = true) String srcitemid,
|
||||
@RequestParam(required = true) String goodsid,
|
||||
@RequestParam(required = true) String logisticsid,
|
||||
@RequestParam(required = true) String billout,
|
||||
@RequestParam(required = true) String billoutdt,
|
||||
@RequestParam(required = true) String billoutwh,
|
||||
@RequestParam(required = true) String billoutwhname,
|
||||
@RequestParam(required = true) String product,
|
||||
@RequestParam(required = true) String productname,
|
||||
@RequestParam(required = true) String account,
|
||||
@RequestParam(required = true) String accountname,
|
||||
@RequestParam(required = true) String operator,
|
||||
@RequestParam(required = true) String operatorname,
|
||||
@RequestParam(required = true) String groupid,
|
||||
@RequestParam(required = true) String groupname,
|
||||
@RequestParam(required = true) String salearea,
|
||||
@RequestParam(required = true) String saleareaname,
|
||||
@RequestParam(required = true) String source
|
||||
)
|
||||
throws Throwable {
|
||||
try {
|
||||
JcSourceItem sourceItem = new JcSourceItem();
|
||||
sourceItem.setStatus(JcSourceItem.STATUS_ZERO);
|
||||
sourceItem.setBillid(billid);
|
||||
sourceItem.setSrcitemid(srcitemid);
|
||||
sourceItem.setGoodsid(goodsid);
|
||||
sourceItem.setLogisticsid(logisticsid);
|
||||
sourceItem.setBillout(billout);
|
||||
sourceItem.setBilloutdt(DateUtil.toDate(billoutdt));
|
||||
sourceItem.setBilloutwh(billoutwh);
|
||||
sourceItem.setBilloutwhname(billoutwhname);
|
||||
sourceItem.setProduct(product);
|
||||
sourceItem.setProductname(productname);
|
||||
sourceItem.setAccount(account);
|
||||
sourceItem.setAccountname(accountname);
|
||||
sourceItem.setOperator(operator);
|
||||
sourceItem.setOperatorname(operatorname);
|
||||
sourceItem.setGroupid(groupid);
|
||||
sourceItem.setGroupname(groupname);
|
||||
sourceItem.setSalearea(salearea);
|
||||
sourceItem.setSaleareaname(saleareaname);
|
||||
sourceItem.setSource(source);
|
||||
|
||||
JcSourceItem tempItem = jcBillService.saveJcSourceItem(sourceItem);
|
||||
|
||||
return tempItem;
|
||||
} catch(Throwable e){
|
||||
LOG.error(e.getMessage(), e);
|
||||
e.printStackTrace();
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* TODO 删除溯源明细信息
|
||||
* @param billId
|
||||
* @param srcItemId
|
||||
* @return
|
||||
* @throws Throwable
|
||||
*/
|
||||
@RequestMapping(value = "deleteSourceItem", method = RequestMethod.POST)
|
||||
public void deleteSourceItem(
|
||||
@RequestParam(required = true) String codes
|
||||
)
|
||||
throws Throwable {
|
||||
try {
|
||||
|
||||
if (StringUtils.isEmpty(codes)) {
|
||||
throw new BusinessException("溯源明细信息编码不能为空");
|
||||
}
|
||||
|
||||
List<Long> ids = JSON.parseArray(codes, Long.class);
|
||||
|
||||
jcBillService.deleteJcSourceItem(ids);
|
||||
|
||||
} catch(Throwable e){
|
||||
LOG.error(e.getMessage(), e);
|
||||
e.printStackTrace();
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO 溯源信息驳回
|
||||
* @param billId
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "rejectJcSourceItems", method = RequestMethod.POST)
|
||||
public void rejectJcSourceItems(
|
||||
@RequestParam(required = true) String billId,
|
||||
@RequestParam(required = true) String srcItemId,
|
||||
@RequestParam(required = true) String reason
|
||||
)
|
||||
throws Throwable {
|
||||
try {
|
||||
JcBill jcBill = jcBillService.queryJcBillById(billId);
|
||||
|
||||
if(jcBill == null) throw new BusinessException("收货记录不存在!");
|
||||
|
||||
JcBillSourceItem billItem = jcBillService.queryJcBillSourceItemById(Long.parseLong(srcItemId));
|
||||
|
||||
if(billItem == null) throw new BusinessException("溯源信息不存在!");
|
||||
|
||||
jcBill.setStatus(JcBill.STATUS_MINUS_TWO);
|
||||
|
||||
billItem.setStatus(JcBillSourceItem.STATUS_MINUS_TWO);
|
||||
billItem.setReason(reason);
|
||||
|
||||
jcBillService.saveRejectJcSourceItems(billItem, jcBill);
|
||||
|
||||
} catch(Throwable e){
|
||||
LOG.error(e.getMessage(), e);
|
||||
e.printStackTrace();
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* TODO 修改收货仓库
|
||||
* @param billId
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "updateWarehouse", method = RequestMethod.POST)
|
||||
public JcBill updateWarehouse(
|
||||
@RequestParam(required = true) String billId,
|
||||
@RequestParam(required = true) String warehouse,
|
||||
@RequestParam(required = true) String warehouseName
|
||||
)
|
||||
throws Throwable {
|
||||
try {
|
||||
JcBill jcBill = jcBillService.queryJcBillById(billId);
|
||||
|
||||
if(jcBill == null) throw new BusinessException("收货记录不存在!");
|
||||
|
||||
// 老对象保存为JSONString
|
||||
jcBill.setOldJson(JSON.toJSONString(jcBill));
|
||||
|
||||
jcBill.setWarehouse(warehouse);
|
||||
jcBill.setWarehousename(warehouseName);
|
||||
|
||||
jcBillService.updateWarehouse(jcBill);
|
||||
|
||||
return jcBill;
|
||||
} catch(Throwable e){
|
||||
LOG.error(e.getMessage(), e);
|
||||
e.printStackTrace();
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* TODO 生成入库单
|
||||
* @param billId
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "createStockIn", method = RequestMethod.POST)
|
||||
public JcBill createStockIn(
|
||||
@RequestParam(required = true) String billId
|
||||
)
|
||||
throws Throwable {
|
||||
try {
|
||||
JcBill jcBill = jcBillService.queryJcBillById(billId);
|
||||
|
||||
if(jcBill == null) throw new BusinessException("收货记录不存在!");
|
||||
|
||||
jcBill.setStatus(JcBill.STATUS_FOUR);
|
||||
|
||||
jcBillService.createStockIn(jcBill);
|
||||
|
||||
return jcBill;
|
||||
} catch(Throwable e){
|
||||
LOG.error(e.getMessage(), e);
|
||||
e.printStackTrace();
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO 撤回
|
||||
* @param billId
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "rejectBill", method = RequestMethod.POST)
|
||||
public JcBill rejectBill(
|
||||
@RequestParam(required = false) String billId,
|
||||
@RequestParam(required = false) int status
|
||||
)
|
||||
throws Throwable {
|
||||
try {
|
||||
JcBill jcBill = jcBillService.queryJcBillById(billId);
|
||||
|
||||
if(jcBill == null) throw new BusinessException("收货记录不存在!");
|
||||
|
||||
List<JcBillInItem> inItems = jcBillService.queryJcBillInItemByBillId(billId);
|
||||
|
||||
List<JcBillSourceItem> sourceItems = jcBillService.queryJcBillSourceItemByBillId(billId);
|
||||
if(sourceItems == null) throw new BusinessException("收货明细不存在!");
|
||||
|
||||
if(JcBill.STATUS_FOUR == status) {// 入库待审核 进行撤回(事件生成—进行事件删除)
|
||||
|
||||
SiDepositlocation sd = jcBillService.querySiDepositlocation(jcBill.getId());
|
||||
|
||||
if(sd == null) {// WDT
|
||||
throw new BusinessException("该单据需要通知仓库在旺店通删除入库单,并联系信息部撤回。");
|
||||
} else {
|
||||
if(sd.getPush() == 1) {// WMS
|
||||
|
||||
JSONObject obj = jcBillService.gwisSubCancelOrder(jcBill.getId(), "QTRK");
|
||||
|
||||
if(obj.getBooleanValue("success")) {
|
||||
|
||||
jcBill.setStatus(JcBill.STATUS_THREE);
|
||||
} else {
|
||||
throw new BusinessException(obj.getString("body"));
|
||||
}
|
||||
} else {
|
||||
throw new BusinessException("该单据需要通知仓库在旺店通删除入库单,并联系信息部撤回。");
|
||||
}
|
||||
}
|
||||
} else {// 待入库撤回
|
||||
jcBill.setStatus(JcBill.STATUS_TWO);
|
||||
|
||||
for(JcBillSourceItem item : sourceItems) {
|
||||
item.setStatus(JcBillSourceItem.STATUS_TWO);
|
||||
}
|
||||
}
|
||||
|
||||
jcBillService.saveRejectBill(status, jcBill, inItems, sourceItems);
|
||||
return jcBill;
|
||||
} catch(Throwable e){
|
||||
LOG.error(e.getMessage(), e);
|
||||
e.printStackTrace();
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* TODO 查询溯源明细-已确认
|
||||
* @param billId
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "queryJcSourceItemsQue", method = RequestMethod.POST)
|
||||
public List<JcSourceItem> queryJcSourceItemsQue(
|
||||
@RequestParam(required = true) String billId,
|
||||
@RequestParam(required = true) String srcItemId
|
||||
)
|
||||
throws Throwable {
|
||||
try {
|
||||
List<JcSourceItem> items = jcBillService.queryJcSourceItemByBillId(billId, srcItemId, 1);
|
||||
|
||||
return items;
|
||||
} catch(Throwable e){
|
||||
LOG.error(e.getMessage(), e);
|
||||
e.printStackTrace();
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,316 @@
|
||||
package abacus.springboot.example.dao;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Temporal;
|
||||
import javax.persistence.TemporalType;
|
||||
import javax.persistence.Transient;
|
||||
import javax.persistence.Version;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonBackReference;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
@Entity
|
||||
@Table(name = "jc_bill")
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
@Schema(description = "稽查主单")
|
||||
public class JcBill implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 7089440541784316919L;
|
||||
|
||||
/**唯一标识:订单号*/
|
||||
@Id
|
||||
@Schema(description="稽查单号", required=true, example="JC202411180001")
|
||||
private String id;
|
||||
|
||||
@Version
|
||||
@Schema(description = "版本号", required = true, example = "1")
|
||||
private Integer version = 1;
|
||||
|
||||
@Schema(description="状态", required=true, pattern="-3:取消,-2:溯源驳回,0:待提交,1:系统溯源验证通过,2:待溯源,3:待入库,4:入库待审核,5:已入库,6:部分回购,7:回购完成", example = "1")
|
||||
private int status = 1;
|
||||
/** 取消*/
|
||||
public final static int STATUS_MINUS_THREE = -3;
|
||||
/** 溯源驳回*/
|
||||
public final static int STATUS_MINUS_TWO = -2;
|
||||
/** 待提交*/
|
||||
public final static int STATUS_ZERO = 0;
|
||||
/** 系统溯源验证通过*/
|
||||
public final static int STATUS_ONE = 1;
|
||||
/** 待溯源*/
|
||||
public final static int STATUS_TWO = 2;
|
||||
/** 待入库*/
|
||||
public final static int STATUS_THREE = 3;
|
||||
/** 入库待审核 */
|
||||
public final static int STATUS_FOUR = 4;
|
||||
/** 已入库 */
|
||||
public final static int STATUS_FIVE = 5;
|
||||
/** 部分回购 */
|
||||
public final static int STATUS_SIX = 6;
|
||||
/** 回购完成*/
|
||||
public final static int STATUS_SEVEN = 7;
|
||||
|
||||
/** 部分出库-不保存到系统,前端使用*/
|
||||
public final static int STATUS_EIGHT = 8;
|
||||
/** 已出库-不保存到系统,前端使用*/
|
||||
public final static int STATUS_NINE = 9;
|
||||
|
||||
@Schema(description="状态", required=true, pattern="0:待回购,1:部分回购,2:回购完成", example = "0")
|
||||
private int hgstatus = 0;
|
||||
/** 待回购*/
|
||||
public final static int HGSTATUS_ZERO = 0;
|
||||
/** 部分回购*/
|
||||
public final static int HGSTATUS_ONE = 1;
|
||||
/** 回购完成*/
|
||||
public final static int HGSTATUS_TWO = 2;
|
||||
|
||||
@Schema(description = "收货产品", required = true, example = "")
|
||||
private String goods;
|
||||
|
||||
@Schema(description = "收货仓库编码", required = true, example = "")
|
||||
private String warehouse;
|
||||
|
||||
@Schema(description = "收货仓库名称", required = true, example = "")
|
||||
private String warehousename;
|
||||
|
||||
@Schema(description = "收货日期", required = true, example = "2024-11-11")
|
||||
private String receivedt;
|
||||
|
||||
@Schema(description = "收货数量", required = true, example = "")
|
||||
private double quantity;
|
||||
|
||||
@Schema(description = "收货总金额", required = true, example = "")
|
||||
private double subtotal;
|
||||
|
||||
@Schema(description = "入库单号", required = true, example = "")
|
||||
private String billin;
|
||||
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
@Schema(description = "入库单时间", required = true, example = "")
|
||||
private Date billindt;
|
||||
|
||||
@Schema(description = "申请人编码", required = true, example = "")
|
||||
private String applicant;
|
||||
|
||||
@Schema(description = "申请人名称", required = true, example = "")
|
||||
private String applicantname;
|
||||
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
@Schema(description = "申请人时间", required = true, example = "")
|
||||
private Date applicantdt;
|
||||
|
||||
@Schema(description = "部门编码", required = true, example = "")
|
||||
private String dept;
|
||||
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
@Schema(description = "时间戳", required = true, example = "")
|
||||
private Date dt = new Date();
|
||||
|
||||
@Transient
|
||||
@Schema(description = "收货来源", hidden = true,required = true, example = "")
|
||||
private String recsource;
|
||||
|
||||
@Transient
|
||||
@Schema(description = "收货平台", hidden = true,required = true, example = "")
|
||||
private String recplatform;
|
||||
|
||||
@Transient
|
||||
@Schema(description = "收货渠道", hidden = true,required = true, example = "")
|
||||
private String channel;
|
||||
|
||||
@Transient
|
||||
@JsonBackReference
|
||||
@Schema(description = "历史对象JSONString", required = false, hidden = true, pattern = "", example = "")
|
||||
private String oldJson;
|
||||
|
||||
public String getRecsource() {
|
||||
return recsource;
|
||||
}
|
||||
|
||||
public void setRecsource(String recsource) {
|
||||
this.recsource = recsource;
|
||||
}
|
||||
|
||||
public String getRecplatform() {
|
||||
return recplatform;
|
||||
}
|
||||
|
||||
public void setRecplatform(String recplatform) {
|
||||
this.recplatform = recplatform;
|
||||
}
|
||||
|
||||
public String getChannel() {
|
||||
return channel;
|
||||
}
|
||||
|
||||
public void setChannel(String channel) {
|
||||
this.channel = channel;
|
||||
}
|
||||
|
||||
public int getHgstatus() {
|
||||
return hgstatus;
|
||||
}
|
||||
|
||||
public void setHgstatus(int hgstatus) {
|
||||
this.hgstatus = hgstatus;
|
||||
}
|
||||
|
||||
public String getDept() {
|
||||
return dept;
|
||||
}
|
||||
|
||||
public void setDept(String dept) {
|
||||
this.dept = dept;
|
||||
}
|
||||
|
||||
public String getOldJson() {
|
||||
return oldJson;
|
||||
}
|
||||
|
||||
public void setOldJson(String oldJson) {
|
||||
this.oldJson = oldJson;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Integer getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public void setVersion(Integer version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(int status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getGoods() {
|
||||
return goods;
|
||||
}
|
||||
|
||||
public void setGoods(String goods) {
|
||||
this.goods = goods;
|
||||
}
|
||||
|
||||
public String getWarehouse() {
|
||||
return warehouse;
|
||||
}
|
||||
|
||||
public void setWarehouse(String warehouse) {
|
||||
this.warehouse = warehouse;
|
||||
}
|
||||
|
||||
public String getWarehousename() {
|
||||
return warehousename;
|
||||
}
|
||||
|
||||
public void setWarehousename(String warehousename) {
|
||||
this.warehousename = warehousename;
|
||||
}
|
||||
|
||||
public String getReceivedt() {
|
||||
return receivedt;
|
||||
}
|
||||
|
||||
public void setReceivedt(String receivedt) {
|
||||
this.receivedt = receivedt;
|
||||
}
|
||||
|
||||
public double getQuantity() {
|
||||
return quantity;
|
||||
}
|
||||
|
||||
public void setQuantity(double quantity) {
|
||||
this.quantity = quantity;
|
||||
}
|
||||
|
||||
public double getSubtotal() {
|
||||
return subtotal;
|
||||
}
|
||||
|
||||
public void setSubtotal(double subtotal) {
|
||||
this.subtotal = subtotal;
|
||||
}
|
||||
|
||||
public String getBillin() {
|
||||
return billin;
|
||||
}
|
||||
|
||||
public void setBillin(String billin) {
|
||||
this.billin = billin;
|
||||
}
|
||||
|
||||
public Date getBillindt() {
|
||||
return billindt;
|
||||
}
|
||||
|
||||
public void setBillindt(Date billindt) {
|
||||
this.billindt = billindt;
|
||||
}
|
||||
|
||||
public String getApplicant() {
|
||||
return applicant;
|
||||
}
|
||||
|
||||
public void setApplicant(String applicant) {
|
||||
this.applicant = applicant;
|
||||
}
|
||||
|
||||
public String getApplicantname() {
|
||||
return applicantname;
|
||||
}
|
||||
|
||||
public void setApplicantname(String applicantname) {
|
||||
this.applicantname = applicantname;
|
||||
}
|
||||
|
||||
public Date getApplicantdt() {
|
||||
return applicantdt;
|
||||
}
|
||||
|
||||
public void setApplicantdt(Date applicantdt) {
|
||||
this.applicantdt = applicantdt;
|
||||
}
|
||||
|
||||
public Date getDt() {
|
||||
return dt;
|
||||
}
|
||||
|
||||
public void setDt(Date dt) {
|
||||
this.dt = dt;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,671 @@
|
||||
package abacus.springboot.example.dao;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Transient;
|
||||
import javax.persistence.Version;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
@Entity
|
||||
@Table(name = "jc_billhg")
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
@Schema(description = "回购单主单")
|
||||
public class JcBillHg implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -4735685141695682399L;
|
||||
|
||||
/**唯一标识:订单号*/
|
||||
@Id
|
||||
@Schema(description="回购单单号", required=true, example="HG202411180001")
|
||||
private String id;
|
||||
|
||||
@Version
|
||||
@Schema(description = "版本号", required = true, example = "1")
|
||||
private Integer version = 1;
|
||||
|
||||
@Schema(description = "稽查单号", required = true, example = "")
|
||||
private String billid;
|
||||
|
||||
@Schema(description = "状态", required = true, pattern="-1:作废,1:待提交,2:待付款,3:已付款,4:(确认收款转待分仓)待分仓,5:已分仓-待出库,6:已出库", example = "")
|
||||
private int status = 1;
|
||||
/** 作废*/
|
||||
public final static int STATUS_MINUS_ONE = -1;
|
||||
/** 待提交 */
|
||||
public final static int STATUS_ONE = 1;
|
||||
/** 待付款 */
|
||||
public final static int STATUS_TWO = 2;
|
||||
/** 已付款 */
|
||||
public final static int STATUS_THREE = 3;
|
||||
/** (确认收款转待分仓)待分仓 */
|
||||
public final static int STATUS_FOUR = 4;
|
||||
/** 已分仓-待出库 */
|
||||
public final static int STATUS_FIVE = 5;
|
||||
/** 已出库 */
|
||||
public final static int STATUS_SIX = 6;
|
||||
// /** 回购完成*/
|
||||
// public final static int STATUS_SEVEN = 7;
|
||||
|
||||
// @Schema(description = "分仓状态", required = false, example = "")
|
||||
// private int fcstatus = 1;
|
||||
// public final static int FCSTATUS_ONE = 1;// 待分仓
|
||||
// public final static int FCSTATUS_TWO = 2;// 已分仓-待出库
|
||||
// public final static int FCSTATUS_THREE = 3;// 已出库
|
||||
|
||||
@Schema(description = "订单来源:掌上华致", required = true, example = "")
|
||||
private String source;
|
||||
|
||||
@Schema(description = "客户编码", required = true, example = "")
|
||||
private String account;
|
||||
|
||||
@Schema(description = "客户名称", required = true, example = "")
|
||||
private String accountname;
|
||||
|
||||
@Schema(description = "商品总数量", required = true, example = "")
|
||||
private double quantity;
|
||||
|
||||
@Schema(description = "商品总金额", required = true, example = "")
|
||||
private double subtotal;
|
||||
|
||||
@Schema(description = "运费", required = true, example = "")
|
||||
private double freight;
|
||||
|
||||
@Schema(description = "运营经理编码", required = true, example = "")
|
||||
private String manager;
|
||||
|
||||
@Schema(description = "运营经理名称", required = true, example = "")
|
||||
private String managername;
|
||||
|
||||
@Schema(description = "收货人姓名", required = true, example = "")
|
||||
private String consignee;
|
||||
|
||||
@Schema(description = "收货人电话", required = true, example = "")
|
||||
private String consigneephone;
|
||||
|
||||
@Schema(description = "省", required = true, example = "")
|
||||
private String province;
|
||||
|
||||
@Schema(description = "省", required = true, example = "")
|
||||
private String provincename;
|
||||
|
||||
@Schema(description = "市", required = true, example = "")
|
||||
private String city;
|
||||
|
||||
@Schema(description = "市", required = true, example = "")
|
||||
private String cityname;
|
||||
|
||||
@Schema(description = "区", required = true, example = "")
|
||||
private String area;
|
||||
|
||||
@Schema(description = "区", required = true, example = "")
|
||||
private String areaname;
|
||||
|
||||
@Schema(description = "详细地址", required = true, example = "")
|
||||
private String address;
|
||||
|
||||
@Schema(description = "收货方式", pattern = "0:送货上门1:仓库自提2:货站自提3:空运自提", required = true, example = "")
|
||||
private String receiveway;
|
||||
/** 送货上门 */
|
||||
public final static String RECEIVEWAY_ZERO = "0";
|
||||
/** 仓库自提 */
|
||||
public final static String RECEIVEWAY_ONE = "1";
|
||||
/** 货站自提 */
|
||||
public final static String RECEIVEWAY_TWO = "2";
|
||||
/** 空运自提 */
|
||||
public final static String RECEIVEWAY_THREE = "3";
|
||||
|
||||
|
||||
@Schema(description = "订单备注", required = true, example = "")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "运营备注", required = true, example = "")
|
||||
private String remark1;
|
||||
|
||||
@Schema(description = "分销区域编码", required = true, example = "")
|
||||
private String salearea;
|
||||
|
||||
@Schema(description = "分销区域名称", required = true, example = "")
|
||||
private String saleareaname;
|
||||
|
||||
@Schema(description = "业务组编码", required = true, example = "")
|
||||
private String groupid;
|
||||
|
||||
@Schema(description = "业务组名称", required = true, example = "")
|
||||
private String groupname;
|
||||
|
||||
@Schema(description = "创建人", required = true, example = "")
|
||||
private String found;
|
||||
|
||||
@Schema(description = "创建人编码", required = true, example = "")
|
||||
private String foundname;
|
||||
|
||||
@Schema(description = "创建时间", required = true, example = "")
|
||||
private Date founddt;
|
||||
|
||||
@Schema(description = "提交人编码", required = true, example = "")
|
||||
private String submit;
|
||||
|
||||
@Schema(description = "提交人名称", required = true, example = "")
|
||||
private String submitname;
|
||||
|
||||
@Schema(description = "提交人时间", required = true, example = "")
|
||||
private Date submitdt;
|
||||
|
||||
@Schema(description = "审核人编码", required = true, example = "")
|
||||
private String audit;
|
||||
|
||||
@Schema(description = "审核人名称", required = true, example = "")
|
||||
private String auditname;
|
||||
|
||||
@Schema(description = "审核人时间", required = true, example = "")
|
||||
private Date auditdt;
|
||||
|
||||
@Schema(description = "分货仓库编码", required = true, example = "")
|
||||
private String fhwarehouse;
|
||||
|
||||
@Schema(description = "分货仓库名称", required = true, example = "")
|
||||
private String fhwarehousename;
|
||||
|
||||
@Schema(description = "物流公司名称", required = true, example = "")
|
||||
private String logisticsname;
|
||||
|
||||
@Schema(description = "物流公司代码", required = true, example = "")
|
||||
private String logisticscode;
|
||||
|
||||
@Schema(description = "物流方式", required = true, example = "")
|
||||
private String logisticstype;
|
||||
|
||||
@Schema(description = "物流单号", required = true, example = "")
|
||||
private String logisticsno;
|
||||
|
||||
@Schema(description = "旺店通单号", required = true, example = "")
|
||||
private String wdtorder;
|
||||
|
||||
@Schema(description = "旺店通出库单号", required = true, example = "")
|
||||
private String wdtbillout;
|
||||
|
||||
@Schema(description = "旺店通出库状态", required = true, example = "")
|
||||
private String wdtbillouttyp;
|
||||
|
||||
@Schema(description = "旺店通出库时间", required = true, example = "")
|
||||
private Date wdtoutdt;
|
||||
|
||||
@Schema(description = "旺店通入库时间", required = true, example = "")
|
||||
private Date wdtindt;
|
||||
|
||||
@Schema(description = "传输旺店通时间", required = true, example = "")
|
||||
private Date wdtdt;
|
||||
|
||||
@Schema(description = "回款客户名称", required = true, example = "")
|
||||
private String proofaccountname;
|
||||
|
||||
@Schema(description = "凭证上传时间", required = true, example = "")
|
||||
private Date proofdt;
|
||||
|
||||
@Schema(description = "时间戳", required = true, example = "")
|
||||
private Date dt = new Date();
|
||||
|
||||
// 合计金额=商品总金额+运费
|
||||
@Transient
|
||||
private double amount;
|
||||
|
||||
// 稽查单状态
|
||||
@Transient
|
||||
private int jcstatus;
|
||||
|
||||
// public int getFcstatus() {
|
||||
// return fcstatus;
|
||||
// }
|
||||
//
|
||||
// public void setFcstatus(int fcstatus) {
|
||||
// this.fcstatus = fcstatus;
|
||||
// }
|
||||
|
||||
public double getAmount() {
|
||||
return amount;
|
||||
}
|
||||
|
||||
public int getJcstatus() {
|
||||
return jcstatus;
|
||||
}
|
||||
|
||||
public void setJcstatus(int jcstatus) {
|
||||
this.jcstatus = jcstatus;
|
||||
}
|
||||
|
||||
public Date getWdtoutdt() {
|
||||
return wdtoutdt;
|
||||
}
|
||||
|
||||
public void setWdtoutdt(Date wdtoutdt) {
|
||||
this.wdtoutdt = wdtoutdt;
|
||||
}
|
||||
|
||||
public Date getWdtindt() {
|
||||
return wdtindt;
|
||||
}
|
||||
|
||||
public void setWdtindt(Date wdtindt) {
|
||||
this.wdtindt = wdtindt;
|
||||
}
|
||||
|
||||
public String getProofaccountname() {
|
||||
return proofaccountname;
|
||||
}
|
||||
|
||||
public void setProofaccountname(String proofaccountname) {
|
||||
this.proofaccountname = proofaccountname;
|
||||
}
|
||||
|
||||
public Date getProofdt() {
|
||||
return proofdt;
|
||||
}
|
||||
|
||||
public void setProofdt(Date proofdt) {
|
||||
this.proofdt = proofdt;
|
||||
}
|
||||
|
||||
public String getWdtorder() {
|
||||
return wdtorder;
|
||||
}
|
||||
|
||||
public void setWdtorder(String wdtorder) {
|
||||
this.wdtorder = wdtorder;
|
||||
}
|
||||
|
||||
public String getWdtbillout() {
|
||||
return wdtbillout;
|
||||
}
|
||||
|
||||
public void setWdtbillout(String wdtbillout) {
|
||||
this.wdtbillout = wdtbillout;
|
||||
}
|
||||
|
||||
public String getWdtbillouttyp() {
|
||||
return wdtbillouttyp;
|
||||
}
|
||||
|
||||
public void setWdtbillouttyp(String wdtbillouttyp) {
|
||||
this.wdtbillouttyp = wdtbillouttyp;
|
||||
}
|
||||
|
||||
public Date getWdtdt() {
|
||||
return wdtdt;
|
||||
}
|
||||
|
||||
public void setWdtdt(Date wdtdt) {
|
||||
this.wdtdt = wdtdt;
|
||||
}
|
||||
|
||||
public void setAmount(double amount) {
|
||||
this.amount = amount;
|
||||
}
|
||||
|
||||
public String getFhwarehouse() {
|
||||
return fhwarehouse;
|
||||
}
|
||||
|
||||
public void setFhwarehouse(String fhwarehouse) {
|
||||
this.fhwarehouse = fhwarehouse;
|
||||
}
|
||||
|
||||
public String getFhwarehousename() {
|
||||
return fhwarehousename;
|
||||
}
|
||||
|
||||
public void setFhwarehousename(String fhwarehousename) {
|
||||
this.fhwarehousename = fhwarehousename;
|
||||
}
|
||||
|
||||
public String getLogisticsname() {
|
||||
return logisticsname;
|
||||
}
|
||||
|
||||
public void setLogisticsname(String logisticsname) {
|
||||
this.logisticsname = logisticsname;
|
||||
}
|
||||
|
||||
public String getLogisticscode() {
|
||||
return logisticscode;
|
||||
}
|
||||
|
||||
public void setLogisticscode(String logisticscode) {
|
||||
this.logisticscode = logisticscode;
|
||||
}
|
||||
|
||||
public String getLogisticstype() {
|
||||
return logisticstype;
|
||||
}
|
||||
|
||||
public void setLogisticstype(String logisticstype) {
|
||||
this.logisticstype = logisticstype;
|
||||
}
|
||||
|
||||
public String getLogisticsno() {
|
||||
return logisticsno;
|
||||
}
|
||||
|
||||
public void setLogisticsno(String logisticsno) {
|
||||
this.logisticsno = logisticsno;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Integer getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public void setVersion(Integer version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public String getBillid() {
|
||||
return billid;
|
||||
}
|
||||
|
||||
public void setBillid(String billid) {
|
||||
this.billid = billid;
|
||||
}
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(int status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getSource() {
|
||||
return source;
|
||||
}
|
||||
|
||||
public void setSource(String source) {
|
||||
this.source = source;
|
||||
}
|
||||
|
||||
public String getAccount() {
|
||||
return account;
|
||||
}
|
||||
|
||||
public void setAccount(String account) {
|
||||
this.account = account;
|
||||
}
|
||||
|
||||
public String getAccountname() {
|
||||
return accountname;
|
||||
}
|
||||
|
||||
public void setAccountname(String accountname) {
|
||||
this.accountname = accountname;
|
||||
}
|
||||
|
||||
public double getQuantity() {
|
||||
return quantity;
|
||||
}
|
||||
|
||||
public void setQuantity(double quantity) {
|
||||
this.quantity = quantity;
|
||||
}
|
||||
|
||||
public double getSubtotal() {
|
||||
return subtotal;
|
||||
}
|
||||
|
||||
public void setSubtotal(double subtotal) {
|
||||
this.subtotal = subtotal;
|
||||
}
|
||||
|
||||
public double getFreight() {
|
||||
return freight;
|
||||
}
|
||||
|
||||
public void setFreight(double freight) {
|
||||
this.freight = freight;
|
||||
}
|
||||
|
||||
public String getManager() {
|
||||
return manager;
|
||||
}
|
||||
|
||||
public void setManager(String manager) {
|
||||
this.manager = manager;
|
||||
}
|
||||
|
||||
public String getManagername() {
|
||||
return managername;
|
||||
}
|
||||
|
||||
public void setManagername(String managername) {
|
||||
this.managername = managername;
|
||||
}
|
||||
|
||||
public String getConsignee() {
|
||||
return consignee;
|
||||
}
|
||||
|
||||
public void setConsignee(String consignee) {
|
||||
this.consignee = consignee;
|
||||
}
|
||||
|
||||
public String getConsigneephone() {
|
||||
return consigneephone;
|
||||
}
|
||||
|
||||
public void setConsigneephone(String consigneephone) {
|
||||
this.consigneephone = consigneephone;
|
||||
}
|
||||
|
||||
public String getProvince() {
|
||||
return province;
|
||||
}
|
||||
|
||||
public void setProvince(String province) {
|
||||
this.province = province;
|
||||
}
|
||||
|
||||
public String getProvincename() {
|
||||
return provincename;
|
||||
}
|
||||
|
||||
public void setProvincename(String provincename) {
|
||||
this.provincename = provincename;
|
||||
}
|
||||
|
||||
public String getCity() {
|
||||
return city;
|
||||
}
|
||||
|
||||
public void setCity(String city) {
|
||||
this.city = city;
|
||||
}
|
||||
|
||||
public String getCityname() {
|
||||
return cityname;
|
||||
}
|
||||
|
||||
public void setCityname(String cityname) {
|
||||
this.cityname = cityname;
|
||||
}
|
||||
|
||||
public String getArea() {
|
||||
return area;
|
||||
}
|
||||
|
||||
public void setArea(String area) {
|
||||
this.area = area;
|
||||
}
|
||||
|
||||
public String getAreaname() {
|
||||
return areaname;
|
||||
}
|
||||
|
||||
public void setAreaname(String areaname) {
|
||||
this.areaname = areaname;
|
||||
}
|
||||
|
||||
public String getAddress() {
|
||||
return address;
|
||||
}
|
||||
|
||||
public void setAddress(String address) {
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
public String getReceiveway() {
|
||||
return receiveway;
|
||||
}
|
||||
|
||||
public void setReceiveway(String receiveway) {
|
||||
this.receiveway = receiveway;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public String getRemark1() {
|
||||
return remark1;
|
||||
}
|
||||
|
||||
public void setRemark1(String remark1) {
|
||||
this.remark1 = remark1;
|
||||
}
|
||||
|
||||
public String getSalearea() {
|
||||
return salearea;
|
||||
}
|
||||
|
||||
public void setSalearea(String salearea) {
|
||||
this.salearea = salearea;
|
||||
}
|
||||
|
||||
public String getSaleareaname() {
|
||||
return saleareaname;
|
||||
}
|
||||
|
||||
public void setSaleareaname(String saleareaname) {
|
||||
this.saleareaname = saleareaname;
|
||||
}
|
||||
|
||||
public String getGroupid() {
|
||||
return groupid;
|
||||
}
|
||||
|
||||
public void setGroupid(String groupid) {
|
||||
this.groupid = groupid;
|
||||
}
|
||||
|
||||
public String getGroupname() {
|
||||
return groupname;
|
||||
}
|
||||
|
||||
public void setGroupname(String groupname) {
|
||||
this.groupname = groupname;
|
||||
}
|
||||
|
||||
public String getFound() {
|
||||
return found;
|
||||
}
|
||||
|
||||
public void setFound(String found) {
|
||||
this.found = found;
|
||||
}
|
||||
|
||||
public String getFoundname() {
|
||||
return foundname;
|
||||
}
|
||||
|
||||
public void setFoundname(String foundname) {
|
||||
this.foundname = foundname;
|
||||
}
|
||||
|
||||
public Date getFounddt() {
|
||||
return founddt;
|
||||
}
|
||||
|
||||
public void setFounddt(Date founddt) {
|
||||
this.founddt = founddt;
|
||||
}
|
||||
|
||||
public String getSubmit() {
|
||||
return submit;
|
||||
}
|
||||
|
||||
public void setSubmit(String submit) {
|
||||
this.submit = submit;
|
||||
}
|
||||
|
||||
public String getSubmitname() {
|
||||
return submitname;
|
||||
}
|
||||
|
||||
public void setSubmitname(String submitname) {
|
||||
this.submitname = submitname;
|
||||
}
|
||||
|
||||
public Date getSubmitdt() {
|
||||
return submitdt;
|
||||
}
|
||||
|
||||
public void setSubmitdt(Date submitdt) {
|
||||
this.submitdt = submitdt;
|
||||
}
|
||||
|
||||
public String getAudit() {
|
||||
return audit;
|
||||
}
|
||||
|
||||
public void setAudit(String audit) {
|
||||
this.audit = audit;
|
||||
}
|
||||
|
||||
public String getAuditname() {
|
||||
return auditname;
|
||||
}
|
||||
|
||||
public void setAuditname(String auditname) {
|
||||
this.auditname = auditname;
|
||||
}
|
||||
|
||||
public Date getAuditdt() {
|
||||
return auditdt;
|
||||
}
|
||||
|
||||
public void setAuditdt(Date auditdt) {
|
||||
this.auditdt = auditdt;
|
||||
}
|
||||
|
||||
public Date getDt() {
|
||||
return dt;
|
||||
}
|
||||
|
||||
public void setDt(Date dt) {
|
||||
this.dt = dt;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+150
@@ -0,0 +1,150 @@
|
||||
package abacus.springboot.example.dao;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Version;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
@Entity
|
||||
@Table(name = "jc_billhg_pay")
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
@Schema(description = "回购支付明细")
|
||||
public class JcBillHgPay implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 7782628530648454397L;
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Schema(description = "自增长编码", required = true, example = "10")
|
||||
private Long id;
|
||||
|
||||
@Version
|
||||
@Schema(description = "版本号", required = true, example = "1")
|
||||
private Integer version;
|
||||
|
||||
@Schema(description = "稽查单号", required = true, example = "")
|
||||
private String billid;
|
||||
|
||||
@Schema(description = "回购单号", required = true, example = "")
|
||||
private String billhg;
|
||||
|
||||
@Schema(description = "支付方式", required = true, example = "")
|
||||
private String payment;
|
||||
|
||||
@Schema(description = "支付金额", required = true, example = "")
|
||||
private double amount;
|
||||
|
||||
@Schema(description = "账号名称", required = true, example = "")
|
||||
private String zhmc;
|
||||
|
||||
@Schema(description = "开发银行", required = true, example = "")
|
||||
private String khyh;
|
||||
|
||||
@Schema(description = "银行账号", required = true, example = "")
|
||||
private String yhzh;
|
||||
|
||||
@Schema(description = "时间戳", required = true, example = "")
|
||||
private Date dt = new Date();
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Integer getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public void setVersion(Integer version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public String getBillid() {
|
||||
return billid;
|
||||
}
|
||||
|
||||
public void setBillid(String billid) {
|
||||
this.billid = billid;
|
||||
}
|
||||
|
||||
public String getBillhg() {
|
||||
return billhg;
|
||||
}
|
||||
|
||||
public void setBillhg(String billhg) {
|
||||
this.billhg = billhg;
|
||||
}
|
||||
|
||||
public String getPayment() {
|
||||
return payment;
|
||||
}
|
||||
|
||||
public void setPayment(String payment) {
|
||||
this.payment = payment;
|
||||
}
|
||||
|
||||
public double getAmount() {
|
||||
return amount;
|
||||
}
|
||||
|
||||
public void setAmount(double amount) {
|
||||
this.amount = amount;
|
||||
}
|
||||
|
||||
public String getZhmc() {
|
||||
return zhmc;
|
||||
}
|
||||
|
||||
public void setZhmc(String zhmc) {
|
||||
this.zhmc = zhmc;
|
||||
}
|
||||
|
||||
public String getKhyh() {
|
||||
return khyh;
|
||||
}
|
||||
|
||||
public void setKhyh(String khyh) {
|
||||
this.khyh = khyh;
|
||||
}
|
||||
|
||||
public String getYhzh() {
|
||||
return yhzh;
|
||||
}
|
||||
|
||||
public void setYhzh(String yhzh) {
|
||||
this.yhzh = yhzh;
|
||||
}
|
||||
|
||||
public Date getDt() {
|
||||
return dt;
|
||||
}
|
||||
|
||||
public void setDt(Date dt) {
|
||||
this.dt = dt;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+486
@@ -0,0 +1,486 @@
|
||||
package abacus.springboot.example.dao;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Transient;
|
||||
import javax.persistence.Version;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
@Entity
|
||||
@Table(name = "jc_billin_item")
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
@Schema(description = "稽查入库(回购通知)明细")
|
||||
public class JcBillInItem implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -3841490251161254597L;
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Schema(description = "自增长编码", required = true, example = "10")
|
||||
private Long id;
|
||||
|
||||
@Version
|
||||
@Schema(description = "版本号", required = true, example = "1")
|
||||
private Integer version;
|
||||
|
||||
@Schema(description = "稽查单号", required = true, example = "")
|
||||
private String billid;
|
||||
|
||||
@Schema(description = "入库单号", required = true, example = "")
|
||||
private String billin;
|
||||
|
||||
@Schema(description = "回购单号", required = true, example = "")
|
||||
private String billhg;
|
||||
|
||||
@Schema(description = "状态", required = true, pattern="-1:终止,1:待通知回购,2:已通知回购", example = "")
|
||||
private int status = 1;
|
||||
/** 终止*/
|
||||
public final static int STATUS_MINUS_ONE = -1;
|
||||
/** 待通知回购*/
|
||||
public final static int STATUS_ONE = 1;
|
||||
/** 已通知回购*/
|
||||
public final static int STATUS_TWO = 2;
|
||||
|
||||
@Schema(description = "收货渠道-收货门店", required = true, example = "")
|
||||
private String channel;
|
||||
|
||||
@Schema(description = "客户编码", required = true, example = "")
|
||||
private String account;
|
||||
|
||||
@Schema(description = "客户名称", required = true, example = "")
|
||||
private String accountname;
|
||||
|
||||
@Schema(description = "商品编码", required = true, example = "")
|
||||
private String product;
|
||||
|
||||
@Schema(description = "商品名称", required = true, example = "")
|
||||
private String productname;
|
||||
|
||||
@Schema(description = "收货单价", required = true, example = "")
|
||||
private double price;
|
||||
|
||||
@Schema(description = "入库数量", required = true, example = "")
|
||||
private double quantity;
|
||||
|
||||
@Schema(description = "入库件数", required = true, example = "")
|
||||
private double numbers;
|
||||
|
||||
@Schema(description = "回购单价", required = true, example = "")
|
||||
private Double hgprice;
|
||||
|
||||
@Schema(description = "回购金额", required = true, example = "")
|
||||
private Double hgamount;
|
||||
|
||||
@Schema(description = "业务员编码", required = true, example = "")
|
||||
private String operator;
|
||||
|
||||
@Schema(description = "业务员名称", required = true, example = "")
|
||||
private String operatorname;
|
||||
|
||||
@Schema(description = "业务组编码", required = true, example = "")
|
||||
private String groupid;
|
||||
|
||||
@Schema(description = "业务组名称", required = true, example = "")
|
||||
private String groupname;
|
||||
|
||||
@Schema(description = "分销区域编码", required = true, example = "")
|
||||
private String salearea;
|
||||
|
||||
@Schema(description = "分销区域名称", required = true, example = "")
|
||||
private String saleareaname;
|
||||
|
||||
@Schema(description = "分货数量", required = true, example = "")
|
||||
private double fhquantity;
|
||||
|
||||
@Schema(description = "分货件数", required = true, example = "")
|
||||
private double fhnumbers;
|
||||
|
||||
@Schema(description = "分货仓库编码", required = true, hidden = true, example = "")
|
||||
private String fhwarehouse;
|
||||
|
||||
@Schema(description = "分货仓库名称", required = true, hidden = true, example = "")
|
||||
private String fhwarehousename;
|
||||
|
||||
@Schema(description = "旺店通单号", required = true, hidden = true, example = "")
|
||||
private String wdtorder;
|
||||
|
||||
@Schema(description = "旺店通出库单号", required = true, hidden = true, example = "")
|
||||
private String wdtbillout;
|
||||
|
||||
@Schema(description = "旺店通出库状态", required = true, hidden = true, example = "")
|
||||
private String wdtbillouttyp;
|
||||
|
||||
@Schema(description = "旺店通出库时间", required = true, hidden = true, example = "")
|
||||
private Date wdtoutdt;
|
||||
|
||||
@Schema(description = "旺店通入库时间", required = true, hidden = true, example = "")
|
||||
private Date wdtindt;
|
||||
|
||||
@Schema(description = "传输旺店通时间", required = true, hidden = true, example = "")
|
||||
private Date wdtdt;
|
||||
|
||||
@Schema(description = "时间戳", required = true, example = "")
|
||||
private Date dt = new Date();
|
||||
|
||||
@Transient
|
||||
@Schema(description = "规格", hidden = true, required = false, example = "")
|
||||
private String spec;
|
||||
|
||||
@Transient
|
||||
@Schema(description = "计量单位", hidden = true, required = false, example = "瓶")
|
||||
private String measure;
|
||||
|
||||
@Transient
|
||||
@Schema(description = "采购包装单位", hidden = true, required = false, example = "false")
|
||||
private String purunit;
|
||||
|
||||
@Transient
|
||||
@Schema(description = "采购包装量", hidden = true, required = true, example = "1")
|
||||
private double purpkg = 1.0;
|
||||
|
||||
@Transient
|
||||
@Schema(description = "历史价格", hidden = true, required = true, example = "1")
|
||||
private Double oldhgprice;
|
||||
|
||||
@Transient
|
||||
@Schema(description = "物流公司名称", hidden = true, required = true, example = "")
|
||||
private String logisticsname;
|
||||
|
||||
@Transient
|
||||
@Schema(description = "物流单号", hidden = true, required = true, example = "")
|
||||
private String logisticsno;
|
||||
|
||||
public String getLogisticsname() {
|
||||
return logisticsname;
|
||||
}
|
||||
|
||||
public void setLogisticsname(String logisticsname) {
|
||||
this.logisticsname = logisticsname;
|
||||
}
|
||||
|
||||
public String getLogisticsno() {
|
||||
return logisticsno;
|
||||
}
|
||||
|
||||
public void setLogisticsno(String logisticsno) {
|
||||
this.logisticsno = logisticsno;
|
||||
}
|
||||
|
||||
public Date getWdtoutdt() {
|
||||
return wdtoutdt;
|
||||
}
|
||||
|
||||
public void setWdtoutdt(Date wdtoutdt) {
|
||||
this.wdtoutdt = wdtoutdt;
|
||||
}
|
||||
|
||||
public Date getWdtindt() {
|
||||
return wdtindt;
|
||||
}
|
||||
|
||||
public void setWdtindt(Date wdtindt) {
|
||||
this.wdtindt = wdtindt;
|
||||
}
|
||||
|
||||
public String getChannel() {
|
||||
return channel;
|
||||
}
|
||||
|
||||
public void setChannel(String channel) {
|
||||
this.channel = channel;
|
||||
}
|
||||
|
||||
public Double getOldhgprice() {
|
||||
return oldhgprice;
|
||||
}
|
||||
|
||||
public void setOldhgprice(Double oldhgprice) {
|
||||
this.oldhgprice = oldhgprice;
|
||||
}
|
||||
|
||||
public String getSpec() {
|
||||
return spec;
|
||||
}
|
||||
|
||||
public void setSpec(String spec) {
|
||||
this.spec = spec;
|
||||
}
|
||||
|
||||
public String getMeasure() {
|
||||
return measure;
|
||||
}
|
||||
|
||||
public void setMeasure(String measure) {
|
||||
this.measure = measure;
|
||||
}
|
||||
|
||||
public String getPurunit() {
|
||||
return purunit;
|
||||
}
|
||||
|
||||
public void setPurunit(String purunit) {
|
||||
this.purunit = purunit;
|
||||
}
|
||||
|
||||
public double getPurpkg() {
|
||||
return purpkg;
|
||||
}
|
||||
|
||||
public void setPurpkg(double purpkg) {
|
||||
this.purpkg = purpkg;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Integer getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public void setVersion(Integer version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public String getBillid() {
|
||||
return billid;
|
||||
}
|
||||
|
||||
public void setBillid(String billid) {
|
||||
this.billid = billid;
|
||||
}
|
||||
|
||||
public String getBillin() {
|
||||
return billin;
|
||||
}
|
||||
|
||||
public void setBillin(String billin) {
|
||||
this.billin = billin;
|
||||
}
|
||||
|
||||
public String getBillhg() {
|
||||
return billhg;
|
||||
}
|
||||
|
||||
public void setBillhg(String billhg) {
|
||||
this.billhg = billhg;
|
||||
}
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(int status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getAccount() {
|
||||
return account;
|
||||
}
|
||||
|
||||
public void setAccount(String account) {
|
||||
this.account = account;
|
||||
}
|
||||
|
||||
public String getAccountname() {
|
||||
return accountname;
|
||||
}
|
||||
|
||||
public void setAccountname(String accountname) {
|
||||
this.accountname = accountname;
|
||||
}
|
||||
|
||||
public String getProduct() {
|
||||
return product;
|
||||
}
|
||||
|
||||
public void setProduct(String product) {
|
||||
this.product = product;
|
||||
}
|
||||
|
||||
public String getProductname() {
|
||||
return productname;
|
||||
}
|
||||
|
||||
public void setProductname(String productname) {
|
||||
this.productname = productname;
|
||||
}
|
||||
|
||||
public double getPrice() {
|
||||
return price;
|
||||
}
|
||||
|
||||
public void setPrice(double price) {
|
||||
this.price = price;
|
||||
}
|
||||
|
||||
public double getQuantity() {
|
||||
return quantity;
|
||||
}
|
||||
|
||||
public void setQuantity(double quantity) {
|
||||
this.quantity = quantity;
|
||||
}
|
||||
|
||||
public double getNumbers() {
|
||||
return numbers;
|
||||
}
|
||||
|
||||
public void setNumbers(double numbers) {
|
||||
this.numbers = numbers;
|
||||
}
|
||||
|
||||
public Double getHgprice() {
|
||||
return hgprice;
|
||||
}
|
||||
|
||||
public void setHgprice(Double hgprice) {
|
||||
this.hgprice = hgprice;
|
||||
}
|
||||
|
||||
public Double getHgamount() {
|
||||
return hgamount;
|
||||
}
|
||||
|
||||
public void setHgamount(Double hgamount) {
|
||||
this.hgamount = hgamount;
|
||||
}
|
||||
|
||||
public String getOperator() {
|
||||
return operator;
|
||||
}
|
||||
|
||||
public void setOperator(String operator) {
|
||||
this.operator = operator;
|
||||
}
|
||||
|
||||
public String getOperatorname() {
|
||||
return operatorname;
|
||||
}
|
||||
|
||||
public void setOperatorname(String operatorname) {
|
||||
this.operatorname = operatorname;
|
||||
}
|
||||
|
||||
public String getGroupid() {
|
||||
return groupid;
|
||||
}
|
||||
|
||||
public void setGroupid(String groupid) {
|
||||
this.groupid = groupid;
|
||||
}
|
||||
|
||||
public String getGroupname() {
|
||||
return groupname;
|
||||
}
|
||||
|
||||
public void setGroupname(String groupname) {
|
||||
this.groupname = groupname;
|
||||
}
|
||||
|
||||
public String getSalearea() {
|
||||
return salearea;
|
||||
}
|
||||
|
||||
public void setSalearea(String salearea) {
|
||||
this.salearea = salearea;
|
||||
}
|
||||
|
||||
public String getSaleareaname() {
|
||||
return saleareaname;
|
||||
}
|
||||
|
||||
public void setSaleareaname(String saleareaname) {
|
||||
this.saleareaname = saleareaname;
|
||||
}
|
||||
|
||||
public double getFhquantity() {
|
||||
return fhquantity;
|
||||
}
|
||||
|
||||
public void setFhquantity(double fhquantity) {
|
||||
this.fhquantity = fhquantity;
|
||||
}
|
||||
|
||||
public double getFhnumbers() {
|
||||
return fhnumbers;
|
||||
}
|
||||
|
||||
public void setFhnumbers(double fhnumbers) {
|
||||
this.fhnumbers = fhnumbers;
|
||||
}
|
||||
|
||||
public String getFhwarehouse() {
|
||||
return fhwarehouse;
|
||||
}
|
||||
|
||||
public void setFhwarehouse(String fhwarehouse) {
|
||||
this.fhwarehouse = fhwarehouse;
|
||||
}
|
||||
|
||||
public String getFhwarehousename() {
|
||||
return fhwarehousename;
|
||||
}
|
||||
|
||||
public void setFhwarehousename(String fhwarehousename) {
|
||||
this.fhwarehousename = fhwarehousename;
|
||||
}
|
||||
|
||||
public String getWdtorder() {
|
||||
return wdtorder;
|
||||
}
|
||||
|
||||
public void setWdtorder(String wdtorder) {
|
||||
this.wdtorder = wdtorder;
|
||||
}
|
||||
|
||||
public String getWdtbillout() {
|
||||
return wdtbillout;
|
||||
}
|
||||
|
||||
public void setWdtbillout(String wdtbillout) {
|
||||
this.wdtbillout = wdtbillout;
|
||||
}
|
||||
|
||||
public String getWdtbillouttyp() {
|
||||
return wdtbillouttyp;
|
||||
}
|
||||
|
||||
public void setWdtbillouttyp(String wdtbillouttyp) {
|
||||
this.wdtbillouttyp = wdtbillouttyp;
|
||||
}
|
||||
|
||||
public Date getWdtdt() {
|
||||
return wdtdt;
|
||||
}
|
||||
|
||||
public void setWdtdt(Date wdtdt) {
|
||||
this.wdtdt = wdtdt;
|
||||
}
|
||||
|
||||
public Date getDt() {
|
||||
return dt;
|
||||
}
|
||||
|
||||
public void setDt(Date dt) {
|
||||
this.dt = dt;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+120
@@ -0,0 +1,120 @@
|
||||
package abacus.springboot.example.dao;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Version;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
@Entity
|
||||
@Table(name = "jc_bill_photo")
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
@Schema(description = "稽查图片")
|
||||
public class JcBillPhoto implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -5561468051239492839L;
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Schema(description = "自增长编码", required = true, example = "10")
|
||||
private Long id;
|
||||
|
||||
@Version
|
||||
@Schema(description = "版本号", required = true, example = "1")
|
||||
private Integer version;
|
||||
|
||||
@Schema(description = "来源单号", required = true, example = "1")
|
||||
private String srcid;
|
||||
|
||||
@Schema(description = "来源明细", required = true, example = "1")
|
||||
private String srcitemid;
|
||||
|
||||
@Schema(description = "图片类型", required = true, pattern="稽查付款截图,稽查货品图,回购通知函,回购违规通知函,回购支付凭证", example = "1")
|
||||
private String typephoto;
|
||||
public final static String JC_FK = "稽查付款截图";
|
||||
public final static String JC_HP = "稽查货品图";
|
||||
public final static String HG_TZH = "回购通知函";
|
||||
public final static String HG_WGTZH = "回购违规通知函";
|
||||
public final static String HG_ZFPZ = "回购支付凭证";
|
||||
|
||||
@Schema(description = "url地址", required = true, example = "1")
|
||||
private String urlphoto;
|
||||
|
||||
@Schema(description = "时间戳", required = true, example = "1")
|
||||
private Date dt = new Date();
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Integer getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public void setVersion(Integer version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public String getSrcid() {
|
||||
return srcid;
|
||||
}
|
||||
|
||||
public void setSrcid(String srcid) {
|
||||
this.srcid = srcid;
|
||||
}
|
||||
|
||||
public String getSrcitemid() {
|
||||
return srcitemid;
|
||||
}
|
||||
|
||||
public void setSrcitemid(String srcitemid) {
|
||||
this.srcitemid = srcitemid;
|
||||
}
|
||||
|
||||
public String getTypephoto() {
|
||||
return typephoto;
|
||||
}
|
||||
|
||||
public void setTypephoto(String typephoto) {
|
||||
this.typephoto = typephoto;
|
||||
}
|
||||
|
||||
public String getUrlphoto() {
|
||||
return urlphoto;
|
||||
}
|
||||
|
||||
public void setUrlphoto(String urlphoto) {
|
||||
this.urlphoto = urlphoto;
|
||||
}
|
||||
|
||||
public Date getDt() {
|
||||
return dt;
|
||||
}
|
||||
|
||||
public void setDt(Date dt) {
|
||||
this.dt = dt;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+434
@@ -0,0 +1,434 @@
|
||||
package abacus.springboot.example.dao;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Temporal;
|
||||
import javax.persistence.TemporalType;
|
||||
import javax.persistence.Transient;
|
||||
import javax.persistence.Version;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
@Entity
|
||||
@Table(name = "jc_billsource_item")
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
@Schema(description = "稽查收货明细")
|
||||
public class JcBillSourceItem implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 8819914697371518608L;
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Schema(description = "自增长编码", required = true, example = "10")
|
||||
private Long id;
|
||||
|
||||
@Version
|
||||
@Schema(description = "版本号", required = true, example = "1")
|
||||
private Integer version = 1;
|
||||
|
||||
@Schema(description = "行号", required = false, example = "2")
|
||||
private int indexno;
|
||||
|
||||
@Schema(description = "稽查单号", required = true, example = "")
|
||||
private String billid;
|
||||
|
||||
@Schema(description = "状态", required = true, pattern="-2:人工朔源驳回,-1:系统朔源验证未通过,0:系统溯源未验证,1:系统朔源验证通过,2:人工朔源待确认,3:人工朔源已确认", example = "")
|
||||
private int status = 0;
|
||||
/** 人工朔源驳回*/
|
||||
public final static int STATUS_MINUS_TWO = -2;
|
||||
/** 系统朔源验证未通过*/
|
||||
public final static int STATUS_MINUS_ONE = -1;
|
||||
/** 系统溯源未验证*/
|
||||
public final static int STATUS_ZERO = 0;
|
||||
/** 系统朔源验证通过*/
|
||||
public final static int STATUS_ONE = 1;
|
||||
/** 人工朔源待确认*/
|
||||
public final static int STATUS_TWO = 2;
|
||||
/** 人工朔源已确认*/
|
||||
public final static int STATUS_THREE = 3;
|
||||
|
||||
@Schema(description = "收货来源", required = true, example = "")
|
||||
private String recsource;
|
||||
|
||||
@Schema(description = "收货平台", required = true, example = "")
|
||||
private String recplatform;
|
||||
|
||||
@Schema(description = "收货渠道", required = true, example = "")
|
||||
private String channel;
|
||||
|
||||
@Schema(description = "收货单价", required = true, example = "")
|
||||
private double price;
|
||||
|
||||
@Schema(description = "收货数量", required = true, example = "")
|
||||
private double quantity;
|
||||
|
||||
@Schema(description = "收货件数", required = true, example = "")
|
||||
private double numbers;
|
||||
|
||||
@Schema(description = "收货金额", required = true, example = "")
|
||||
private double subtotal;
|
||||
|
||||
@Schema(description = "货品编号", required = true, example = "")
|
||||
private String goodsid;
|
||||
|
||||
@Schema(description = "物流码", required = true, example = "")
|
||||
private String logisticsid;
|
||||
|
||||
@Schema(description = "出库单号", required = true, example = "")
|
||||
private String billout;
|
||||
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
@Schema(description = "出库日期", required = true, example = "")
|
||||
private Date billoutdt;
|
||||
|
||||
@Schema(description = "出库仓库编码", required = true, example = "")
|
||||
private String billoutwh;
|
||||
|
||||
@Schema(description = "出库仓库名称", required = true, example = "")
|
||||
private String billoutwhname;
|
||||
|
||||
@Schema(description = "商品编码", required = true, example = "")
|
||||
private String product;
|
||||
|
||||
@Schema(description = "商品名称", required = true, example = "")
|
||||
private String productname;
|
||||
|
||||
@Schema(description = "客户编码", required = true, example = "")
|
||||
private String account;
|
||||
|
||||
@Schema(description = "客户名称", required = true, example = "")
|
||||
private String accountname;
|
||||
|
||||
@Schema(description = "考核业务员编码", required = true, example = "")
|
||||
private String operator;
|
||||
|
||||
@Schema(description = "考核业务员名称", required = true, example = "")
|
||||
private String operatorname;
|
||||
|
||||
@Schema(description = "业务组编码", required = true, example = "")
|
||||
private String groupid;
|
||||
|
||||
@Schema(description = "业务组名称", required = true, example = "")
|
||||
private String groupname;
|
||||
|
||||
@Schema(description = "分销区域编码", required = true, example = "")
|
||||
private String salearea;
|
||||
|
||||
@Schema(description = "分销区域名称", required = true, example = "")
|
||||
private String saleareaname;
|
||||
|
||||
@Schema(description = "比对来源", required = true, example = "")
|
||||
private String source;
|
||||
public static final String SOURCE_ERP = "业务中台";
|
||||
public static final String SOURCE_EWM = "二维码";
|
||||
public static final String SOURCE_XX = "线下";
|
||||
|
||||
@Schema(description = "驳回原因", required = true, example = "")
|
||||
private String reason;
|
||||
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
@Schema(description = "时间戳", required = true, example = "")
|
||||
private Date dt = new Date();
|
||||
|
||||
@Transient
|
||||
@Schema(description = "付款图片", required = false, hidden = true, pattern = "这是个JSON数组,不是JSONArray对象", example = "[\"44444\",\"aaaaa\"]")
|
||||
private List<String> paymentPhoto;
|
||||
|
||||
@Transient
|
||||
@Schema(description = "货品图片", required = false, hidden = true, pattern = "这是个JSON数组,不是JSONArray对象", example = "[\"44444\",\"aaaaa\"]")
|
||||
private List<String> goodsPhotos;
|
||||
|
||||
@Transient
|
||||
@Schema(description = "货品图片", required = false, hidden = true, pattern = "这是个JSON数组,不是JSONArray对象", example = "[\"44444\",\"aaaaa\"]")
|
||||
private List<JcBillPhoto> hpts;
|
||||
|
||||
public List<JcBillPhoto> getHpts() {
|
||||
return hpts;
|
||||
}
|
||||
|
||||
public void setHpts(List<JcBillPhoto> hpts) {
|
||||
this.hpts = hpts;
|
||||
}
|
||||
|
||||
public List<String> getPaymentPhoto() {
|
||||
return paymentPhoto;
|
||||
}
|
||||
|
||||
public void setPaymentPhoto(List<String> paymentPhoto) {
|
||||
this.paymentPhoto = paymentPhoto;
|
||||
}
|
||||
|
||||
public List<String> getGoodsPhotos() {
|
||||
return goodsPhotos;
|
||||
}
|
||||
|
||||
public void setGoodsPhotos(List<String> goodsPhotos) {
|
||||
this.goodsPhotos = goodsPhotos;
|
||||
}
|
||||
|
||||
public int getIndexno() {
|
||||
return indexno;
|
||||
}
|
||||
|
||||
public void setIndexno(int indexno) {
|
||||
this.indexno = indexno;
|
||||
}
|
||||
|
||||
public String getRecplatform() {
|
||||
return recplatform;
|
||||
}
|
||||
|
||||
public void setRecplatform(String recplatform) {
|
||||
this.recplatform = recplatform;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Integer getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public void setVersion(Integer version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public String getBillid() {
|
||||
return billid;
|
||||
}
|
||||
|
||||
public void setBillid(String billid) {
|
||||
this.billid = billid;
|
||||
}
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(int status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getRecsource() {
|
||||
return recsource;
|
||||
}
|
||||
|
||||
public void setRecsource(String recsource) {
|
||||
this.recsource = recsource;
|
||||
}
|
||||
|
||||
public String getChannel() {
|
||||
return channel;
|
||||
}
|
||||
|
||||
public void setChannel(String channel) {
|
||||
this.channel = channel;
|
||||
}
|
||||
|
||||
public double getPrice() {
|
||||
return price;
|
||||
}
|
||||
|
||||
public void setPrice(double price) {
|
||||
this.price = price;
|
||||
}
|
||||
|
||||
public double getQuantity() {
|
||||
return quantity;
|
||||
}
|
||||
|
||||
public void setQuantity(double quantity) {
|
||||
this.quantity = quantity;
|
||||
}
|
||||
|
||||
public double getNumbers() {
|
||||
return numbers;
|
||||
}
|
||||
|
||||
public void setNumbers(double numbers) {
|
||||
this.numbers = numbers;
|
||||
}
|
||||
|
||||
public double getSubtotal() {
|
||||
return subtotal;
|
||||
}
|
||||
|
||||
public void setSubtotal(double subtotal) {
|
||||
this.subtotal = subtotal;
|
||||
}
|
||||
|
||||
public String getGoodsid() {
|
||||
return goodsid;
|
||||
}
|
||||
|
||||
public void setGoodsid(String goodsid) {
|
||||
this.goodsid = goodsid;
|
||||
}
|
||||
|
||||
public String getLogisticsid() {
|
||||
return logisticsid;
|
||||
}
|
||||
|
||||
public void setLogisticsid(String logisticsid) {
|
||||
this.logisticsid = logisticsid;
|
||||
}
|
||||
|
||||
public String getBillout() {
|
||||
return billout;
|
||||
}
|
||||
|
||||
public void setBillout(String billout) {
|
||||
this.billout = billout;
|
||||
}
|
||||
|
||||
public Date getBilloutdt() {
|
||||
return billoutdt;
|
||||
}
|
||||
|
||||
public void setBilloutdt(Date billoutdt) {
|
||||
this.billoutdt = billoutdt;
|
||||
}
|
||||
|
||||
public String getBilloutwh() {
|
||||
return billoutwh;
|
||||
}
|
||||
|
||||
public void setBilloutwh(String billoutwh) {
|
||||
this.billoutwh = billoutwh;
|
||||
}
|
||||
|
||||
public String getBilloutwhname() {
|
||||
return billoutwhname;
|
||||
}
|
||||
|
||||
public void setBilloutwhname(String billoutwhname) {
|
||||
this.billoutwhname = billoutwhname;
|
||||
}
|
||||
|
||||
public String getProduct() {
|
||||
return product;
|
||||
}
|
||||
|
||||
public void setProduct(String product) {
|
||||
this.product = product;
|
||||
}
|
||||
|
||||
public String getProductname() {
|
||||
return productname;
|
||||
}
|
||||
|
||||
public void setProductname(String productname) {
|
||||
this.productname = productname;
|
||||
}
|
||||
|
||||
public String getAccount() {
|
||||
return account;
|
||||
}
|
||||
|
||||
public void setAccount(String account) {
|
||||
this.account = account;
|
||||
}
|
||||
|
||||
public String getAccountname() {
|
||||
return accountname;
|
||||
}
|
||||
|
||||
public void setAccountname(String accountname) {
|
||||
this.accountname = accountname;
|
||||
}
|
||||
|
||||
public String getOperator() {
|
||||
return operator;
|
||||
}
|
||||
|
||||
public void setOperator(String operator) {
|
||||
this.operator = operator;
|
||||
}
|
||||
|
||||
public String getOperatorname() {
|
||||
return operatorname;
|
||||
}
|
||||
|
||||
public void setOperatorname(String operatorname) {
|
||||
this.operatorname = operatorname;
|
||||
}
|
||||
|
||||
public String getGroupid() {
|
||||
return groupid;
|
||||
}
|
||||
|
||||
public void setGroupid(String groupid) {
|
||||
this.groupid = groupid;
|
||||
}
|
||||
|
||||
public String getGroupname() {
|
||||
return groupname;
|
||||
}
|
||||
|
||||
public void setGroupname(String groupname) {
|
||||
this.groupname = groupname;
|
||||
}
|
||||
|
||||
public String getSalearea() {
|
||||
return salearea;
|
||||
}
|
||||
|
||||
public void setSalearea(String salearea) {
|
||||
this.salearea = salearea;
|
||||
}
|
||||
|
||||
public String getSaleareaname() {
|
||||
return saleareaname;
|
||||
}
|
||||
|
||||
public void setSaleareaname(String saleareaname) {
|
||||
this.saleareaname = saleareaname;
|
||||
}
|
||||
|
||||
public String getSource() {
|
||||
return source;
|
||||
}
|
||||
|
||||
public void setSource(String source) {
|
||||
this.source = source;
|
||||
}
|
||||
|
||||
public String getReason() {
|
||||
return reason;
|
||||
}
|
||||
|
||||
public void setReason(String reason) {
|
||||
this.reason = reason;
|
||||
}
|
||||
|
||||
public Date getDt() {
|
||||
return dt;
|
||||
}
|
||||
|
||||
public void setDt(Date dt) {
|
||||
this.dt = dt;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+298
@@ -0,0 +1,298 @@
|
||||
package abacus.springboot.example.dao;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Temporal;
|
||||
import javax.persistence.TemporalType;
|
||||
import javax.persistence.Transient;
|
||||
import javax.persistence.Version;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
@Entity
|
||||
@Table(name = "jc_source_item")
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
@Schema(description = "稽查溯源明细")
|
||||
public class JcSourceItem implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -2272967075701112300L;
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Schema(description = "自增长编码", required = true, example = "10")
|
||||
private Long id;
|
||||
|
||||
@Version
|
||||
@Schema(description = "版本号", required = true, example = "1")
|
||||
private Integer version = 1;
|
||||
|
||||
@Schema(description = "稽查单号", required = true, example = "")
|
||||
private String billid;
|
||||
|
||||
@Schema(description = "明细Id", required = true, example = "")
|
||||
private String srcitemid;
|
||||
|
||||
@Schema(description = "状态", required = true, pattern="0:待确认,1:已确认", example = "")
|
||||
private int status = 0;
|
||||
/** 待确认*/
|
||||
public final static int STATUS_ZERO = 0;
|
||||
/** 已确认*/
|
||||
public final static int STATUS_ONE = 1;
|
||||
|
||||
@Schema(description = "货品编号", required = true, example = "")
|
||||
private String goodsid;
|
||||
|
||||
@Schema(description = "物流码", required = true, example = "")
|
||||
private String logisticsid;
|
||||
|
||||
@Schema(description = "出库单号", required = true, example = "")
|
||||
private String billout;
|
||||
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
@Schema(description = "出库日期", required = true, example = "")
|
||||
private Date billoutdt;
|
||||
|
||||
@Schema(description = "出库仓库编码", required = true, example = "")
|
||||
private String billoutwh;
|
||||
|
||||
@Schema(description = "出库仓库名称", required = true, example = "")
|
||||
private String billoutwhname;
|
||||
|
||||
@Schema(description = "商品编码", required = true, example = "")
|
||||
private String product;
|
||||
|
||||
@Schema(description = "商品名称", required = true, example = "")
|
||||
private String productname;
|
||||
|
||||
@Schema(description = "客户编码", required = true, example = "")
|
||||
private String account;
|
||||
|
||||
@Schema(description = "客户名称", required = true, example = "")
|
||||
private String accountname;
|
||||
|
||||
@Schema(description = "考核业务员编码", required = true, example = "")
|
||||
private String operator;
|
||||
|
||||
@Schema(description = "考核业务员名称", required = true, example = "")
|
||||
private String operatorname;
|
||||
|
||||
@Schema(description = "业务组编码", required = true, example = "")
|
||||
private String groupid;
|
||||
|
||||
@Schema(description = "业务组名称", required = true, example = "")
|
||||
private String groupname;
|
||||
|
||||
@Schema(description = "分销区域编码", required = true, example = "")
|
||||
private String salearea;
|
||||
|
||||
@Schema(description = "分销区域名称", required = true, example = "")
|
||||
private String saleareaname;
|
||||
|
||||
@Schema(description = "比对来源", required = true, pattern="业务中台,二维码,线下", example = "")
|
||||
private String source;
|
||||
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
@Schema(description = "时间戳", required = true, example = "")
|
||||
private Date dt = new Date();
|
||||
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(int status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Integer getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public void setVersion(Integer version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public String getBillid() {
|
||||
return billid;
|
||||
}
|
||||
|
||||
public void setBillid(String billid) {
|
||||
this.billid = billid;
|
||||
}
|
||||
|
||||
public String getSrcitemid() {
|
||||
return srcitemid;
|
||||
}
|
||||
|
||||
public void setSrcitemid(String srcitemid) {
|
||||
this.srcitemid = srcitemid;
|
||||
}
|
||||
|
||||
public String getGoodsid() {
|
||||
return goodsid;
|
||||
}
|
||||
|
||||
public void setGoodsid(String goodsid) {
|
||||
this.goodsid = goodsid;
|
||||
}
|
||||
|
||||
public String getLogisticsid() {
|
||||
return logisticsid;
|
||||
}
|
||||
|
||||
public void setLogisticsid(String logisticsid) {
|
||||
this.logisticsid = logisticsid;
|
||||
}
|
||||
|
||||
public String getBillout() {
|
||||
return billout;
|
||||
}
|
||||
|
||||
public void setBillout(String billout) {
|
||||
this.billout = billout;
|
||||
}
|
||||
|
||||
public Date getBilloutdt() {
|
||||
return billoutdt;
|
||||
}
|
||||
|
||||
public void setBilloutdt(Date billoutdt) {
|
||||
this.billoutdt = billoutdt;
|
||||
}
|
||||
|
||||
public String getBilloutwh() {
|
||||
return billoutwh;
|
||||
}
|
||||
|
||||
public void setBilloutwh(String billoutwh) {
|
||||
this.billoutwh = billoutwh;
|
||||
}
|
||||
|
||||
public String getBilloutwhname() {
|
||||
return billoutwhname;
|
||||
}
|
||||
|
||||
public void setBilloutwhname(String billoutwhname) {
|
||||
this.billoutwhname = billoutwhname;
|
||||
}
|
||||
|
||||
public String getProduct() {
|
||||
return product;
|
||||
}
|
||||
|
||||
public void setProduct(String product) {
|
||||
this.product = product;
|
||||
}
|
||||
|
||||
public String getProductname() {
|
||||
return productname;
|
||||
}
|
||||
|
||||
public void setProductname(String productname) {
|
||||
this.productname = productname;
|
||||
}
|
||||
|
||||
public String getAccount() {
|
||||
return account;
|
||||
}
|
||||
|
||||
public void setAccount(String account) {
|
||||
this.account = account;
|
||||
}
|
||||
|
||||
public String getAccountname() {
|
||||
return accountname;
|
||||
}
|
||||
|
||||
public void setAccountname(String accountname) {
|
||||
this.accountname = accountname;
|
||||
}
|
||||
|
||||
public String getOperator() {
|
||||
return operator;
|
||||
}
|
||||
|
||||
public void setOperator(String operator) {
|
||||
this.operator = operator;
|
||||
}
|
||||
|
||||
public String getOperatorname() {
|
||||
return operatorname;
|
||||
}
|
||||
|
||||
public void setOperatorname(String operatorname) {
|
||||
this.operatorname = operatorname;
|
||||
}
|
||||
|
||||
public String getGroupid() {
|
||||
return groupid;
|
||||
}
|
||||
|
||||
public void setGroupid(String groupid) {
|
||||
this.groupid = groupid;
|
||||
}
|
||||
|
||||
public String getGroupname() {
|
||||
return groupname;
|
||||
}
|
||||
|
||||
public void setGroupname(String groupname) {
|
||||
this.groupname = groupname;
|
||||
}
|
||||
|
||||
public String getSalearea() {
|
||||
return salearea;
|
||||
}
|
||||
|
||||
public void setSalearea(String salearea) {
|
||||
this.salearea = salearea;
|
||||
}
|
||||
|
||||
public String getSaleareaname() {
|
||||
return saleareaname;
|
||||
}
|
||||
|
||||
public void setSaleareaname(String saleareaname) {
|
||||
this.saleareaname = saleareaname;
|
||||
}
|
||||
|
||||
public String getSource() {
|
||||
return source;
|
||||
}
|
||||
|
||||
public void setSource(String source) {
|
||||
this.source = source;
|
||||
}
|
||||
|
||||
public Date getDt() {
|
||||
return dt;
|
||||
}
|
||||
|
||||
public void setDt(Date dt) {
|
||||
this.dt = dt;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+835
@@ -0,0 +1,835 @@
|
||||
package abacus.springboot.example.esb;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Isolation;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import abacus.springboot.example.api.view.ApiBillHg;
|
||||
import abacus.springboot.example.api.view.ApiBillHgItem;
|
||||
import abacus.springboot.example.api.view.ApiBillHgPayment;
|
||||
import abacus.springboot.example.api.view.ApiJcBill;
|
||||
import abacus.springboot.example.api.view.ApiJcBillHgSearchItem;
|
||||
import abacus.springboot.example.api.view.ApiJcBillItem;
|
||||
import abacus.springboot.example.api.view.ApiJcBillSearch;
|
||||
import abacus.springboot.example.api.view.ApiReqJcBill;
|
||||
import abacus.springboot.example.api.view.ApiReqJcBillGoodsPhoto;
|
||||
import abacus.springboot.example.api.view.ApiReqJcBillItem;
|
||||
import abacus.springboot.example.api.view.JcBillCount;
|
||||
import abacus.springboot.example.api.view.JcCodeFlow;
|
||||
import abacus.springboot.example.api.view.JcProduct;
|
||||
import abacus.springboot.example.api.view.JcProductBillSouce;
|
||||
import abacus.springboot.example.dao.JcBill;
|
||||
import abacus.springboot.example.dao.JcBillHg;
|
||||
import abacus.springboot.example.dao.JcBillHgPay;
|
||||
import abacus.springboot.example.dao.JcBillInItem;
|
||||
import abacus.springboot.example.dao.JcBillPhoto;
|
||||
import abacus.springboot.example.dao.JcBillSourceItem;
|
||||
import abacus.springboot.example.dao.JcSourceItem;
|
||||
import abacus.springboot.example.pi.ApiJcBillAccessIF;
|
||||
import abacus.springboot.example.pi.JcBillAccessIF;
|
||||
import abacus.springboot.example.repository.JcBillHgPayRepository;
|
||||
import abacus.springboot.example.repository.JcBillHgRepository;
|
||||
import abacus.springboot.example.repository.JcBillInItemRepository;
|
||||
import abacus.springboot.example.repository.JcBillPhotoRepository;
|
||||
import abacus.springboot.example.repository.JcBillRepository;
|
||||
import abacus.springboot.example.repository.JcBillSourceItemRepository;
|
||||
import abacus.springboot.example.repository.JcSourceItemRepository;
|
||||
import abacus.springboot.example.wsi.ApiJcBillServiceIF;
|
||||
|
||||
@Service
|
||||
public class ApiJcBillService implements ApiJcBillServiceIF {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(ApiJcBillService.class);
|
||||
|
||||
@Autowired
|
||||
private ApiJcBillAccessIF apiJcBillAccess;
|
||||
|
||||
@Autowired
|
||||
private JcBillAccessIF jcBillAccess;
|
||||
|
||||
@Autowired
|
||||
private JcBillRepository jcBillRepository;
|
||||
|
||||
@Autowired
|
||||
private JcBillSourceItemRepository jcBillSourceItemRepository;
|
||||
|
||||
@Autowired
|
||||
private JcBillPhotoRepository jcBillPhotoRepository;
|
||||
|
||||
@Autowired
|
||||
private JcBillHgRepository jcBillHgRepository;
|
||||
|
||||
@Autowired
|
||||
private JcBillHgPayRepository jcBillHgPayRepository;
|
||||
|
||||
@Autowired
|
||||
private JcSourceItemRepository jcSourceItemRepository;
|
||||
|
||||
@Autowired
|
||||
private JcBillInItemRepository jcBillInItemRepository;
|
||||
|
||||
@Override
|
||||
public Page<ApiJcBillSearch> queryApiJcBillSearch(String keyword, String employee, String status, Pageable pageable)
|
||||
throws RuntimeException {
|
||||
try {
|
||||
return this.apiJcBillAccess.queryApiJcBillSearch(keyword, employee, status, pageable);
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
LOG.error("服务异常", e.getMessage());
|
||||
throw new RuntimeException("服务异常:", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ApiJcBill queryApiJcBillById(String id) throws RuntimeException {
|
||||
try {
|
||||
return this.apiJcBillAccess.queryApiJcBillById(id);
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
LOG.error("服务异常", e.getMessage());
|
||||
throw new RuntimeException("服务异常:", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ApiJcBillItem> queryApiJcBillItemByBIllId(String billId) throws RuntimeException {
|
||||
try {
|
||||
return this.apiJcBillAccess.queryApiJcBillItemByBIllId(billId);
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
LOG.error("服务异常", e.getMessage());
|
||||
throw new RuntimeException("服务异常:", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, List<JcBillPhoto>> queryJcBillPhoto(String srcid) throws RuntimeException {
|
||||
try {
|
||||
List<JcBillPhoto> billPhotos = jcBillAccess.queryJcBillPhoto(srcid, null, null);
|
||||
|
||||
if(billPhotos == null) return new HashMap<String, List<JcBillPhoto>>();
|
||||
|
||||
Map<String, List<JcBillPhoto>> map = billPhotos.stream()
|
||||
.collect(Collectors.groupingBy(e -> {
|
||||
return e.getTypephoto() + "#" + e.getSrcitemid();
|
||||
},
|
||||
Collectors.collectingAndThen(Collectors.toList(), value -> value)
|
||||
));
|
||||
|
||||
return map;
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
LOG.error("服务异常", e.getMessage());
|
||||
throw new RuntimeException("服务异常:", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, List<JcBillPhoto>> queryJcBillPhotoIn(List<String> srcids) throws RuntimeException {
|
||||
try {
|
||||
List<JcBillPhoto> billPhotos = jcBillAccess.queryJcBillPhotoIn(srcids);
|
||||
|
||||
if(billPhotos == null) return new HashMap<String, List<JcBillPhoto>>();
|
||||
|
||||
Map<String, List<JcBillPhoto>> map = billPhotos.stream()
|
||||
.collect(Collectors.groupingBy(e -> {
|
||||
return e.getTypephoto() + "#" + e.getSrcitemid();
|
||||
},
|
||||
Collectors.collectingAndThen(Collectors.toList(), value -> value)
|
||||
));
|
||||
|
||||
return map;
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
LOG.error("服务异常", e.getMessage());
|
||||
throw new RuntimeException("服务异常:", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional(isolation = Isolation.DEFAULT, propagation = Propagation.REQUIRED, rollbackFor = {Exception.class})
|
||||
@Override
|
||||
public ApiReqJcBill saveApiReqJcBill(ApiReqJcBill reqJcBill, JcBill jcBill, List<JcBillSourceItem> createItems)
|
||||
throws RuntimeException {
|
||||
try {
|
||||
|
||||
List<JcBillSourceItem> tempItems = jcBillSourceItemRepository.saveAll(createItems);
|
||||
|
||||
// Map<String, JcBillSourceItem> map = tempItems.stream()
|
||||
// .collect(Collectors.groupingBy(e -> {
|
||||
// return String.valueOf(e.getIndexno()) + e.getGoodsid();
|
||||
// },
|
||||
// Collectors.collectingAndThen(Collectors.toList(), value -> value.get(0))
|
||||
// ));
|
||||
|
||||
// 新增
|
||||
List<JcBillPhoto> createPhoto = new ArrayList<JcBillPhoto>();
|
||||
if(reqJcBill.getItems() != null && reqJcBill.getItems().size() >= 1) {
|
||||
JcBillPhoto fkPhoto = null;
|
||||
JcBillPhoto hpPhoto = null;
|
||||
for(ApiReqJcBillItem item : reqJcBill.getItems()) {
|
||||
|
||||
// 付款图
|
||||
if(item.getPaymentPhoto() != null && item.getPaymentPhoto().size() >= 1) {
|
||||
for(String urlphoto : item.getPaymentPhoto()) {
|
||||
fkPhoto = new JcBillPhoto();
|
||||
fkPhoto.setSrcid(jcBill.getId());
|
||||
fkPhoto.setSrcitemid(String.valueOf(item.getIndexno()));
|
||||
fkPhoto.setTypephoto(JcBillPhoto.JC_FK);
|
||||
fkPhoto.setUrlphoto(urlphoto);
|
||||
|
||||
createPhoto.add(fkPhoto);
|
||||
}
|
||||
}
|
||||
|
||||
for(ApiReqJcBillGoodsPhoto photo : item.getGoodsPhotos()) {
|
||||
// 货品图
|
||||
if(item.getGoodsPhotos() != null && item.getGoodsPhotos().size() >= 1) {
|
||||
for(String urlphoto : photo.getGoodsPhotos()) {
|
||||
hpPhoto = new JcBillPhoto();
|
||||
hpPhoto.setSrcid(jcBill.getId());
|
||||
hpPhoto.setSrcitemid(String.valueOf(item.getIndexno()) + "#" + photo.getGoodsid());
|
||||
hpPhoto.setTypephoto(JcBillPhoto.JC_HP);
|
||||
hpPhoto.setUrlphoto(urlphoto);
|
||||
|
||||
createPhoto.add(hpPhoto);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 删除图片
|
||||
jcBillAccess.deleteJcBillPhoto(jcBill.getId(), null, JcBillPhoto.JC_FK);
|
||||
jcBillAccess.deleteJcBillPhoto(jcBill.getId(), null, JcBillPhoto.JC_HP);
|
||||
|
||||
jcBillPhotoRepository.saveAll(createPhoto);
|
||||
|
||||
jcBillRepository.save(jcBill);
|
||||
|
||||
return reqJcBill;
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
LOG.error("服务异常", e.getMessage());
|
||||
throw new RuntimeException("服务异常:", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional(isolation = Isolation.DEFAULT, propagation = Propagation.REQUIRED, rollbackFor = {Exception.class})
|
||||
@Override
|
||||
public ApiReqJcBill updateApiReqJcBill(ApiReqJcBill reqJcBill, JcBill jcBill, List<JcBillSourceItem> createItems,
|
||||
List<JcBillSourceItem> updateItems) throws RuntimeException {
|
||||
try {
|
||||
|
||||
// Map<String, JcBillSourceItem> map = tempItems.stream()
|
||||
// .collect(Collectors.groupingBy(e -> {
|
||||
// return String.valueOf(e.getIndexno()) + e.getGoodsid();
|
||||
// },
|
||||
// Collectors.collectingAndThen(Collectors.toList(), value -> value.get(0))
|
||||
// ));
|
||||
|
||||
// 新增
|
||||
List<JcBillPhoto> createPhoto = new ArrayList<JcBillPhoto>();
|
||||
if(reqJcBill.getItems() != null && reqJcBill.getItems().size() >= 1) {
|
||||
JcBillPhoto fkPhoto = null;
|
||||
JcBillPhoto hpPhoto = null;
|
||||
for(ApiReqJcBillItem item : reqJcBill.getItems()) {
|
||||
|
||||
// 付款图
|
||||
if(item.getPaymentPhoto() != null && item.getPaymentPhoto().size() >= 1) {
|
||||
for(String urlphoto : item.getPaymentPhoto()) {
|
||||
fkPhoto = new JcBillPhoto();
|
||||
fkPhoto.setSrcid(jcBill.getId());
|
||||
fkPhoto.setSrcitemid(String.valueOf(item.getIndexno()));
|
||||
fkPhoto.setTypephoto(JcBillPhoto.JC_FK);
|
||||
fkPhoto.setUrlphoto(urlphoto);
|
||||
|
||||
createPhoto.add(fkPhoto);
|
||||
}
|
||||
}
|
||||
|
||||
for(ApiReqJcBillGoodsPhoto photo : item.getGoodsPhotos()) {
|
||||
// 货品图
|
||||
if(item.getGoodsPhotos() != null && item.getGoodsPhotos().size() >= 1) {
|
||||
for(String urlphoto : photo.getGoodsPhotos()) {
|
||||
hpPhoto = new JcBillPhoto();
|
||||
hpPhoto.setSrcid(jcBill.getId());
|
||||
hpPhoto.setSrcitemid(String.valueOf(item.getIndexno()) + "#" + photo.getGoodsid());
|
||||
hpPhoto.setTypephoto(JcBillPhoto.JC_HP);
|
||||
hpPhoto.setUrlphoto(urlphoto);
|
||||
|
||||
createPhoto.add(hpPhoto);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 删除图片
|
||||
jcBillAccess.deleteJcBillPhoto(jcBill.getId(), null, JcBillPhoto.JC_FK);
|
||||
jcBillAccess.deleteJcBillPhoto(jcBill.getId(), null, JcBillPhoto.JC_HP);
|
||||
|
||||
jcBillSourceItemRepository.deleteByBillid(jcBill.getId());
|
||||
|
||||
jcBillRepository.deleteById(jcBill.getId());
|
||||
|
||||
List<JcBillSourceItem> tempItems = jcBillSourceItemRepository.saveAll(createItems);
|
||||
|
||||
jcBillPhotoRepository.saveAll(createPhoto);
|
||||
|
||||
jcBillRepository.save(jcBill);
|
||||
|
||||
return reqJcBill;
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
LOG.error("服务异常", e.getMessage());
|
||||
throw new RuntimeException("服务异常:", e);
|
||||
}
|
||||
}
|
||||
|
||||
/*@Transactional(isolation = Isolation.DEFAULT, propagation = Propagation.REQUIRED, rollbackFor = {Exception.class})
|
||||
@Override
|
||||
public ApiReqJcBill updateApiReqJcBill(ApiReqJcBill reqJcBill, JcBill jcBill, List<JcBillSourceItem> createItems,
|
||||
List<JcBillSourceItem> updateItems) throws RuntimeException {
|
||||
try {
|
||||
|
||||
List<JcBillSourceItem> tempItems = jcBillSourceItemRepository.saveAll(createItems);
|
||||
|
||||
// Map<String, JcBillSourceItem> map = tempItems.stream()
|
||||
// .collect(Collectors.groupingBy(e -> {
|
||||
// return String.valueOf(e.getIndexno());
|
||||
// },
|
||||
// Collectors.collectingAndThen(Collectors.toList(), value -> value.get(0))
|
||||
// ));
|
||||
|
||||
// 新增
|
||||
List<JcBillPhoto> createPhoto = new ArrayList<JcBillPhoto>();
|
||||
// 修改
|
||||
List<JcBillPhoto> updatePhoto = new ArrayList<JcBillPhoto>();
|
||||
|
||||
if(reqJcBill.getItems() != null && reqJcBill.getItems().size() >= 1) {
|
||||
JcBillPhoto fkPhoto = null;
|
||||
JcBillPhoto hpPhoto = null;
|
||||
for(ApiReqJcBillItem item : reqJcBill.getItems()) {
|
||||
|
||||
// 付款图
|
||||
if(item.getPaymentPhoto() != null && item.getPaymentPhoto().size() >= 1) {
|
||||
for(String urlphoto : item.getPaymentPhoto()) {
|
||||
fkPhoto = new JcBillPhoto();
|
||||
fkPhoto.setSrcid(jcBill.getId());
|
||||
fkPhoto.setSrcitemid(String.valueOf(item.getIndexno()));
|
||||
fkPhoto.setTypephoto(JcBillPhoto.JC_FK);
|
||||
fkPhoto.setUrlphoto(urlphoto);
|
||||
|
||||
createPhoto.add(fkPhoto);
|
||||
}
|
||||
}
|
||||
|
||||
for(ApiReqJcBillGoodsPhoto photo : item.getGoodsPhotos()) {
|
||||
// 货品图
|
||||
if(item.getGoodsPhotos() != null && item.getGoodsPhotos().size() >= 1) {
|
||||
for(String urlphoto : photo.getGoodsPhotos()) {
|
||||
hpPhoto = new JcBillPhoto();
|
||||
hpPhoto.setSrcid(jcBill.getId());
|
||||
hpPhoto.setSrcitemid(String.valueOf(item.getIndexno()) + "#" + photo.getGoodsid());
|
||||
hpPhoto.setTypephoto(JcBillPhoto.JC_HP);
|
||||
hpPhoto.setUrlphoto(urlphoto);
|
||||
|
||||
createPhoto.add(hpPhoto);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 删除图片
|
||||
// for(JcBillPhoto photo : createPhoto) {
|
||||
// jcBillAccess.deleteJcBillPhoto(photo.getSrcid(), photo.getSrcitemid(), photo.getTypephoto());
|
||||
// }
|
||||
jcBillAccess.deleteJcBillPhoto(jcBill.getId(), null, JcBillPhoto.JC_FK);
|
||||
jcBillAccess.deleteJcBillPhoto(jcBill.getId(), null, JcBillPhoto.JC_HP);
|
||||
|
||||
jcBillPhotoRepository.saveAll(createPhoto);
|
||||
|
||||
jcBillAccess.updateJcBill(jcBill);
|
||||
|
||||
jcBillAccess.updateJcBillSourceItem(updateItems);
|
||||
|
||||
List<JcBillSourceItem> itemsLogs = new ArrayList<JcBillSourceItem>();
|
||||
itemsLogs.addAll(tempItems);
|
||||
itemsLogs.addAll(updateItems);
|
||||
|
||||
List<JcBillPhoto> photoLogs = new ArrayList<JcBillPhoto>();
|
||||
photoLogs.addAll(createPhoto);
|
||||
photoLogs.addAll(updatePhoto);
|
||||
|
||||
操作日志
|
||||
OperationLog log = new OperationLog("api_jc_bill", jcBill.getId(), "更新", "", "",
|
||||
JSONObject.toJSONString(jcBill) + JSONArray.toJSONString(itemsLogs) + JSONArray.toJSONString(photoLogs));
|
||||
log.setOperator(jcBill.getApplicant());
|
||||
log.setOperatorName(jcBill.getApplicantname());
|
||||
BusinessESUtil.checkService(this.operationLogService).saveOperationLog(log);
|
||||
|
||||
return reqJcBill;
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
LOG.error("服务异常", e.getMessage());
|
||||
throw new RuntimeException("服务异常:", e);
|
||||
}
|
||||
}*/
|
||||
|
||||
@Override
|
||||
public int countJcBillItemIndexno(String billId) throws RuntimeException {
|
||||
try {
|
||||
return jcBillAccess.countJcBillItemIndexno(billId);
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
LOG.error("服务异常", e.getMessage());
|
||||
throw new RuntimeException("服务异常:", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public JcBill queryJcBillById(String billId) throws RuntimeException {
|
||||
try {
|
||||
Optional<JcBill> optional = jcBillRepository.findById(billId);
|
||||
|
||||
return optional.isPresent() ? optional.get() : null;
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
LOG.error("服务异常", e.getMessage());
|
||||
throw new RuntimeException("服务异常:", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JcBillSourceItem> queryJcBillSourceItemByBillId(String billId) throws RuntimeException {
|
||||
try {
|
||||
List<JcBillSourceItem> list = jcBillSourceItemRepository.findByBillid(billId);
|
||||
|
||||
return (list != null && list.size() >= 1) ? list : null;
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
LOG.error("服务异常", e.getMessage());
|
||||
throw new RuntimeException("服务异常:", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public JcBillSourceItem queryJcBillSourceItembyId(Long id) throws RuntimeException {
|
||||
try {
|
||||
|
||||
Optional<JcBillSourceItem> optional = jcBillSourceItemRepository.findById(id);
|
||||
|
||||
return optional.isPresent() ? optional.get() : new JcBillSourceItem();
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
LOG.error("服务异常", e.getMessage());
|
||||
throw new RuntimeException("服务异常:", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional(isolation = Isolation.DEFAULT, propagation = Propagation.REQUIRED, rollbackFor = {Exception.class})
|
||||
@Override
|
||||
public void updateStatusJcBill(JcBill jcBill, int oldStatus) throws RuntimeException {
|
||||
try {
|
||||
jcBillRepository.save(jcBill);
|
||||
|
||||
// jcBillSourceItemRepository.saveAll(sourceItems);
|
||||
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
LOG.error("服务异常", e.getMessage());
|
||||
throw new RuntimeException("服务异常:", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<ApiJcBillHgSearchItem> queryApiJcBillHgSearchItem(String keyword, String employee, String status, Pageable pageable)
|
||||
throws RuntimeException {
|
||||
try {
|
||||
return this.apiJcBillAccess.queryApiJcBillHgSearchItem(keyword, employee, status, pageable);
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
LOG.error("服务异常", e.getMessage());
|
||||
throw new RuntimeException("服务异常:", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, JcBillCount> queryJcBillCount(List<String> ids) throws RuntimeException {
|
||||
try {
|
||||
|
||||
if(ids != null && ids.size() >= 1) {
|
||||
List<JcBillCount> counts = apiJcBillAccess.queryJcBillCount(ids);
|
||||
|
||||
if(counts == null) return new HashMap<String, JcBillCount>();
|
||||
|
||||
Map<String, JcBillCount> map = counts.stream()
|
||||
.collect(Collectors.groupingBy(e -> {
|
||||
return e.getId();
|
||||
},
|
||||
Collectors.collectingAndThen(Collectors.toList(), value -> value.get(0))
|
||||
));
|
||||
|
||||
return map;
|
||||
} else {
|
||||
return new HashMap<String, JcBillCount>();
|
||||
}
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
LOG.error("服务异常", e.getMessage());
|
||||
throw new RuntimeException("服务异常:", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ApiBillHg queryApiBillHgById(String hgId) throws RuntimeException {
|
||||
try {
|
||||
return this.apiJcBillAccess.queryApiBillHgById(hgId);
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
LOG.error("服务异常", e.getMessage());
|
||||
throw new RuntimeException("服务异常:", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ApiBillHgItem> queryApiBillHgItemByHgId(String hgId) throws RuntimeException {
|
||||
try {
|
||||
return this.apiJcBillAccess.queryApiBillHgItemByHgId(hgId);
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
LOG.error("服务异常", e.getMessage());
|
||||
throw new RuntimeException("服务异常:", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ApiBillHgPayment> queryApiBillHgPaymentByHgId(String hgId) throws RuntimeException {
|
||||
try {
|
||||
return this.apiJcBillAccess.queryApiBillHgPaymentByHgId(hgId);
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
LOG.error("服务异常", e.getMessage());
|
||||
throw new RuntimeException("服务异常:", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public JcBillHg queryJcBillHg(String billHg) throws RuntimeException {
|
||||
try {
|
||||
Optional<JcBillHg> optional = jcBillHgRepository.findById(billHg);
|
||||
|
||||
return optional.isPresent() ? optional.get() : null;
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
LOG.error("服务异常", e.getMessage());
|
||||
throw new RuntimeException("服务异常:", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional(isolation = Isolation.DEFAULT, propagation = Propagation.REQUIRED, rollbackFor = {Exception.class})
|
||||
@Override
|
||||
public void updateJcBillHg(JcBillHg entity, List<JcBillHgPay> pays) throws RuntimeException {
|
||||
try {
|
||||
jcBillHgRepository.save(entity);
|
||||
|
||||
jcBillHgPayRepository.saveAll(pays);
|
||||
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
LOG.error("服务异常", e.getMessage());
|
||||
throw new RuntimeException("服务异常:", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public JcBillPhoto queryJcBillPhoto(String srcid, String srcitemid, String typephoto) throws RuntimeException {
|
||||
try {
|
||||
return jcBillPhotoRepository.findBySrcidAndSrcitemidAndTypephoto(srcid, srcitemid, typephoto);
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
LOG.error("服务异常", e.getMessage());
|
||||
throw new RuntimeException("服务异常:", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JcBillPhoto> queryJcBillPhoto(String srcid, String typephoto) throws RuntimeException {
|
||||
try {
|
||||
return jcBillAccess.queryJcBillPhoto(srcid, null, typephoto);
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
LOG.error("服务异常", e.getMessage());
|
||||
throw new RuntimeException("服务异常:", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional(isolation = Isolation.DEFAULT, propagation = Propagation.REQUIRED, rollbackFor = {Exception.class})
|
||||
@Override
|
||||
public void saveAndDeletePhoto(List<JcBillPhoto> photos, JcBillHg billHg) throws RuntimeException {
|
||||
try {
|
||||
|
||||
for(JcBillPhoto photo : photos) {
|
||||
jcBillPhotoRepository.deleteBySrcidAndSrcitemidAndTypephoto(photo.getSrcid(), photo.getSrcitemid(), photo.getTypephoto());
|
||||
}
|
||||
|
||||
jcBillPhotoRepository.saveAll(photos);
|
||||
|
||||
jcBillHgRepository.save(billHg);
|
||||
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
LOG.error("服务异常", e.getMessage());
|
||||
throw new RuntimeException("服务异常:", e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Transactional(isolation = Isolation.DEFAULT, propagation = Propagation.REQUIRED, rollbackFor = {Exception.class})
|
||||
@Override
|
||||
public void saveAndDeletePhoto(List<JcBillPhoto> photos, String billId) throws RuntimeException {
|
||||
try {
|
||||
|
||||
jcBillPhotoRepository.saveAll(photos);
|
||||
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
LOG.error("服务异常", e.getMessage());
|
||||
throw new RuntimeException("服务异常:", e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String lastBillHgId() throws RuntimeException {
|
||||
try {
|
||||
return jcBillAccess.lastBillHgId();
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
LOG.error("服务异常", e.getMessage());
|
||||
throw new RuntimeException("服务异常:", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JcCodeFlow> queryJcCodeFlow(List<String> codes) throws RuntimeException {
|
||||
try {
|
||||
List<JcCodeFlow> flows = apiJcBillAccess.queryJcCodeFlow(codes);
|
||||
|
||||
if(flows == null) return null;
|
||||
|
||||
// Map<String, JcCodeFlow> map = flows.stream()
|
||||
// .collect(Collectors.groupingBy(e -> {
|
||||
// return e.getCode();
|
||||
// },
|
||||
// Collectors.collectingAndThen(Collectors.toList(), value -> value.get(0))
|
||||
// ));
|
||||
|
||||
return flows;
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
LOG.error("服务异常", e.getMessage());
|
||||
throw new RuntimeException("服务异常:", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JcSourceItem> queryJcSourceItemByBillId(String billId) throws RuntimeException {
|
||||
try {
|
||||
return jcBillAccess.queryJcSourceItemByBillId(billId);
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
LOG.error("服务异常", e.getMessage());
|
||||
throw new RuntimeException("服务异常:", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional(isolation = Isolation.DEFAULT, propagation = Propagation.REQUIRED, rollbackFor = {Exception.class})
|
||||
@Override
|
||||
public void saveJcSourceItem(List<JcBillSourceItem> items, List<JcSourceItem> sourceItems, JcBill jcBill) throws RuntimeException {
|
||||
try {
|
||||
|
||||
jcBillAccess.deleteJcSourceItemBySource(jcBill.getId());
|
||||
|
||||
if(sourceItems != null && sourceItems.size() >= 1) jcSourceItemRepository.saveAll(sourceItems);
|
||||
|
||||
jcBillSourceItemRepository.saveAll(items);
|
||||
|
||||
boolean flag = true;
|
||||
for(JcBillSourceItem item : items) {
|
||||
if(item.getStatus() == 0 && item.getStatus() == -2) flag = false;
|
||||
}
|
||||
if(flag)jcBill.setStatus(JcBill.STATUS_ONE);
|
||||
|
||||
jcBillRepository.save(jcBill);
|
||||
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
LOG.error("服务异常", e.getMessage());
|
||||
throw new RuntimeException("服务异常:", e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public JcBillPhoto queryJcBillPhotoById(String id) throws RuntimeException {
|
||||
try {
|
||||
Optional<JcBillPhoto> optional = jcBillPhotoRepository.findById(Long.parseLong(id));
|
||||
|
||||
return optional.isPresent() ? optional.get() : null;
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
LOG.error("服务异常", e.getMessage());
|
||||
throw new RuntimeException("服务异常:", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional(isolation = Isolation.DEFAULT, propagation = Propagation.REQUIRED, rollbackFor = {Exception.class})
|
||||
@Override
|
||||
public void deleteJcBillPhotoById(JcBillPhoto entity) throws RuntimeException {
|
||||
try {
|
||||
jcBillPhotoRepository.delete(entity);
|
||||
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
LOG.error("服务异常", e.getMessage());
|
||||
throw new RuntimeException("服务异常:", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional(isolation = Isolation.DEFAULT, propagation = Propagation.REQUIRED, rollbackFor = {Exception.class})
|
||||
@Override
|
||||
public void deleteJcSourceItem(String billid, String itemid) throws RuntimeException {
|
||||
try {
|
||||
Optional<JcBillSourceItem> optional = jcBillSourceItemRepository.findById(Long.parseLong(itemid));
|
||||
|
||||
if(optional.isPresent()) {
|
||||
JcBillSourceItem item = optional.get();
|
||||
|
||||
jcBillAccess.deleteJcBillPhoto(billid, String.valueOf(item.getIndexno()), JcBillPhoto.JC_FK);
|
||||
|
||||
jcBillAccess.deleteJcBillPhoto(billid, item.getIndexno() + "#" + item.getGoodsid(), JcBillPhoto.JC_HP);
|
||||
|
||||
jcBillSourceItemRepository.delete(item);
|
||||
}
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
LOG.error("服务异常", e.getMessage());
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ApiBillHgPayment> queryApiBillHgPaymentByHgId(List<String> hgIds) throws RuntimeException {
|
||||
try {
|
||||
return this.apiJcBillAccess.queryApiBillHgPaymentByHgId(hgIds);
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
LOG.error("服务异常", e.getMessage());
|
||||
throw new RuntimeException("服务异常:", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBaiduToken() throws RuntimeException {
|
||||
return jcBillAccess.getBaiduToken();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JcProduct> queryJcProduct(String product, String stockInId, String hgId) throws RuntimeException {
|
||||
try {
|
||||
return this.apiJcBillAccess.queryJcProduct(product, stockInId, hgId);
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
LOG.error("服务异常", e.getMessage());
|
||||
throw new RuntimeException("服务异常:", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, List<JcProductBillSouce>> queryJcProductBillSouce(List<String> billIds) throws RuntimeException {
|
||||
try {
|
||||
List<JcProductBillSouce> billPhotos = apiJcBillAccess.queryJcProductBillSouce(billIds);
|
||||
|
||||
if(billPhotos == null) return new HashMap<String, List<JcProductBillSouce>>();
|
||||
|
||||
Map<String, List<JcProductBillSouce>> map = billPhotos.stream()
|
||||
.collect(Collectors.groupingBy(e -> {
|
||||
return e.getBillid() + e.getAccount() + e.getProduct();
|
||||
},
|
||||
Collectors.collectingAndThen(Collectors.toList(), value -> value)
|
||||
));
|
||||
|
||||
return map;
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
LOG.error("服务异常", e.getMessage());
|
||||
throw new RuntimeException("服务异常:", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JcProduct> queryJcProduct(String product, String stockInId) throws RuntimeException {
|
||||
try {
|
||||
return this.apiJcBillAccess.queryJcProduct(product, stockInId);
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
LOG.error("服务异常", e.getMessage());
|
||||
throw new RuntimeException("服务异常:", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateStatusByJcBill(JcBill jcBill, int status) throws RuntimeException {
|
||||
try {
|
||||
|
||||
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
LOG.error("服务异常", e.getMessage());
|
||||
throw new RuntimeException("服务异常:", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JcBillHg> qeryJcBillHgs(List<String> billids) throws RuntimeException {
|
||||
try {
|
||||
return apiJcBillAccess.qeryJcBillHgs(billids);
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
LOG.error("服务异常", e.getMessage());
|
||||
throw new RuntimeException("服务异常:", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public JcBillInItem queryJcBillInItemById(Long id) throws RuntimeException {
|
||||
try {
|
||||
|
||||
Optional<JcBillInItem> optional = jcBillInItemRepository.findById(id);
|
||||
|
||||
return optional.isPresent() ? optional.get() : new JcBillInItem();
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
LOG.error("服务异常", e.getMessage());
|
||||
throw new RuntimeException("服务异常:", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
+547
@@ -0,0 +1,547 @@
|
||||
package abacus.springboot.example.esb;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.abacus.xpos.foundation.dao.Employee;
|
||||
import com.abacus.xpos.foundation.pubs.DaoIdGenerator;
|
||||
import com.abacus.xpos.foundation.wsi.EmployeeServiceIF;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
|
||||
import abacus.commons.exception.BusinessException;
|
||||
import abacus.springboot.example.api.view.ApiReqJcBill;
|
||||
import abacus.springboot.example.api.view.ApiReqJcBillGoodsPhoto;
|
||||
import abacus.springboot.example.api.view.ApiReqJcBillItem;
|
||||
import abacus.springboot.example.api.view.ApiRespJcPorduct;
|
||||
import abacus.springboot.example.api.view.ApiRespJcPorductAcount;
|
||||
import abacus.springboot.example.api.view.ApiRespJcPorductItem;
|
||||
import abacus.springboot.example.api.view.ApiRespJcPorductProduct;
|
||||
import abacus.springboot.example.api.view.JcProduct;
|
||||
import abacus.springboot.example.api.view.JcProductBillSouce;
|
||||
import abacus.springboot.example.dao.JcBill;
|
||||
import abacus.springboot.example.dao.JcBillPhoto;
|
||||
import abacus.springboot.example.dao.JcBillSourceItem;
|
||||
import abacus.springboot.example.wsi.ApiJcBillServiceIF;
|
||||
|
||||
/**
|
||||
* <p>Title:JcBillBizService</p>
|
||||
<p>Description: 稽查单业务编排(原内聚于 Controller 的私有方法,按 5 层 DAG 下沉到 esb)</p>
|
||||
@author chuanZeng
|
||||
@date 2026年8月18日
|
||||
*/
|
||||
@Service
|
||||
public class JcBillBizService {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(JcBillBizService.class);
|
||||
|
||||
@Autowired
|
||||
private ApiJcBillServiceIF apiJcBillService;
|
||||
|
||||
@Autowired
|
||||
private DaoIdGenerator jcBillIdGenerator;
|
||||
|
||||
@Autowired
|
||||
private EmployeeServiceIF employeeService;
|
||||
|
||||
/**
|
||||
* 稽查收货主单保存逻辑
|
||||
* @param reqJcBill
|
||||
* @throws Exception
|
||||
*/
|
||||
public void saveJcBill(ApiReqJcBill reqJcBill) throws Exception{
|
||||
try {
|
||||
|
||||
// 稽查单号
|
||||
String billId = jcBillIdGenerator.takeDaoId(null);
|
||||
|
||||
reqJcBill.setId(billId);
|
||||
|
||||
// 明细
|
||||
List<ApiReqJcBillItem> items = reqJcBill.getItems();
|
||||
|
||||
// 解析明细
|
||||
// 新增明细
|
||||
List<JcBillSourceItem> createItems = new ArrayList<JcBillSourceItem>();
|
||||
|
||||
// 汇总数量
|
||||
BigDecimal quantityBig = new BigDecimal("0");
|
||||
// 汇总金额
|
||||
BigDecimal subtotalBig = new BigDecimal("0");
|
||||
|
||||
if(items != null && items.size() >= 1) {
|
||||
int indexno = 0;
|
||||
for(ApiReqJcBillItem item : items) {
|
||||
|
||||
Double quantity = item.getQuantity();
|
||||
if(quantity == null) throw new BusinessException("收货数量为空!");
|
||||
if(quantity <= 0) throw new BusinessException("收货数量不能小于等于0!");
|
||||
|
||||
Double numbers = item.getNumbers();
|
||||
if(numbers == null) throw new BusinessException("收货件数为空!");
|
||||
if(numbers <= 0) throw new BusinessException("收货件数不能小于等于0!");
|
||||
|
||||
Double price = item.getPrice();
|
||||
if(price == null) throw new BusinessException("价格为空!");
|
||||
if(price <= 0) throw new BusinessException("价格不能小于等于0!");
|
||||
|
||||
Double subtotal = item.getSubtotal();
|
||||
if(subtotal == null) throw new BusinessException("金额为空!");
|
||||
if(subtotal <= 0) throw new BusinessException("金额不能小于等于0!");
|
||||
|
||||
item.setIndexno(++indexno);
|
||||
createItems.addAll(saveJcBillItem(billId, item));
|
||||
|
||||
if(item.getQuantity() != null ) quantityBig = quantityBig.add(new BigDecimal(String.valueOf(item.getQuantity())));
|
||||
|
||||
if(item.getSubtotal() != null ) subtotalBig = subtotalBig.add(new BigDecimal(String.valueOf(item.getSubtotal())));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Employee emp = employeeService.getEmployee(reqJcBill.getApplicant());
|
||||
if(emp == null) throw new BusinessException("申请人不存在!");
|
||||
|
||||
// 主单对象
|
||||
JcBill jcBill = new JcBill();
|
||||
jcBill.setId(billId);
|
||||
jcBill.setStatus(JcBill.STATUS_ZERO);
|
||||
jcBill.setGoods(reqJcBill.getGoods());
|
||||
jcBill.setWarehouse(reqJcBill.getWarehouse());
|
||||
jcBill.setWarehousename(reqJcBill.getWarehousename());
|
||||
jcBill.setReceivedt(reqJcBill.getReceivedt());
|
||||
jcBill.setQuantity(quantityBig.doubleValue());
|
||||
jcBill.setSubtotal(subtotalBig.doubleValue());
|
||||
jcBill.setApplicant(reqJcBill.getApplicant());
|
||||
jcBill.setApplicantname(reqJcBill.getApplicantname());
|
||||
jcBill.setDept(emp.getDept().getId());
|
||||
jcBill.setApplicantdt(new Date());
|
||||
|
||||
apiJcBillService.saveApiReqJcBill(reqJcBill, jcBill, createItems);
|
||||
} catch(Throwable e){
|
||||
LOG.error(e.getMessage(), e);
|
||||
e.printStackTrace();
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 稽查收货明细保存逻辑
|
||||
* @param item
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<JcBillSourceItem> saveJcBillItem(String billId, ApiReqJcBillItem item) throws Exception{
|
||||
try {
|
||||
BigDecimal numbersBig = new BigDecimal(String.valueOf(item.getNumbers()));
|
||||
BigDecimal qunantiyBig = new BigDecimal(String.valueOf(item.getQuantity()));
|
||||
BigDecimal bigprice = new BigDecimal(String.valueOf(item.getPrice()));
|
||||
|
||||
// 余数
|
||||
double yus = item.getQuantity() % item.getNumbers();
|
||||
|
||||
// 瓶数
|
||||
BigDecimal qunantiyInt = qunantiyBig.divide(numbersBig, BigDecimal.ROUND_DOWN).setScale(0, BigDecimal.ROUND_DOWN);
|
||||
|
||||
// 金额
|
||||
BigDecimal bigAmount = bigprice.multiply(new BigDecimal(String.valueOf(item.getQuantity())));
|
||||
double subtotal = bigAmount.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
|
||||
|
||||
List<JcBillSourceItem> sourceItems = new ArrayList<JcBillSourceItem>();
|
||||
JcBillSourceItem sourceItem = null;
|
||||
for(int i = 0; i < item.getGoodsPhotos().size(); i++) {
|
||||
|
||||
ApiReqJcBillGoodsPhoto photo = item.getGoodsPhotos().get(i);
|
||||
|
||||
sourceItem = new JcBillSourceItem();
|
||||
sourceItem.setBillid(billId);
|
||||
sourceItem.setIndexno(item.getIndexno());
|
||||
sourceItem.setStatus(0);
|
||||
sourceItem.setRecsource(item.getRecsource());
|
||||
sourceItem.setRecplatform(item.getRecplatform());
|
||||
sourceItem.setChannel(item.getChannel());
|
||||
sourceItem.setPrice(item.getPrice());
|
||||
|
||||
if(i == (item.getGoodsPhotos().size() - 1)) {
|
||||
sourceItem.setQuantity(qunantiyInt.doubleValue() + yus);
|
||||
} else {
|
||||
sourceItem.setQuantity(qunantiyInt.doubleValue());
|
||||
}
|
||||
|
||||
sourceItem.setNumbers(1);
|
||||
sourceItem.setSubtotal(subtotal);
|
||||
|
||||
sourceItem.setGoodsid(photo.getGoodsid());
|
||||
sourceItem.setLogisticsid(photo.getLogisticsid());
|
||||
sourceItems.add(sourceItem);
|
||||
}
|
||||
return sourceItems;
|
||||
} catch(Throwable e){
|
||||
LOG.error(e.getMessage(), e);
|
||||
e.printStackTrace();
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 稽查收货主单修改逻辑
|
||||
* @param reqJcBill
|
||||
* @throws Exception
|
||||
*/
|
||||
public void updateJcbill(ApiReqJcBill reqJcBill) throws Exception{
|
||||
try {
|
||||
|
||||
// 稽查单号
|
||||
String billId = reqJcBill.getId();
|
||||
|
||||
// 明细
|
||||
List<ApiReqJcBillItem> items = reqJcBill.getItems();
|
||||
|
||||
// 解析明细
|
||||
// 新增明细
|
||||
List<JcBillSourceItem> createItems = new ArrayList<JcBillSourceItem>();
|
||||
// 修改明细
|
||||
List<JcBillSourceItem> updateItems = new ArrayList<JcBillSourceItem>();
|
||||
|
||||
// 汇总数量
|
||||
BigDecimal quantityBig = new BigDecimal("0");
|
||||
// 汇总金额
|
||||
BigDecimal subtotalBig = new BigDecimal("0");
|
||||
|
||||
/*if(items != null && items.size() >= 1) {
|
||||
int indexno = apiJcBillService.countJcBillItemIndexno(billId);
|
||||
for(ApiReqJcBillItem item : items) {
|
||||
if(item.getId() == null) {
|
||||
|
||||
item.setIndexno(++indexno);
|
||||
createItems.addAll(saveJcBillItem(billId, item));
|
||||
} else {
|
||||
|
||||
updateItems.addAll(updateJcbillItem(billId, item));
|
||||
}
|
||||
|
||||
if(item.getQuantity() != null ) quantityBig = quantityBig.add(new BigDecimal(String.valueOf(item.getQuantity())));
|
||||
|
||||
if(item.getSubtotal() != null ) subtotalBig = subtotalBig.add(new BigDecimal(String.valueOf(item.getSubtotal())));
|
||||
}
|
||||
}*/
|
||||
if(items != null && items.size() >= 1) {
|
||||
int indexno = 0;
|
||||
for(ApiReqJcBillItem item : items) {
|
||||
|
||||
Double quantity = item.getQuantity();
|
||||
if(quantity == null) throw new BusinessException("收货数量为空!");
|
||||
if(quantity <= 0) throw new BusinessException("收货数量不能小于等于0!");
|
||||
|
||||
Double numbers = item.getNumbers();
|
||||
if(numbers == null) throw new BusinessException("收货件数为空!");
|
||||
if(numbers <= 0) throw new BusinessException("收货件数不能小于等于0!");
|
||||
|
||||
Double price = item.getPrice();
|
||||
if(price == null) throw new BusinessException("价格为空!");
|
||||
if(price <= 0) throw new BusinessException("价格不能小于等于0!");
|
||||
|
||||
Double subtotal = item.getSubtotal();
|
||||
if(subtotal == null) throw new BusinessException("金额为空!");
|
||||
if(subtotal <= 0) throw new BusinessException("金额不能小于等于0!");
|
||||
|
||||
item.setIndexno(++indexno);
|
||||
createItems.addAll(saveJcBillItem(billId, item));
|
||||
|
||||
if(item.getQuantity() != null ) quantityBig = quantityBig.add(new BigDecimal(String.valueOf(item.getQuantity())));
|
||||
|
||||
if(item.getSubtotal() != null ) subtotalBig = subtotalBig.add(new BigDecimal(String.valueOf(item.getSubtotal())));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Employee emp = employeeService.getEmployee(reqJcBill.getApplicant());
|
||||
if(emp == null) throw new BusinessException("申请人不存在!");
|
||||
|
||||
// 主单对象
|
||||
JcBill jcBill = new JcBill();
|
||||
jcBill.setId(reqJcBill.getId());
|
||||
jcBill.setStatus(JcBill.STATUS_ZERO);
|
||||
jcBill.setGoods(reqJcBill.getGoods());
|
||||
jcBill.setWarehouse(reqJcBill.getWarehouse());
|
||||
jcBill.setWarehousename(reqJcBill.getWarehousename());
|
||||
jcBill.setReceivedt(reqJcBill.getReceivedt());
|
||||
jcBill.setQuantity(quantityBig.doubleValue());
|
||||
jcBill.setSubtotal(subtotalBig.doubleValue());
|
||||
jcBill.setApplicant(reqJcBill.getApplicant());
|
||||
jcBill.setApplicantname(reqJcBill.getApplicantname());
|
||||
jcBill.setDept(emp.getDept().getId());
|
||||
jcBill.setApplicantdt(new Date());
|
||||
|
||||
apiJcBillService.updateApiReqJcBill(reqJcBill, jcBill, createItems, updateItems);
|
||||
|
||||
} catch(Throwable e){
|
||||
LOG.error(e.getMessage(), e);
|
||||
e.printStackTrace();
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 稽查收货明细修改逻辑
|
||||
* @param item
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<JcBillSourceItem> updateJcbillItem(String billId, ApiReqJcBillItem item) throws Exception{
|
||||
try {
|
||||
BigDecimal numbersBig = new BigDecimal(String.valueOf(item.getNumbers()));
|
||||
BigDecimal qunantiyBig = new BigDecimal(String.valueOf(item.getQuantity()));
|
||||
BigDecimal bigprice = new BigDecimal(String.valueOf(item.getPrice()));
|
||||
|
||||
// 余数
|
||||
double yus = item.getQuantity() % item.getNumbers();
|
||||
|
||||
// 瓶数
|
||||
BigDecimal qunantiyInt = qunantiyBig.divide(numbersBig, BigDecimal.ROUND_DOWN).setScale(0, BigDecimal.ROUND_DOWN);
|
||||
|
||||
// 金额
|
||||
BigDecimal bigAmount = bigprice.multiply(new BigDecimal(String.valueOf(item.getQuantity())));
|
||||
double subtotal = bigAmount.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
|
||||
|
||||
List<JcBillSourceItem> sourceItems = new ArrayList<JcBillSourceItem>();
|
||||
JcBillSourceItem sourceItem = null;
|
||||
for(int i = 0; i < item.getGoodsPhotos().size(); i++) {
|
||||
|
||||
ApiReqJcBillGoodsPhoto photo = item.getGoodsPhotos().get(i);
|
||||
|
||||
sourceItem = new JcBillSourceItem();
|
||||
sourceItem.setId(item.getId());
|
||||
sourceItem.setBillid(billId);
|
||||
sourceItem.setIndexno(item.getIndexno());
|
||||
sourceItem.setStatus(0);
|
||||
sourceItem.setRecsource(item.getRecsource());
|
||||
sourceItem.setRecplatform(item.getRecplatform());
|
||||
sourceItem.setChannel(item.getChannel());
|
||||
sourceItem.setPrice(item.getPrice());
|
||||
|
||||
if(i == (item.getGoodsPhotos().size() - 1)) {
|
||||
sourceItem.setQuantity(qunantiyInt.doubleValue() + yus);
|
||||
} else {
|
||||
sourceItem.setQuantity(qunantiyInt.doubleValue());
|
||||
}
|
||||
|
||||
sourceItem.setNumbers(1);
|
||||
sourceItem.setSubtotal(subtotal);
|
||||
|
||||
sourceItem.setGoodsid(photo.getGoodsid());
|
||||
sourceItem.setLogisticsid(photo.getLogisticsid());
|
||||
sourceItems.add(sourceItem);
|
||||
}
|
||||
return sourceItems;
|
||||
|
||||
// JcBillSourceItem sourceItem = new JcBillSourceItem();
|
||||
// sourceItem.setId(item.getId());
|
||||
// sourceItem.setBillid(billId);
|
||||
// sourceItem.setIndexno(item.getIndexno());
|
||||
// sourceItem.setStatus(1);
|
||||
// sourceItem.setRecsource(sourceItem.getRecsource());
|
||||
// sourceItem.setRecplatform(sourceItem.getRecplatform());
|
||||
// sourceItem.setChannel(sourceItem.getChannel());
|
||||
// sourceItem.setPrice(sourceItem.getPrice());
|
||||
// sourceItem.setQuantity(sourceItem.getQuantity());
|
||||
// sourceItem.setNumbers(sourceItem.getNumbers());
|
||||
// sourceItem.setSubtotal(sourceItem.getSubtotal());
|
||||
// sourceItem.setGoodsid(sourceItem.getGoodsid());
|
||||
// sourceItem.setLogisticsid(sourceItem.getLogisticsid());
|
||||
//
|
||||
// return sourceItem;
|
||||
} catch(Throwable e){
|
||||
LOG.error(e.getMessage(), e);
|
||||
e.printStackTrace();
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 回购单号是按回购单显示明细,以回购单号为主,解析
|
||||
* @param product
|
||||
* @param stockInId
|
||||
* @param hgId
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<ApiRespJcPorduct> hgAnalyze(String product, String stockInId, String hgId) throws Exception {
|
||||
try {
|
||||
|
||||
long time1 = System.currentTimeMillis();
|
||||
List<JcProduct> jcProducts = apiJcBillService.queryJcProduct(product, stockInId, hgId);
|
||||
LOG.info("稽查货品查询>>>回购单逻辑>>>queryJcProduct耗时>>>{}", (System.currentTimeMillis() - time1));
|
||||
|
||||
// 获取稽查单号集合
|
||||
List<String> billIds = jcProducts.stream()
|
||||
.map(JcProduct::getBillid)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
long time2 = System.currentTimeMillis();
|
||||
Map<String, List<JcProductBillSouce>> mapGoods = apiJcBillService.queryJcProductBillSouce(billIds);
|
||||
LOG.info("稽查货品查询>>>回购单逻辑>>>queryJcProductBillSouce耗时>>>{}", (System.currentTimeMillis() - time2));
|
||||
|
||||
LOG.info("稽查货品查询>>>回购单逻辑>>>按稽查单号+客户编码+商品编码,分组数据>>>{}", JSON.toJSONString(mapGoods));
|
||||
|
||||
|
||||
long time3 = System.currentTimeMillis();
|
||||
Map<String, List<JcBillPhoto>> mapPhoto = apiJcBillService.queryJcBillPhotoIn(billIds);
|
||||
LOG.info("稽查货品查询>>>回购单逻辑>>>queryJcBillPhotoIn查询耗时>>>{}", (System.currentTimeMillis() - time3));
|
||||
|
||||
// 按稽查单号+入库单号+回购单号+出库单号,分组
|
||||
Map<String, List<JcProduct>> mapProducts = jcProducts.stream()
|
||||
.collect(Collectors.groupingBy(e -> {
|
||||
return e.getBillid() + e.getBillin() + e.getBillhg() + e.getWdtbillout();
|
||||
},
|
||||
Collectors.collectingAndThen(Collectors.toList(), value -> value)
|
||||
));
|
||||
LOG.info("稽查货品查询>>>回购单逻辑>>>按稽查单号+入库单号+回购单号+出库单号,分组数据>>>{}", JSON.toJSONString(mapProducts));
|
||||
|
||||
// 客户编码汇总,同一个客户下的商品
|
||||
Map<String, List<JcProduct>> mapAccProducts = jcProducts.stream()
|
||||
.collect(Collectors.groupingBy(e -> {
|
||||
return e.getBillid() + e.getBillin() + e.getBillhg()+ e.getAccount();
|
||||
},
|
||||
Collectors.collectingAndThen(Collectors.toList(), value -> value)
|
||||
));
|
||||
LOG.info("稽查货品查询>>>回购单逻辑>>>按稽查单号+入库单号+回购单号+客户编码,分组数据>>>{}", JSON.toJSONString(mapAccProducts));
|
||||
|
||||
|
||||
long time4 = System.currentTimeMillis();
|
||||
List<ApiRespJcPorduct> respJcProducts = new ArrayList<ApiRespJcPorduct>();
|
||||
ApiRespJcPorduct respJcProduct = null;
|
||||
for(String key : mapProducts.keySet()) {
|
||||
|
||||
List<JcProduct> tempJcProducts = mapProducts.get(key);
|
||||
|
||||
JcProduct jcProduct = tempJcProducts.get(0);
|
||||
|
||||
respJcProduct = new ApiRespJcPorduct();
|
||||
if(jcProduct.getBillid() != null) respJcProduct.setBillId(jcProduct.getBillid());
|
||||
if(jcProduct.getBillin() != null) respJcProduct.setStockInId(jcProduct.getBillin());
|
||||
if(jcProduct.getBillhg() != null) respJcProduct.setHgId(jcProduct.getBillhg());
|
||||
if(jcProduct.getWdtbillout() != null) respJcProduct.setStockOutId(jcProduct.getWdtbillout());
|
||||
|
||||
List<ApiRespJcPorductAcount> accounts = new ArrayList<ApiRespJcPorductAcount>();
|
||||
ApiRespJcPorductAcount account = null;
|
||||
for(JcProduct tempJcProduct : tempJcProducts) {
|
||||
|
||||
account = new ApiRespJcPorductAcount();
|
||||
account.setAccount(tempJcProduct.getAccount());
|
||||
account.setAccountName(tempJcProduct.getAccountname());
|
||||
|
||||
String keyAccount = tempJcProduct.getBillid() + tempJcProduct.getBillin() + tempJcProduct.getBillhg() +tempJcProduct.getAccount();
|
||||
|
||||
List<JcProduct> accTempJcProducts = mapAccProducts.get(keyAccount);
|
||||
|
||||
LOG.info("稽查货品查询>>>回购单逻辑>>>按稽查单号+入库单号+回购单号+客户编码({}),汇总同一客户数据>>>{}", keyAccount, JSON.toJSONString(accTempJcProducts));
|
||||
|
||||
List<ApiRespJcPorductProduct> products = new ArrayList<ApiRespJcPorductProduct>();
|
||||
ApiRespJcPorductProduct ajproduct = null;
|
||||
for(JcProduct accJcProduct : accTempJcProducts) {
|
||||
|
||||
ajproduct = new ApiRespJcPorductProduct();
|
||||
ajproduct.setProduct(tempJcProduct.getProduct());
|
||||
ajproduct.setProductName(tempJcProduct.getProductname());
|
||||
ajproduct.setQuantity(tempJcProduct.getQuantity() + "瓶/" + tempJcProduct.getNumbers() + "件");
|
||||
|
||||
|
||||
|
||||
String keyGoods = accJcProduct.getBillid() + accJcProduct.getAccount() + accJcProduct.getProduct();
|
||||
|
||||
List<JcProductBillSouce> tempGoods = mapGoods.get(keyGoods);
|
||||
|
||||
LOG.info("稽查货品查询>>>回购单逻辑>>>按稽查单号+客户编码+商品编码({}),分组数据>>>{}", keyGoods, JSON.toJSONString(tempGoods));
|
||||
|
||||
List<ApiRespJcPorductItem> items = new ArrayList<ApiRespJcPorductItem>();
|
||||
ApiRespJcPorductItem item = null;
|
||||
for(JcProductBillSouce tempGood : tempGoods) {
|
||||
item = new ApiRespJcPorductItem();
|
||||
item.setGoodsId(tempGood.getGoodsid());
|
||||
|
||||
List<JcBillPhoto> hpts = mapPhoto.get(JcBillPhoto.JC_HP + "#" + String.valueOf(tempGood.getIndexno()) + "#" + String.valueOf(tempGood.getGoodsid()));
|
||||
List<String> hptList = new ArrayList<String>();
|
||||
if(hpts != null && hpts.size() >= 1) {
|
||||
for(JcBillPhoto hpt : hpts) {
|
||||
if(tempGood.getBillid().equals(hpt.getSrcid())) {
|
||||
hptList.add(hpt.getUrlphoto());
|
||||
}
|
||||
}
|
||||
}
|
||||
item.setPhotos(hptList);
|
||||
|
||||
items.add(item);
|
||||
/*if(StringUtils.isBlank(product)) {
|
||||
item = new ApiRespJcPorductItem();
|
||||
item.setGoodsId(tempGood.getGoodsid());
|
||||
|
||||
List<JcBillPhoto> hpts = mapPhoto.get(JcBillPhoto.JC_HP + "#" + String.valueOf(tempGood.getIndexno()) + "#" + String.valueOf(tempGood.getGoodsid()));
|
||||
List<String> hptList = new ArrayList<String>();
|
||||
if(hpts != null && hpts.size() >= 1) {
|
||||
for(JcBillPhoto hpt : hpts) {
|
||||
hptList.add(hpt.getUrlphoto());
|
||||
}
|
||||
}
|
||||
item.setPhotos(hptList);
|
||||
|
||||
items.add(item);
|
||||
} else {
|
||||
if(product.equals(tempGood.getGoodsid())) {
|
||||
item = new ApiRespJcPorductItem();
|
||||
item.setGoodsId(tempGood.getGoodsid());
|
||||
|
||||
List<JcBillPhoto> hpts = mapPhoto.get(JcBillPhoto.JC_HP + "#" + String.valueOf(tempGood.getIndexno()) + "#" + String.valueOf(tempGood.getGoodsid()));
|
||||
List<String> hptList = new ArrayList<String>();
|
||||
if(hpts != null && hpts.size() >= 1) {
|
||||
for(JcBillPhoto hpt : hpts) {
|
||||
hptList.add(hpt.getUrlphoto());
|
||||
}
|
||||
}
|
||||
item.setPhotos(hptList);
|
||||
|
||||
items.add(item);
|
||||
}
|
||||
}*/
|
||||
|
||||
}
|
||||
|
||||
if(items.size() >= 1) {
|
||||
ajproduct.setItems(items);
|
||||
|
||||
products.add(ajproduct);
|
||||
}
|
||||
}
|
||||
|
||||
if(products.size() >= 1) {
|
||||
account.setProducts(products);
|
||||
|
||||
accounts.add(account);
|
||||
}
|
||||
}
|
||||
|
||||
if(accounts.size() >= 1) {
|
||||
respJcProduct.setAccounts(accounts);
|
||||
|
||||
respJcProducts.add(respJcProduct);
|
||||
}
|
||||
}
|
||||
LOG.info("稽查货品查询>>>回购单逻辑>>>数据封装耗时>>>{}", (System.currentTimeMillis() - time4));
|
||||
|
||||
return respJcProducts;
|
||||
} catch (Exception e) {
|
||||
LOG.error(e.getMessage(), e);
|
||||
e.printStackTrace();
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+719
@@ -0,0 +1,719 @@
|
||||
package abacus.springboot.example.esb;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import org.springframework.transaction.annotation.Isolation;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
import abacus.commons.context.interceptor.UserContext;
|
||||
import abacus.commons.exception.BusinessException;
|
||||
import abacus.config.ext.AbacusExtConfig;
|
||||
import abacus.springboot.example.dao.JcBill;
|
||||
import abacus.springboot.example.dao.JcBillHg;
|
||||
import abacus.springboot.example.dao.JcBillInItem;
|
||||
import abacus.springboot.example.dao.JcBillPhoto;
|
||||
import abacus.springboot.example.dao.JcBillSourceItem;
|
||||
import abacus.springboot.example.dao.JcSourceItem;
|
||||
import abacus.springboot.example.pi.JcBillAccessIF;
|
||||
import abacus.springboot.example.repository.JcBillHgRepository;
|
||||
import abacus.springboot.example.repository.JcBillInItemRepository;
|
||||
import abacus.springboot.example.repository.JcBillPhotoRepository;
|
||||
import abacus.springboot.example.repository.JcBillRepository;
|
||||
import abacus.springboot.example.repository.JcBillSourceItemRepository;
|
||||
import abacus.springboot.example.repository.JcSourceItemRepository;
|
||||
import abacus.springboot.example.util.RequestUtil;
|
||||
import abacus.springboot.example.vo.PMSConfigKey;
|
||||
import abacus.springboot.example.vo.SiDepositlocation;
|
||||
import abacus.springboot.example.wsi.JcBillServiceIF;
|
||||
|
||||
@Repository
|
||||
public class JcBillService implements JcBillServiceIF{
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(JcBillService.class);
|
||||
|
||||
@Autowired
|
||||
private JcBillAccessIF jcBillAccess;
|
||||
|
||||
@Autowired
|
||||
private JcBillRepository jcBillRepository;
|
||||
|
||||
@Autowired
|
||||
private JcBillSourceItemRepository jcBillSourceItemRepository;
|
||||
|
||||
@Autowired
|
||||
private JcBillHgRepository jcBillHgRepository;
|
||||
|
||||
@Autowired
|
||||
private JcSourceItemRepository jcSourceItemRepository;
|
||||
|
||||
@Autowired
|
||||
private JcBillInItemRepository jcBillInItemRepository;
|
||||
|
||||
@Autowired
|
||||
private JcBillPhotoRepository jcBillPhotoRepository;
|
||||
|
||||
@Autowired
|
||||
private AbacusExtConfig abacusExtConfig;
|
||||
|
||||
@Override
|
||||
public Page<JcBill> queryJcBill(String fromDate, String thruDate, String id, String applicant, String goods,
|
||||
String billin, String goodsid, String product, String status, int typ, Pageable pageable) throws RuntimeException {
|
||||
try {
|
||||
return this.jcBillAccess.queryJcBill(fromDate, thruDate, applicant, goods, id, billin, goodsid, product, status, typ, pageable);
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
LOG.error("服务异常", e.getMessage());
|
||||
throw new RuntimeException("服务异常:", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public JcBill queryJcBillById(String billId) throws RuntimeException {
|
||||
try {
|
||||
Optional<JcBill> optional = jcBillRepository.findById(billId);
|
||||
|
||||
return optional.isPresent() ? optional.get() : null;
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
LOG.error("服务异常", e.getMessage());
|
||||
throw new RuntimeException("服务异常:", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JcBillSourceItem> queryJcBillSourceItemByBillId(String billId) throws RuntimeException {
|
||||
try {
|
||||
List<JcBillSourceItem> list = jcBillSourceItemRepository.findByBillid(billId);
|
||||
|
||||
return (list != null && list.size() >= 1) ? list : null;
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
LOG.error("服务异常", e.getMessage());
|
||||
throw new RuntimeException("服务异常:", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public JcBillHg queryJcBillHg(String billHg) throws RuntimeException {
|
||||
try {
|
||||
Optional<JcBillHg> optional = jcBillHgRepository.findById(billHg);
|
||||
|
||||
return optional.isPresent() ? optional.get() : null;
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
LOG.error("服务异常", e.getMessage());
|
||||
throw new RuntimeException("服务异常:", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JcSourceItem> queryJcSourceItemByBillId(String billId) throws RuntimeException {
|
||||
try {
|
||||
return jcBillAccess.queryJcSourceItemByBillId(billId);
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
LOG.error("服务异常", e.getMessage());
|
||||
throw new RuntimeException("服务异常:", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, List<JcBillPhoto>> queryJcBillPhoto(String srcid) throws RuntimeException {
|
||||
try {
|
||||
List<JcBillPhoto> billPhotos = jcBillAccess.queryJcBillPhoto(srcid, null, null);
|
||||
|
||||
if(billPhotos == null) return new HashMap<String, List<JcBillPhoto>>();
|
||||
|
||||
Map<String, List<JcBillPhoto>> map = billPhotos.stream()
|
||||
.collect(Collectors.groupingBy(e -> {
|
||||
return e.getTypephoto() + "#" + e.getSrcitemid();
|
||||
},
|
||||
Collectors.collectingAndThen(Collectors.toList(), value -> value)
|
||||
));
|
||||
|
||||
return map;
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
LOG.error("服务异常", e.getMessage());
|
||||
throw new RuntimeException("服务异常:", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JcSourceItem> queryJcSourceItemByBillId(String billId, String srcitemid) throws RuntimeException {
|
||||
try {
|
||||
return jcSourceItemRepository.findByBillidAndSrcitemid(billId, srcitemid);
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
LOG.error("服务异常", e.getMessage());
|
||||
throw new RuntimeException("服务异常:", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public JcBillSourceItem queryJcBillSourceItemById(Long id) throws RuntimeException {
|
||||
try {
|
||||
Optional<JcBillSourceItem> optional = jcBillSourceItemRepository.findById(id);
|
||||
|
||||
return optional.isPresent() ? optional.get() : null;
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
LOG.error("服务异常", e.getMessage());
|
||||
throw new RuntimeException("服务异常:", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public JcSourceItem queryJcSourceItemById(Long id) throws RuntimeException {
|
||||
try {
|
||||
Optional<JcSourceItem> optional = jcSourceItemRepository.findById(id);
|
||||
|
||||
return optional.isPresent() ? optional.get() : null;
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
LOG.error("服务异常", e.getMessage());
|
||||
throw new RuntimeException("服务异常:", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional(isolation = Isolation.DEFAULT, propagation = Propagation.REQUIRED, rollbackFor = {Exception.class})
|
||||
@Override
|
||||
public void saveQuerenBillSourceItem(JcBillSourceItem billItem, JcSourceItem sourceItem) throws RuntimeException {
|
||||
try {
|
||||
|
||||
jcBillSourceItemRepository.save(billItem);
|
||||
|
||||
jcSourceItemRepository.save(sourceItem);
|
||||
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
LOG.error("服务异常", e.getMessage());
|
||||
throw new RuntimeException("服务异常:", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional(isolation = Isolation.DEFAULT, propagation = Propagation.REQUIRED, rollbackFor = {Exception.class})
|
||||
@Override
|
||||
public void saveRejectJcSourceItems(JcBillSourceItem billItem, JcBill jcBill) throws RuntimeException {
|
||||
try {
|
||||
|
||||
jcBillSourceItemRepository.save(billItem);
|
||||
|
||||
jcBillRepository.save(jcBill);
|
||||
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
LOG.error("服务异常", e.getMessage());
|
||||
throw new RuntimeException("服务异常:", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional(isolation = Isolation.DEFAULT, propagation = Propagation.REQUIRED, rollbackFor = {Exception.class})
|
||||
@Override
|
||||
public void saveCompleteJcBill(List<JcBillInItem> inItems, JcBill jcBill) throws RuntimeException {
|
||||
try {
|
||||
|
||||
jcBillInItemRepository.saveAll(inItems);
|
||||
|
||||
jcBillRepository.save(jcBill);
|
||||
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
LOG.error("服务异常", e.getMessage());
|
||||
throw new RuntimeException("服务异常:", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional(isolation = Isolation.DEFAULT, propagation = Propagation.REQUIRED, rollbackFor = {Exception.class})
|
||||
@Override
|
||||
public void updateWarehouse(JcBill jcBill) throws RuntimeException {
|
||||
try {
|
||||
|
||||
jcBillRepository.save(jcBill);
|
||||
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
LOG.error("服务异常", e.getMessage());
|
||||
throw new RuntimeException("服务异常:", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JcBillInItem> queryJcBillInItemByBillId(String billId, int status) throws RuntimeException {
|
||||
try {
|
||||
List<JcBillInItem> list = jcBillInItemRepository.findByBillidAndStatus(billId, status);
|
||||
|
||||
return (list != null && list.size() >= 1) ? list : null;
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
LOG.error("服务异常", e.getMessage());
|
||||
throw new RuntimeException("服务异常:", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JcBillInItem> queryJcBillInItemByBillId(String billId) throws RuntimeException {
|
||||
try {
|
||||
List<JcBillInItem> list = jcBillInItemRepository.findByBillid(billId);
|
||||
|
||||
return (list != null && list.size() >= 1) ? list : null;
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
LOG.error("服务异常", e.getMessage());
|
||||
throw new RuntimeException("服务异常:", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional(isolation = Isolation.DEFAULT, propagation = Propagation.REQUIRED, rollbackFor = {Exception.class})
|
||||
@Override
|
||||
public void createStockIn(JcBill jcBill) throws RuntimeException {
|
||||
try {
|
||||
|
||||
jcBillRepository.save(jcBill);
|
||||
|
||||
jcBillAccess.saveEvent(jcBill.getId(), "稽查收货", "其他入库");
|
||||
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
LOG.error("服务异常", e.getMessage());
|
||||
throw new RuntimeException("服务异常:", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public JcBillInItem queryJcBillInItemById(Long id) {
|
||||
try {
|
||||
Optional<JcBillInItem> optional = jcBillInItemRepository.findById(id);
|
||||
|
||||
return optional.isPresent() ? optional.get() : null;
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
LOG.error("服务异常", e.getMessage());
|
||||
throw new RuntimeException("服务异常:", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional(isolation = Isolation.DEFAULT, propagation = Propagation.REQUIRED, rollbackFor = {Exception.class})
|
||||
@Override
|
||||
public void saveTerminateHgInItem(JcBillInItem inItem) throws RuntimeException {
|
||||
try {
|
||||
|
||||
jcBillInItemRepository.save(inItem);
|
||||
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
LOG.error("服务异常", e.getMessage());
|
||||
throw new RuntimeException("服务异常:", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JcBillInItem> findAllById(List<Long> ids) throws RuntimeException {
|
||||
try {
|
||||
return jcBillInItemRepository.findAllById(ids);
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
LOG.error("服务异常", e.getMessage());
|
||||
throw new RuntimeException("服务异常:", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional(isolation = Isolation.DEFAULT, propagation = Propagation.REQUIRED, rollbackFor = {Exception.class})
|
||||
@Override
|
||||
public void saveInformHg(List<JcBillInItem> inItems, JcBill jcBill, JcBillHg jcBillHg, String photoUrl) throws RuntimeException {
|
||||
try {
|
||||
|
||||
JcBillPhoto photo = new JcBillPhoto();
|
||||
photo.setSrcid(jcBillHg.getId());
|
||||
photo.setSrcitemid(jcBillHg.getId());
|
||||
photo.setTypephoto(JcBillPhoto.HG_TZH);
|
||||
photo.setUrlphoto(photoUrl);
|
||||
|
||||
jcBillPhotoRepository.save(photo);
|
||||
|
||||
jcBillInItemRepository.saveAll(inItems);
|
||||
|
||||
jcBillRepository.save(jcBill);
|
||||
|
||||
jcBillHgRepository.save(jcBillHg);
|
||||
|
||||
jcBillAccess.saveEvent(jcBillHg.getId(), "回购订单", "回购通知");
|
||||
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
LOG.error("服务异常", e.getMessage());
|
||||
throw new RuntimeException("服务异常:", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<JcBillHg> queryJcBillHg(String fromDate, String thruDate, String account, String salearea, String id,
|
||||
String billId, String status, String product, String manager, int typ, Pageable pageable)
|
||||
throws RuntimeException {
|
||||
try {
|
||||
|
||||
return jcBillAccess.queryJcBillHg(fromDate, thruDate, account, salearea, id, billId, status, product, manager, typ, pageable);
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
LOG.error("服务异常", e.getMessage());
|
||||
throw new RuntimeException("服务异常:", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JcBillInItem> queryJcBillInItemByBillHg(String billHgId) throws RuntimeException {
|
||||
try {
|
||||
List<JcBillInItem> list = jcBillInItemRepository.findByBillhg(billHgId);
|
||||
|
||||
return (list != null && list.size() >= 1) ? list : null;
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
LOG.error("服务异常", e.getMessage());
|
||||
throw new RuntimeException("服务异常:", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional(isolation = Isolation.DEFAULT, propagation = Propagation.REQUIRED, rollbackFor = {Exception.class})
|
||||
@Override
|
||||
public void saveRejectBillHg(int status, int typ, JcBill jcBill, JcBillHg billHg, List<JcBillInItem> inItems) throws RuntimeException {
|
||||
try {
|
||||
if(JcBillHg.STATUS_ONE == status) {
|
||||
|
||||
jcBillRepository.save(jcBill);
|
||||
jcBillHgRepository.save(billHg);
|
||||
jcBillInItemRepository.saveAll(inItems);
|
||||
|
||||
|
||||
} else if(JcBillHg.STATUS_TWO == status) {
|
||||
|
||||
jcBillHgRepository.save(billHg);
|
||||
|
||||
|
||||
} else if(JcBillHg.STATUS_THREE == status || JcBillHg.STATUS_FOUR == status) {
|
||||
|
||||
jcBillHgRepository.save(billHg);
|
||||
|
||||
} else if (JcBillHg.STATUS_FIVE == status){
|
||||
|
||||
// 删除对应的事件
|
||||
jcBillAccess.deleteEvent(billHg.getId(), "回购分仓", "回购分仓");
|
||||
} else {
|
||||
throw new BusinessException("未知状态不能驳回!");
|
||||
}
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
LOG.error("服务异常", e.getMessage());
|
||||
throw new RuntimeException("服务异常:", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional(isolation = Isolation.DEFAULT, propagation = Propagation.REQUIRED, rollbackFor = {Exception.class})
|
||||
@Override
|
||||
public void saveQuerenSk(JcBillHg billHg, boolean fcFlag) throws RuntimeException {
|
||||
try {
|
||||
billHg.setAudit(UserContext.getUserId());
|
||||
billHg.setAuditname(UserContext.getUserName());
|
||||
billHg.setAuditdt(new Date());
|
||||
jcBillHgRepository.save(billHg);
|
||||
|
||||
if(fcFlag) {
|
||||
|
||||
jcBillAccess.saveEvent(billHg.getId(), "回购分仓", "回购分仓");
|
||||
|
||||
}
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
LOG.error("服务异常", e.getMessage());
|
||||
throw new RuntimeException("服务异常:", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional(isolation = Isolation.DEFAULT, propagation = Propagation.REQUIRED, rollbackFor = {Exception.class})
|
||||
@Override
|
||||
public void savecreateFc(JcBillHg billHg) throws RuntimeException {
|
||||
try {
|
||||
|
||||
jcBillHgRepository.save(billHg);
|
||||
|
||||
jcBillAccess.saveEvent(billHg.getId(), "回购分仓", "回购分仓");
|
||||
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
LOG.error("服务异常", e.getMessage());
|
||||
throw new RuntimeException("服务异常:", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional(isolation = Isolation.DEFAULT, propagation = Propagation.REQUIRED, rollbackFor = {Exception.class})
|
||||
@Override
|
||||
public void updateFcWarehouse(String oldJsonStr, JcBillHg billHg) throws RuntimeException {
|
||||
try {
|
||||
|
||||
jcBillHgRepository.save(billHg);
|
||||
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
LOG.error("服务异常", e.getMessage());
|
||||
throw new RuntimeException("服务异常:", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional(isolation = Isolation.DEFAULT, propagation = Propagation.REQUIRED, rollbackFor = {Exception.class})
|
||||
@Override
|
||||
public JcSourceItem saveJcSourceItem(JcSourceItem item) throws RuntimeException {
|
||||
try {
|
||||
|
||||
JcSourceItem tempItem = jcSourceItemRepository.save(item);
|
||||
|
||||
|
||||
return tempItem;
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
LOG.error("服务异常", e.getMessage());
|
||||
throw new RuntimeException("服务异常:", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional(isolation = Isolation.DEFAULT, propagation = Propagation.REQUIRED, rollbackFor = {Exception.class})
|
||||
@Override
|
||||
public void deleteJcSourceItem(List<Long> ids) throws RuntimeException {
|
||||
try {
|
||||
|
||||
jcBillAccess.deleteJcSourceItem(ids);
|
||||
|
||||
// /*操作日志*/
|
||||
// OperationLog log = new OperationLog("jc_bill", item.getBillid(), "删除溯源确认信息", "", "", JSON.toJSONString(item));
|
||||
// log.setOperator(UserContext.getUserId());
|
||||
// log.setOperatorName(UserContext.getUserName());
|
||||
// BusinessESUtil.checkService(this.operationLogService).saveOperationLog(log);
|
||||
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
LOG.error("服务异常", e.getMessage());
|
||||
throw new RuntimeException("服务异常:", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional(isolation = Isolation.DEFAULT, propagation = Propagation.REQUIRED, rollbackFor = {Exception.class})
|
||||
@Override
|
||||
public void updateHgprice(JcBillInItem inItem) throws RuntimeException {
|
||||
try {
|
||||
jcBillInItemRepository.save(inItem);
|
||||
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
LOG.error("服务异常", e.getMessage());
|
||||
throw new RuntimeException("服务异常:", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional(isolation = Isolation.DEFAULT, propagation = Propagation.REQUIRED, rollbackFor = {Exception.class})
|
||||
@Override
|
||||
public void updateRemark(String oldJsonStr, JcBillHg billHg) throws RuntimeException {
|
||||
try {
|
||||
|
||||
jcBillHgRepository.save(billHg);
|
||||
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
LOG.error("服务异常", e.getMessage());
|
||||
throw new RuntimeException("服务异常:", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional(isolation = Isolation.DEFAULT, propagation = Propagation.REQUIRED, rollbackFor = {Exception.class})
|
||||
@Override
|
||||
public void updatePac(String oldJsonStr, JcBillHg billHg) throws RuntimeException {
|
||||
try {
|
||||
|
||||
jcBillHgRepository.save(billHg);
|
||||
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
LOG.error("服务异常", e.getMessage());
|
||||
throw new RuntimeException("服务异常:", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional(isolation = Isolation.DEFAULT, propagation = Propagation.REQUIRED, rollbackFor = {Exception.class})
|
||||
@Override
|
||||
public void updateOperatorname(JcBillInItem inItem, String oldStr) throws RuntimeException {
|
||||
try {
|
||||
jcBillInItemRepository.save(inItem);
|
||||
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
LOG.error("服务异常", e.getMessage());
|
||||
throw new RuntimeException("服务异常:", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveJcBillInItem(List<JcBillInItem> items) throws RuntimeException {
|
||||
jcBillInItemRepository.saveAll(items);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JcBillSourceItem> queryJcBillSourceItemInBillId(List<String> billIds) throws RuntimeException {
|
||||
try {
|
||||
return jcBillAccess.queryJcBillSourceItemInBillId(billIds);
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
LOG.error("服务异常", e.getMessage());
|
||||
throw new RuntimeException("服务异常:", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional(isolation = Isolation.DEFAULT, propagation = Propagation.REQUIRED, rollbackFor = {Exception.class})
|
||||
@Override
|
||||
public void saveRejectBill(int status, JcBill jcBill, List<JcBillInItem> inItems, List<JcBillSourceItem> sourceItems) throws RuntimeException {
|
||||
try {
|
||||
|
||||
jcBillRepository.save(jcBill);
|
||||
jcBillSourceItemRepository.saveAll(sourceItems);
|
||||
if(inItems != null) jcBillInItemRepository.deleteAll(inItems);
|
||||
|
||||
if(JcBill.STATUS_FOUR == status) {// 入库待审核 进行撤回
|
||||
|
||||
// 进行事件删除
|
||||
jcBillAccess.deleteEvent(jcBill.getId(), "稽查收货", "其他入库");
|
||||
|
||||
}
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
LOG.error("服务异常", e.getMessage());
|
||||
throw new RuntimeException("服务异常:", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JcSourceItem> queryJcSourceItemByBillId(String billId, String srcitemid, int status)
|
||||
throws RuntimeException {
|
||||
try {
|
||||
return jcSourceItemRepository.findByBillidAndSrcitemidAndStatus(billId, srcitemid, status);
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
LOG.error("服务异常", e.getMessage());
|
||||
throw new RuntimeException("服务异常:", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional(isolation = Isolation.DEFAULT, propagation = Propagation.REQUIRED, rollbackFor = {Exception.class})
|
||||
@Override
|
||||
public void updateSourceItemAccount(String sourceItemLogJson, String billSourceItemLogJson, String billSourceItemNewLogJson,
|
||||
JcSourceItem sourceItem, List<JcBillSourceItem> billSourceItems,
|
||||
List<JcBillInItem> oldInItems, List<JcBillInItem> inItems) throws RuntimeException {
|
||||
try {
|
||||
String biillId = sourceItem.getBillid();
|
||||
|
||||
jcSourceItemRepository.save(sourceItem);
|
||||
jcBillSourceItemRepository.saveAll(billSourceItems);
|
||||
jcBillInItemRepository.deleteAll(oldInItems);
|
||||
jcBillInItemRepository.saveAll(inItems);
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
LOG.error("服务异常", e.getMessage());
|
||||
throw new RuntimeException("服务异常:", e);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public SiDepositlocation querySiDepositlocation(String srcid) throws Exception {
|
||||
return jcBillAccess.querySiDepositlocation(srcid);
|
||||
}
|
||||
@Override
|
||||
public SiDepositlocation querySiDepositlocationHGfc(String srcid) throws Exception {
|
||||
return jcBillAccess.querySiDepositlocationHGfc(srcid);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject gwisSubCancelOrder(String orderCode, String orderType) throws Exception {
|
||||
try {
|
||||
|
||||
Map<String, String> configValues = this.abacusExtConfig.getAbacusConfigSetByKeyGroupByKey(
|
||||
PMSConfigKey.KEY_GROUP, PMSConfigKey.PMS_WMSCONF);
|
||||
if (configValues == null || configValues.isEmpty())
|
||||
throw new Exception(PMSConfigKey.PMS_WMSCONF + "为空!");
|
||||
|
||||
// 判断key是否存在
|
||||
if (!configValues.containsKey(PMSConfigKey.PMS_WMSCONF_URL))
|
||||
throw new Exception(PMSConfigKey.PMS_WMSCONF + "配置中" + PMSConfigKey.PMS_WMSCONF_URL + "不存在!");
|
||||
if (!configValues.containsKey(PMSConfigKey.PMS_WMSCONF_APPKEY))
|
||||
throw new Exception(PMSConfigKey.PMS_WMSCONF + "配置中" + PMSConfigKey.PMS_WMSCONF_APPKEY + "不存在!");
|
||||
if (!configValues.containsKey(PMSConfigKey.PMS_WMSCONF_SESSIONKEY))
|
||||
throw new Exception(PMSConfigKey.PMS_WMSCONF + "配置中" + PMSConfigKey.PMS_WMSCONF_SESSIONKEY + "不存在!");
|
||||
|
||||
// 判断值是否为空
|
||||
String url = configValues.get(PMSConfigKey.PMS_WMSCONF_URL);
|
||||
if (StringUtils.isBlank(url))
|
||||
throw new Exception(PMSConfigKey.PMS_WMSCONF + "配置中" + PMSConfigKey.PMS_WMSCONF_URL + "为空!");
|
||||
|
||||
String appkey = configValues.get(PMSConfigKey.PMS_WMSCONF_APPKEY);
|
||||
if (StringUtils.isBlank(appkey))
|
||||
throw new Exception(PMSConfigKey.PMS_WMSCONF + "配置中" + PMSConfigKey.PMS_WMSCONF_APPKEY + "为空!");
|
||||
|
||||
String sessionKey = configValues.get(PMSConfigKey.PMS_WMSCONF_SESSIONKEY);
|
||||
if (StringUtils.isBlank(sessionKey))
|
||||
throw new Exception(PMSConfigKey.PMS_WMSCONF + "配置中" + PMSConfigKey.PMS_WMSCONF_SESSIONKEY + "为空!");
|
||||
|
||||
String goodsOwner = configValues.get(PMSConfigKey.PMS_WMSCONF_GOODSOWNER);
|
||||
if (StringUtils.isBlank(goodsOwner))
|
||||
throw new Exception(PMSConfigKey.PMS_WMSCONF + "配置中" + PMSConfigKey.PMS_WMSCONF_GOODSOWNER + "为空!");
|
||||
|
||||
JSONObject head = new JSONObject();
|
||||
head.put("orderCode", orderCode); // 唯一订单号
|
||||
head.put("orderType", orderType);
|
||||
head.put("goodsOwner", goodsOwner);
|
||||
|
||||
// 2. 计算签名 secret = MD5(contentJson + sessionKey)
|
||||
String secret = md5(head.toJSONString() + sessionKey);
|
||||
|
||||
// 3. 拼接完整URL(带上method、appkey、secret)
|
||||
String fullUrl = url
|
||||
+ "?method=gwisSubCancelOrder"
|
||||
+ "&appkey=" + appkey
|
||||
+ "&secret=" + secret;
|
||||
|
||||
LOG.info("WMS取消订单>>>orderCode>>>{}>>>orderType>>>{}>>>请求参数>>>{}", orderCode, orderType, head.toJSONString());
|
||||
String returnJson = RequestUtil.send(fullUrl, head.toJSONString(), orderCode);
|
||||
LOG.info("WMS取消订单>>>orderCode>>>{}>>>orderType>>>{}>>>响应参数>>>{}", orderCode, orderType, returnJson);
|
||||
|
||||
JSONObject jsonObj = JSONObject.parseObject(returnJson);
|
||||
|
||||
return jsonObj;
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
LOG.error("WMS取消订单接口服务异常", e.getMessage());
|
||||
throw new RuntimeException("WMS取消订单接口服务异常:", e);
|
||||
}
|
||||
}
|
||||
|
||||
private static String md5(String input) {
|
||||
try {
|
||||
java.security.MessageDigest md = java.security.MessageDigest.getInstance("MD5");
|
||||
byte[] digest = md.digest(input.getBytes("UTF-8"));
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (byte b : digest) {
|
||||
sb.append(String.format("%02X", b)); // 大写十六进制
|
||||
}
|
||||
return sb.toString();
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("MD5计算失败", e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+593
@@ -0,0 +1,593 @@
|
||||
package abacus.springboot.example.impl;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageImpl;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import abacus.springboot.example.api.view.ApiBillHg;
|
||||
import abacus.springboot.example.api.view.ApiBillHgItem;
|
||||
import abacus.springboot.example.api.view.ApiBillHgPayment;
|
||||
import abacus.springboot.example.api.view.ApiJcBill;
|
||||
import abacus.springboot.example.api.view.ApiJcBillHgSearchItem;
|
||||
import abacus.springboot.example.api.view.ApiJcBillItem;
|
||||
import abacus.springboot.example.api.view.ApiJcBillSearch;
|
||||
import abacus.springboot.example.api.view.JcBillCount;
|
||||
import abacus.springboot.example.api.view.JcCodeFlow;
|
||||
import abacus.springboot.example.api.view.JcProduct;
|
||||
import abacus.springboot.example.api.view.JcProductBillSouce;
|
||||
import abacus.springboot.example.dao.JcBillHg;
|
||||
import abacus.springboot.example.pi.ApiJcBillAccessIF;
|
||||
|
||||
/**
|
||||
* <p>Title:ApiJcBillAccess</p>
|
||||
<p>Description: 底层实现</p>
|
||||
@author chuanZeng
|
||||
@date 2026年8月18日
|
||||
*/
|
||||
@Repository
|
||||
public class ApiJcBillAccess implements ApiJcBillAccessIF {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(ApiJcBillAccess.class);
|
||||
|
||||
@Autowired
|
||||
private JdbcTemplate jdbcTemplate;
|
||||
|
||||
@Override
|
||||
public Page<ApiJcBillSearch> queryApiJcBillSearch(String keyword, String employee, String status, Pageable pageable)
|
||||
throws RuntimeException {
|
||||
try {
|
||||
Map<String,Object> params = new HashMap<String, Object>();
|
||||
StringBuffer sb = new StringBuffer("");
|
||||
|
||||
if(StringUtils.isNotBlank(keyword)) {
|
||||
sb.append(params.size() > 0 ?" and ":" where ");
|
||||
sb.append(" (a.id like '%" + keyword + "%' ");
|
||||
sb.append(" or a.goods like '%" + keyword + "%'");
|
||||
sb.append(" or a.id in (select b.billid from jc_billsource_item b where b.goodsid like'%" + keyword + "%'))");
|
||||
|
||||
params.put("id", "%"+keyword+"%");
|
||||
}
|
||||
|
||||
if(StringUtils.isNotBlank(employee)) {
|
||||
sb.append(params.size() > 0 ?" and ":" where ");
|
||||
sb.append(" (a.dept in (");
|
||||
sb.append(" select deptid from (");
|
||||
sb.append(" select dataid as deptid from distributionmapping where erid ='" + employee + "' and rtype = 1 and ftype = 1 and dtype = 1");
|
||||
sb.append(" union");
|
||||
sb.append(" select a.dataid as deptid from distributionmapping a ,acas_assign b where a.erid =b.rolez and a.rtype = 0 and a.ftype = 1 and a.dtype = 1 and b.userz ='" + employee + "'");
|
||||
sb.append(" ) adept)");
|
||||
sb.append(" or");
|
||||
sb.append(" a.applicant in (");
|
||||
sb.append(" select dataid from (");
|
||||
sb.append(" select dataid from distributionmapping where erid ='" + employee + "' and rtype = 1 and ftype = 1 and dtype = 2");
|
||||
sb.append(" union");
|
||||
sb.append(" select dataid from distributionmapping a ,acas_assign b where a.erid =b.rolez and a.rtype = 0 and a.ftype = 1 and a.dtype = 2 and b.userz ='" + employee + "'");
|
||||
sb.append(" union");
|
||||
sb.append(" select '" + employee + "'");
|
||||
sb.append(" ) adept )");
|
||||
sb.append(" )");
|
||||
params.put("employee", employee);
|
||||
// sb.append(" a.dept in (");
|
||||
// sb.append(" select deptid from (");
|
||||
// sb.append(" select dataid as deptid from distributionmapping where erid ='" + employee + "' and rtype = 1 and ftype = 1 and dtype = 1");
|
||||
// sb.append(" union ");
|
||||
// sb.append(" select a.dataid as deptid from distributionmapping a ,acas_assign b where a.erid =b.rolez and a.rtype = 0 and a.ftype = 1 and a.dtype = 1 and b.userz ='" + employee + "'");
|
||||
// sb.append(" union ");
|
||||
// sb.append("select (select dept as deptid from employee e where e.id = dataid) as deptid from distributionmapping where erid ='" + employee + "' and rtype = 1 and ftype = 1 and dtype = 2");
|
||||
// sb.append(" union ");
|
||||
// sb.append("select (select dept as deptid from employee e where e.id = a.dataid) as deptid from distributionmapping a ,acas_assign b where a.erid =b.rolez and a.rtype = 0 and a.ftype = 1 and a.dtype = 2 and b.userz ='" + employee + "'");
|
||||
// sb.append(" union ");
|
||||
// sb.append("select dept as deptid from employee e where e.id = '" + employee + "'");
|
||||
// sb.append(" ) adept");
|
||||
// sb.append(" )");
|
||||
// params.put("employee", employee);
|
||||
}
|
||||
|
||||
if(StringUtils.isNotBlank(status)) {
|
||||
sb.append(params.size() > 0 ?" and ":" where ");
|
||||
int statusInt = Integer.parseInt(status);
|
||||
if(statusInt == 0) {// 待提交:已录入或者录入完成提交验证
|
||||
sb.append(" a.status in(0, 1) ");
|
||||
params.put("status", statusInt);
|
||||
} else if(statusInt == 2) {// 待溯源
|
||||
sb.append(" a.status = 2 ");
|
||||
params.put("status", statusInt);
|
||||
} else if(statusInt == -2) {// 人工溯源驳回
|
||||
sb.append(" a.status = -2 ");
|
||||
params.put("status", statusInt);
|
||||
} else if(statusInt == 3) {// 待入库,待入库审核
|
||||
sb.append(" a.status in(3, 4) ");
|
||||
params.put("status", statusInt);
|
||||
} else if(statusInt == 5) {// 已入库
|
||||
sb.append(" a.status = 5 ");
|
||||
params.put("status", statusInt);
|
||||
} else if(statusInt == 6 || statusInt == 8) {// 部分回购,回购完成
|
||||
sb.append(" a.hgstatus in(1, 2) ");
|
||||
params.put("status", statusInt);
|
||||
}
|
||||
} else {
|
||||
sb.append(params.size() > 0 ?" and ":" where ");
|
||||
sb.append(" a.status in(-2, 0, 1, 2, 3, 4, 5) ");
|
||||
params.put("status", 1);
|
||||
}
|
||||
|
||||
StringBuffer orderBy = new StringBuffer("");
|
||||
|
||||
orderBy.append(" order by dt desc ");
|
||||
|
||||
orderBy.append(" offset "+ (pageable.getPageNumber() * pageable.getPageSize()) + " rows fetch next "+ pageable.getPageSize() + " rows only ");
|
||||
|
||||
String sql = " select a.id as billid, receivedt as receivedt, a.goods as goods, "
|
||||
+ " a.quantity as quantity, a.status as status, a.hgstatus as hgstatus from jc_bill a "
|
||||
+ sb.toString() + orderBy.toString();
|
||||
LOG.info("queryApiJcBillSearch>>>SQLgetPageNumber>>>{}", pageable.getPageNumber());
|
||||
LOG.info("queryApiJcBillSearch>>>SQLgetPageSize>>>{}", pageable.getPageSize());
|
||||
LOG.info("queryApiJcBillSearch>>>SQL>>>{}", sql);
|
||||
|
||||
List<ApiJcBillSearch> lists = jdbcTemplate.query(sql, new BeanPropertyRowMapper<ApiJcBillSearch>(ApiJcBillSearch.class));
|
||||
|
||||
Long count = jdbcTemplate.queryForObject("select count(a.id) from jc_bill a " + sb.toString(), Long.class);
|
||||
|
||||
Page<ApiJcBillSearch> scorePage = new PageImpl<ApiJcBillSearch>(lists, pageable, count);
|
||||
return scorePage;
|
||||
}catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ApiJcBill queryApiJcBillById(String id) throws RuntimeException {
|
||||
try {
|
||||
Map<String,Object> params = new HashMap<String, Object>();
|
||||
StringBuffer sb = new StringBuffer(" select a.id, a.status, a.goods, a.warehouse, a.warehousename, a.receivedt,");
|
||||
sb.append(" a.quantity, a.subtotal, a.applicant, a.applicantname, a.applicantdt");
|
||||
sb.append(" from jc_bill a");
|
||||
|
||||
if(StringUtils.isNotBlank(id)) {
|
||||
sb.append(params.size() > 0 ?" and ":" where ");
|
||||
sb.append(" a.id = '" + id + "' ");
|
||||
params.put("id", id);
|
||||
}
|
||||
|
||||
LOG.info("queryApiJcBillById>>>SQL>>>{}", sb.toString());
|
||||
|
||||
List<ApiJcBill> lsit = jdbcTemplate.query(sb.toString(), new BeanPropertyRowMapper<ApiJcBill>(ApiJcBill.class));
|
||||
|
||||
return (lsit != null && lsit.size() >= 1) ? lsit.get(0) : null;
|
||||
}catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ApiJcBillItem> queryApiJcBillItemByBIllId(String billId) throws RuntimeException {
|
||||
try {
|
||||
Map<String,Object> params = new HashMap<String, Object>();
|
||||
StringBuffer sb = new StringBuffer("select a.id,a.status,a.recsource,a.channel,a.price,a.quantity,");
|
||||
sb.append(" a.numbers,a.subtotal,a.goodsid,a.logisticsid ");
|
||||
sb.append(" from jc_billsource_item a ");
|
||||
|
||||
if(StringUtils.isNotBlank(billId)) {
|
||||
sb.append(params.size() > 0 ?" and ":" where ");
|
||||
sb.append(" a.billid = '" + billId + "' ");
|
||||
params.put("billId", billId);
|
||||
}
|
||||
|
||||
LOG.info("queryApiJcBillItemByBIllId>>>SQL>>>{}", sb.toString());
|
||||
|
||||
List<ApiJcBillItem> lsit = jdbcTemplate.query(sb.toString(), new BeanPropertyRowMapper<ApiJcBillItem>(ApiJcBillItem.class));
|
||||
|
||||
return lsit;
|
||||
}catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<ApiJcBillHgSearchItem> queryApiJcBillHgSearchItem(String keyword, String employee, String status, Pageable pageable)
|
||||
throws RuntimeException {
|
||||
try {
|
||||
Map<String,Object> params = new HashMap<String, Object>();
|
||||
StringBuffer sb = new StringBuffer("");
|
||||
|
||||
if(StringUtils.isNotBlank(keyword)) {
|
||||
sb.append(params.size() > 0 ?" and ":" where ");
|
||||
sb.append(" (a.id like '%" + keyword + "%' ");
|
||||
sb.append(" or a.account like '%" + keyword + "%'");
|
||||
sb.append(" or a.accountname like '%" + keyword + "%'");
|
||||
sb.append(" or a.consigneephone like '%" + keyword + "%'");
|
||||
sb.append(" or a.id in (select b.billhg from jc_billin_item b where b.product like '%" + keyword + "%' and b.productname like'%" + keyword + "%'))");
|
||||
|
||||
params.put("id", "%"+keyword+"%");
|
||||
}
|
||||
|
||||
if(StringUtils.isNotBlank(employee)) {
|
||||
sb.append(params.size() > 0 ?" and ":" where ");
|
||||
sb.append(" (");
|
||||
sb.append(" a.account in (");
|
||||
sb.append(" select sa.id from sams_account sa where sa.groupid in (select pc.id from pms_customergroup pc where pc.grouperid='" + employee + "' or ',' + groupempid + ',' like '%," + employee + ",%')");
|
||||
sb.append(" )");
|
||||
sb.append(" or ");
|
||||
sb.append(" a.account in (");
|
||||
sb.append(" select customerid from ws_wsempmgcustomer where wsempid ='" + employee + "' ");
|
||||
sb.append(" )");
|
||||
sb.append(" )");
|
||||
// sb.append(" a.account in (select sa.id from sams_account sa where sa.groupid in (select pc.id from pms_customergroup pc where pc.grouperid='" + employee + "' or ',' + groupempid + ',' like '%," + employee + ",%')) ");
|
||||
params.put("employee", employee);
|
||||
}
|
||||
|
||||
if(StringUtils.isNotBlank(status)) {
|
||||
sb.append(params.size() > 0 ?" and ":" where ");
|
||||
int statusInt = Integer.parseInt(status);
|
||||
if(statusInt == 1) {// 待提交
|
||||
sb.append(" a.status = 1 ");
|
||||
params.put("status", statusInt);
|
||||
} else if(statusInt == 2) {// 待付款
|
||||
sb.append(" a.status = 2 ");
|
||||
params.put("status", statusInt);
|
||||
} else if(statusInt == 3) {// 待分仓
|
||||
sb.append(" a.status in(3, 4) ");
|
||||
params.put("status", statusInt);
|
||||
} else if(statusInt == 5) {// 待出库
|
||||
sb.append(" a.status = 5 ");
|
||||
params.put("status", statusInt);
|
||||
} else if(statusInt == 6) {// 已出库
|
||||
sb.append(" a.status = 6 ");
|
||||
params.put("status", statusInt);
|
||||
}
|
||||
}
|
||||
|
||||
StringBuffer orderBy = new StringBuffer("");
|
||||
|
||||
orderBy.append(" order by dt desc ");
|
||||
|
||||
orderBy.append(" offset "+ (pageable.getPageNumber() * pageable.getPageSize()) + " rows fetch next "+ pageable.getPageSize() + " rows only ");
|
||||
|
||||
String sql = " select a.id as billHg, a.account, a.accountname, a.manager, a.managername, a.status, "
|
||||
+ " a.logisticsname, a.logisticsno, (a.subtotal+a.freight) as subtotal from jc_billhg a "
|
||||
+ sb.toString() + orderBy.toString();
|
||||
|
||||
LOG.info("queryApiJcBillHgSearchItem>>>SQL>>>{}", sql);
|
||||
|
||||
List<ApiJcBillHgSearchItem> lists = jdbcTemplate.query(sql, new BeanPropertyRowMapper<ApiJcBillHgSearchItem>(ApiJcBillHgSearchItem.class));
|
||||
|
||||
Long count = jdbcTemplate.queryForObject("select count(a.id) from jc_billhg a " + sb.toString(), Long.class);
|
||||
|
||||
Page<ApiJcBillHgSearchItem> scorePage = new PageImpl<ApiJcBillHgSearchItem>(lists, pageable, count);
|
||||
return scorePage;
|
||||
}catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JcBillCount> queryJcBillCount(List<String> ids) throws RuntimeException {
|
||||
try {
|
||||
Map<String,Object> params = new HashMap<String, Object>();
|
||||
StringBuffer sb = new StringBuffer("select billhg as id, count(product) as breednum, sum(numbers) as numbers ");
|
||||
sb.append(" from jc_billin_item a ");
|
||||
|
||||
if(ids != null && ids.size() >= 1) {
|
||||
StringBuffer idIn = new StringBuffer();
|
||||
for(String key : ids){
|
||||
idIn.append("'" + key + "',");
|
||||
}
|
||||
String idIns = idIn.toString().substring(0, idIn.length() - 1);
|
||||
|
||||
sb.append(params.size() > 0 ?" and ":" where ");
|
||||
sb.append(" a.billhg in (" + idIns + ") ");
|
||||
params.put("billhg", idIn);
|
||||
}
|
||||
|
||||
sb.append(" group by billhg");
|
||||
|
||||
LOG.info("queryJcBillCount>>>SQL>>>{}", sb.toString());
|
||||
|
||||
List<JcBillCount> lsit = jdbcTemplate.query(sb.toString(), new BeanPropertyRowMapper<JcBillCount>(JcBillCount.class));
|
||||
|
||||
return lsit;
|
||||
}catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ApiBillHg queryApiBillHgById(String hgId) throws RuntimeException {
|
||||
try {
|
||||
Map<String,Object> params = new HashMap<String, Object>();
|
||||
StringBuffer sb = new StringBuffer(" select a.id, a.billid, a.status, a.source, a.account,");
|
||||
sb.append(" a.accountname, a.quantity, a.subtotal, a.freight, a.manager,");
|
||||
sb.append(" a.managername, a.consignee, a.consigneephone, a.province, a.provincename,");
|
||||
sb.append(" a.city, a.cityname, a.area, a.areaname, a.address,");
|
||||
sb.append(" a.receiveway, a.remark, a.remark1, a.logisticsname, a.logisticscode,");
|
||||
sb.append(" a.logisticstype, a.logisticsno");
|
||||
sb.append(" from jc_billhg a");
|
||||
|
||||
if(StringUtils.isNotBlank(hgId)) {
|
||||
sb.append(params.size() > 0 ?" and ":" where ");
|
||||
sb.append(" a.id = '" + hgId + "' ");
|
||||
params.put("id", hgId);
|
||||
}
|
||||
|
||||
LOG.info("queryApiBillHgById>>>SQL>>>{}", sb.toString());
|
||||
|
||||
List<ApiBillHg> lsit = jdbcTemplate.query(sb.toString(), new BeanPropertyRowMapper<ApiBillHg>(ApiBillHg.class));
|
||||
|
||||
return (lsit != null && lsit.size() >= 1) ? lsit.get(0) : null;
|
||||
}catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ApiBillHgItem> queryApiBillHgItemByHgId(String hgId) throws RuntimeException {
|
||||
try {
|
||||
Map<String,Object> params = new HashMap<String, Object>();
|
||||
StringBuffer sb = new StringBuffer("select a.id, a.status, a.product, a.productname, b.spec, a.price, ");
|
||||
sb.append(" a.quantity, a.numbers, a.hgprice, a.hgamount");
|
||||
sb.append(" from jc_billin_item a");
|
||||
sb.append(" left join pms_product b on a.product = b.id");
|
||||
|
||||
if(StringUtils.isNotBlank(hgId)) {
|
||||
sb.append(params.size() > 0 ?" and ":" where ");
|
||||
sb.append(" a.billhg = '" + hgId + "' ");
|
||||
params.put("billhg", hgId);
|
||||
}
|
||||
|
||||
LOG.info("queryApiBillHgItemByHgId>>>SQL>>>{}", sb.toString());
|
||||
|
||||
List<ApiBillHgItem> lsit = jdbcTemplate.query(sb.toString(), new BeanPropertyRowMapper<ApiBillHgItem>(ApiBillHgItem.class));
|
||||
|
||||
return lsit;
|
||||
}catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ApiBillHgPayment> queryApiBillHgPaymentByHgId(String hgId) throws RuntimeException {
|
||||
try {
|
||||
Map<String,Object> params = new HashMap<String, Object>();
|
||||
StringBuffer sb = new StringBuffer(" select a.billhg, a.payment, a.amount, a.zhmc, a.khyh, a.yhzh from jc_billhg_pay a ");
|
||||
|
||||
if(StringUtils.isNotBlank(hgId)) {
|
||||
sb.append(params.size() > 0 ?" and ":" where ");
|
||||
sb.append(" a.billhg = '" + hgId + "' ");
|
||||
params.put("billhg", hgId);
|
||||
}
|
||||
|
||||
LOG.info("queryApiBillHgPaymentByHgId>>>SQL>>>{}", sb.toString());
|
||||
|
||||
List<ApiBillHgPayment> lsit = jdbcTemplate.query(sb.toString(), new BeanPropertyRowMapper<ApiBillHgPayment>(ApiBillHgPayment.class));
|
||||
|
||||
return lsit;
|
||||
}catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JcCodeFlow> queryJcCodeFlow(List<String> codes) throws RuntimeException {
|
||||
try {
|
||||
Map<String,Object> params = new HashMap<String, Object>();
|
||||
StringBuffer sb = new StringBuffer("select b.id, b.deposit, b.depositname, b.dt as tdate, b.orderid,");
|
||||
sb.append(" c.customerid, c.customername, c.aprssalemanid, c.aprssalemanname, c.bizgroupid,");
|
||||
sb.append(" c.bizgroupname, c.wsareaid, c.wsareaname,");
|
||||
sb.append(" a.code, a.productid, a.productname");
|
||||
sb.append(" from bcs_codeflow a");
|
||||
sb.append(" left join wmsn_despatch b on b.id = a.srcid ");
|
||||
sb.append(" left join ws_wholesalebill c on c.id = b.orderid");
|
||||
|
||||
if(codes != null && codes.size() >= 1) {
|
||||
StringBuffer idIn = new StringBuffer();
|
||||
for(String key : codes){
|
||||
idIn.append("'" + key + "',");
|
||||
}
|
||||
String idIns = idIn.toString().substring(0, idIn.length() - 1);
|
||||
|
||||
sb.append(params.size() > 0 ?" and ":" where ");
|
||||
sb.append(" a.code in (" + idIns + ") ");
|
||||
params.put("id", idIn);
|
||||
}
|
||||
|
||||
LOG.info("queryJcCodeFlow>>>SQL>>>{}", sb.toString());
|
||||
|
||||
List<JcCodeFlow> lsit = jdbcTemplate.query(sb.toString(), new BeanPropertyRowMapper<JcCodeFlow>(JcCodeFlow.class));
|
||||
|
||||
return lsit;
|
||||
}catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ApiBillHgPayment> queryApiBillHgPaymentByHgId(List<String> hgIds) throws RuntimeException {
|
||||
try {
|
||||
Map<String,Object> params = new HashMap<String, Object>();
|
||||
StringBuffer sb = new StringBuffer(" select a.billhg, a.payment, a.amount, a.zhmc, a.khyh, a.yhzh from jc_billhg_pay a ");
|
||||
|
||||
if(hgIds != null && hgIds.size() >= 1) {
|
||||
StringBuffer idIn = new StringBuffer();
|
||||
for(String key : hgIds){
|
||||
idIn.append("'" + key + "',");
|
||||
}
|
||||
String idIns = idIn.toString().substring(0, idIn.length() - 1);
|
||||
|
||||
sb.append(params.size() > 0 ?" and ":" where ");
|
||||
sb.append(" a.billhg in (" + idIns + ") ");
|
||||
params.put("id", idIn);
|
||||
}
|
||||
|
||||
LOG.info("queryApiBillHgPaymentByHgId>>>SQL>>>{}", sb.toString());
|
||||
|
||||
List<ApiBillHgPayment> lsit = jdbcTemplate.query(sb.toString(), new BeanPropertyRowMapper<ApiBillHgPayment>(ApiBillHgPayment.class));
|
||||
|
||||
return lsit;
|
||||
}catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JcProduct> queryJcProduct(String product, String stockInId, String hgId) throws RuntimeException {
|
||||
try {
|
||||
Map<String,Object> params = new HashMap<String, Object>();
|
||||
StringBuffer sb = new StringBuffer(" select a.billid,a.billin,a.billhg,a.account,a.accountname,a.product,a.productname,");
|
||||
sb.append(" sum(a.quantity) as quantity ,sum(a.numbers) as numbers,");
|
||||
sb.append(" (select h.wdtbillout from jc_billhg h where h.billid = a.billid and h.id = a.billhg) as wdtbillout");
|
||||
sb.append(" from jc_billin_item a");
|
||||
|
||||
if(StringUtils.isNotBlank(product)) {
|
||||
sb.append(params.size() > 0 ?" and ":" where ");
|
||||
// sb.append(" a.product ='" + product + "' ");
|
||||
sb.append(" a.billid in (select jbi.billid from jc_billsource_item jbi where jbi.goodsid ='" + product + "' and jbi.status = 3) ");
|
||||
params.put("product", product);
|
||||
}
|
||||
if(StringUtils.isNotBlank(stockInId)) {
|
||||
sb.append(params.size() > 0 ?" and ":" where ");
|
||||
sb.append(" a.billin ='" + stockInId + "' ");
|
||||
params.put("billin", stockInId);
|
||||
}
|
||||
if(StringUtils.isNotBlank(hgId)) {
|
||||
sb.append(params.size() > 0 ?" and ":" where ");
|
||||
sb.append(" a.billhg ='" + hgId + "' ");
|
||||
params.put("billhg", hgId);
|
||||
}
|
||||
|
||||
sb.append(" group by a.billid,a.billin,a.billhg,a.account,a.accountname,a.product,a.productname");
|
||||
|
||||
LOG.info("queryJcProduct>>>SQL>>>{}", sb.toString());
|
||||
|
||||
List<JcProduct> lsit = jdbcTemplate.query(sb.toString(), new BeanPropertyRowMapper<JcProduct>(JcProduct.class));
|
||||
|
||||
return lsit;
|
||||
}catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JcProductBillSouce> queryJcProductBillSouce(List<String> billIds) throws RuntimeException {
|
||||
try {
|
||||
Map<String,Object> params = new HashMap<String, Object>();
|
||||
StringBuffer sb = new StringBuffer(" select indexno,billid,account,product,goodsid from jc_billsource_item a ");
|
||||
|
||||
if(billIds != null && billIds.size() >= 1) {
|
||||
StringBuffer idIn = new StringBuffer();
|
||||
for(String key : billIds){
|
||||
idIn.append("'" + key + "',");
|
||||
}
|
||||
String idIns = idIn.toString().substring(0, idIn.length() - 1);
|
||||
|
||||
sb.append(params.size() > 0 ?" and ":" where ");
|
||||
sb.append(" a.billid in (" + idIns + ") ");
|
||||
params.put("id", idIn);
|
||||
}
|
||||
|
||||
LOG.info("queryJcProductBillSouce>>>SQL>>>{}", sb.toString());
|
||||
|
||||
List<JcProductBillSouce> lsit = jdbcTemplate.query(sb.toString(), new BeanPropertyRowMapper<JcProductBillSouce>(JcProductBillSouce.class));
|
||||
|
||||
return lsit;
|
||||
}catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JcProduct> queryJcProduct(String product, String stockInId) throws RuntimeException {
|
||||
try {
|
||||
Map<String,Object> params = new HashMap<String, Object>();
|
||||
StringBuffer sb = new StringBuffer(" select a.billid,a.billin,a.billhg,a.account,a.accountname,a.product,a.productname,");
|
||||
sb.append(" sum(a.quantity) as quantity ,sum(a.numbers) as numbers,b.goodsid,");
|
||||
sb.append(" (select h.wdtbillout from jc_billhg h where h.billid = a.billid and h.id = a.billhg) as wdtbillout");
|
||||
sb.append(" from jc_billin_item a");
|
||||
sb.append(" left join jc_billsource_item b on a.billid = b.billid and a.account = b.account and a.product = b.product ");
|
||||
|
||||
if(StringUtils.isNotBlank(product)) {
|
||||
sb.append(params.size() > 0 ?" and ":" where ");
|
||||
// sb.append(" a.product ='" + product + "' ");
|
||||
sb.append(" a.billid in (select jbi.billid from jc_billsource_item jbi where jbi.goodsid ='" + product + "' and jbi.status = 3) ");
|
||||
params.put("product", product);
|
||||
}
|
||||
if(StringUtils.isNotBlank(stockInId)) {
|
||||
sb.append(params.size() > 0 ?" and ":" where ");
|
||||
sb.append(" a.billin ='" + stockInId + "' ");
|
||||
params.put("billin", stockInId);
|
||||
}
|
||||
|
||||
sb.append(" group by a.billid,a.billin,a.billhg,a.account,a.accountname,a.product,a.productname,b.goodsid");
|
||||
|
||||
LOG.info("queryJcProduct>>>SQL>>>{}", sb.toString());
|
||||
|
||||
List<JcProduct> lsit = jdbcTemplate.query(sb.toString(), new BeanPropertyRowMapper<JcProduct>(JcProduct.class));
|
||||
|
||||
return lsit;
|
||||
}catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JcBillHg> qeryJcBillHgs(List<String> billids) throws RuntimeException {
|
||||
try {
|
||||
Map<String,Object> params = new HashMap<String, Object>();
|
||||
StringBuffer sql = new StringBuffer("select id, version, billid, status, source,");
|
||||
sql.append(" account, accountname, quantity, subtotal, freight,");
|
||||
sql.append(" manager, managername, consignee, consigneephone, province,");
|
||||
sql.append(" provincename, city, cityname, area, areaname,");
|
||||
sql.append(" address, receiveway, remark, remark1, salearea,");
|
||||
sql.append(" saleareaname, groupid, groupname, logisticsname, logisticscode,");
|
||||
sql.append(" logisticstype, logisticsno, found, foundname,");
|
||||
sql.append(" founddt, submit, submitname, submitdt, audit,");
|
||||
sql.append(" auditname, auditdt, dt, fhwarehouse, fhwarehousename,");
|
||||
sql.append(" wdtorder, wdtbillout, wdtbillouttyp");
|
||||
sql.append(" from jc_billhg a");
|
||||
|
||||
if(billids != null && billids.size() >= 1) {
|
||||
StringBuffer idIn = new StringBuffer();
|
||||
for(String key : billids){
|
||||
idIn.append("'" + key + "',");
|
||||
}
|
||||
String idIns = idIn.toString().substring(0, idIn.length() - 1);
|
||||
|
||||
sql.append(params.size() > 0 ?" and ":" where ");
|
||||
sql.append(" a.billid in (" + idIns + ") ");
|
||||
params.put("billid", idIn);
|
||||
}
|
||||
|
||||
LOG.info("qeryJcBillHgs>>>SQL>>>{}", sql.toString());
|
||||
|
||||
List<JcBillHg> lsit = jdbcTemplate.query(sql.toString(), new BeanPropertyRowMapper<JcBillHg>(JcBillHg.class));
|
||||
|
||||
return lsit;
|
||||
}catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException(e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
+416
@@ -0,0 +1,416 @@
|
||||
package abacus.springboot.example.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import javax.persistence.PersistenceContext;
|
||||
import javax.persistence.Query;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.abacus.pms.dao.Account;
|
||||
import com.abacus.pms.dao.Brand;
|
||||
import com.abacus.pms.dao.MoreCategory;
|
||||
import com.abacus.pms.dao.Product;
|
||||
import com.abacus.pms.dao.Spec;
|
||||
import com.abacus.xpos.foundation.dao.BaseArea;
|
||||
import com.abacus.xpos.foundation.dao.Dept;
|
||||
import com.abacus.xpos.foundation.dao.Employee;
|
||||
|
||||
import abacus.config.dao.AbacusConfigItem;
|
||||
import abacus.springboot.example.dao.JcBill;
|
||||
import abacus.springboot.example.pi.AutoCompleteAccessIF;
|
||||
|
||||
/**
|
||||
* <p>Title:ApiJcBillAccess</p>
|
||||
<p>Description: 底层实现</p>
|
||||
@author chuanZeng
|
||||
@date 2026年8月18日
|
||||
*/
|
||||
@Repository("autoCompleteAccess")
|
||||
public class AutoCompleteAccess extends MyJpaUtils implements AutoCompleteAccessIF {
|
||||
|
||||
private final static Log LOG = LogFactory.getLog(AutoCompleteAccess.class);
|
||||
|
||||
@PersistenceContext
|
||||
private EntityManager entityManager;
|
||||
|
||||
@Autowired
|
||||
private JdbcTemplate jdbcTemplate;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public List<Product> prductAutoComplete(String keyCode, List<String> areaIds) throws Exception {
|
||||
try {
|
||||
Map<String,Object> params = new HashMap<String, Object>();
|
||||
|
||||
StringBuffer sql = new StringBuffer("from Product ");
|
||||
if(StringUtils.isNotBlank(keyCode)){
|
||||
sql.append(params.size() > 0 ? " and " : " where ");
|
||||
sql.append(" (lower(name) like lower('%" + keyCode.replaceAll("'", "") + "%')");
|
||||
sql.append(" or lower(id) like lower('%" + keyCode.replaceAll("'", "") + "%')");
|
||||
sql.append(" or lower(shortstring) like lower('%" + keyCode.replaceAll("'", "") + "%'))");
|
||||
params.put("id", keyCode);
|
||||
}
|
||||
|
||||
// if(!areaIds.isEmpty()){
|
||||
// sql.append(params.size() > 0 ? " and " : " where ");
|
||||
// sql.append(" areaid in (:areaid) ");
|
||||
// params.put("areaid", areaIds);
|
||||
// }
|
||||
|
||||
Query query = this.entityManager.createQuery(sql.toString(), Product.class);
|
||||
|
||||
// setParameters(query, params);
|
||||
|
||||
List<Product> products = query.getResultList();
|
||||
|
||||
return products;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
LOG.error(e.getMessage(), e);
|
||||
throw new Exception(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public List<Dept> deptAutoComplete(String keyCode, String type) throws Exception {
|
||||
try {
|
||||
Map<String,Object> params = new HashMap<String, Object>();
|
||||
|
||||
StringBuffer sql = new StringBuffer("from Dept");
|
||||
if(StringUtils.isNotBlank(keyCode)){
|
||||
sql.append(params.size() > 0 ? " and " : " where ");
|
||||
sql.append(" (lower(name) like lower(:name)");
|
||||
sql.append(" or lower(id) like lower(:id)");
|
||||
sql.append(" or lower(shortString) like lower(:shortstring))");
|
||||
|
||||
params.put("name","%"+keyCode+"%");
|
||||
params.put("id","%"+keyCode+"%");
|
||||
params.put("shortstring","%"+keyCode+"%");
|
||||
}
|
||||
|
||||
if(StringUtils.isNotBlank(type)){
|
||||
sql.append(params.size() > 0 ? " and " : " where ");
|
||||
sql.append(" typ = :typ ");
|
||||
params.put("typ", Integer.parseInt(type));
|
||||
}
|
||||
|
||||
Query query = this.entityManager.createQuery(sql.toString(), Dept.class);
|
||||
|
||||
setParameters(query, params);
|
||||
|
||||
return new ArrayList<Dept>(query.getResultList());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
LOG.error(e.getMessage(), e);
|
||||
throw new Exception(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public List<MoreCategory> moreCategoryAutoComplete(String keyCode, String areaid, String levels, String lastlevel)
|
||||
throws Exception {
|
||||
try {
|
||||
Map<String,Object> params = new HashMap<String, Object>();
|
||||
|
||||
StringBuffer sql = new StringBuffer("from MoreCategory");
|
||||
if(StringUtils.isNotBlank(keyCode)){
|
||||
sql.append(params.size() > 0 ? " and " : " where ");
|
||||
sql.append(" (lower(name) like lower(:name)");
|
||||
sql.append(" or lower(id) like lower(:id))");
|
||||
|
||||
params.put("name","%"+keyCode+"%");
|
||||
params.put("id","%"+keyCode+"%");
|
||||
}
|
||||
|
||||
if(StringUtils.isNotBlank(areaid)){
|
||||
sql.append(params.size() > 0 ? " and " : " where ");
|
||||
sql.append(" areaid = :areaid ");
|
||||
params.put("areaid", areaid);
|
||||
}
|
||||
|
||||
if(StringUtils.isNotBlank(levels)){
|
||||
sql.append(params.size() > 0 ? " and " : " where ");
|
||||
sql.append(" levels = :levels ");
|
||||
params.put("levels", Integer.parseInt(levels));
|
||||
}
|
||||
|
||||
if(StringUtils.isNotBlank(lastlevel)){
|
||||
sql.append(params.size() > 0 ? " and " : " where ");
|
||||
sql.append(" lastlevel = :lastlevel ");
|
||||
params.put("lastlevel", Integer.parseInt(lastlevel));
|
||||
}
|
||||
|
||||
Query query = this.entityManager.createQuery(sql.toString(), MoreCategory.class);
|
||||
|
||||
setParameters(query, params);
|
||||
|
||||
return new ArrayList<MoreCategory>(query.getResultList());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
LOG.error(e.getMessage(), e);
|
||||
throw new Exception(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public List<Brand> brandAutoComplete(String keyCode, String areaid, String levels, String lastlevel)
|
||||
throws Exception {
|
||||
try {
|
||||
Map<String,Object> params = new HashMap<String, Object>();
|
||||
|
||||
StringBuffer sql = new StringBuffer("from Brand");
|
||||
if(StringUtils.isNotBlank(keyCode)){
|
||||
sql.append(params.size() > 0 ? " and " : " where ");
|
||||
sql.append(" (lower(name) like lower(:name)");
|
||||
sql.append(" or lower(id) like lower(:id))");
|
||||
|
||||
params.put("name","%"+keyCode+"%");
|
||||
params.put("id","%"+keyCode+"%");
|
||||
}
|
||||
|
||||
if(StringUtils.isNotBlank(areaid)){
|
||||
sql.append(params.size() > 0 ? " and " : " where ");
|
||||
sql.append(" areaid = :areaid ");
|
||||
params.put("areaid", areaid);
|
||||
}
|
||||
|
||||
if(StringUtils.isNotBlank(levels)){
|
||||
sql.append(params.size() > 0 ? " and " : " where ");
|
||||
sql.append(" levels = :levels ");
|
||||
params.put("levels", Integer.parseInt(levels));
|
||||
}
|
||||
|
||||
if(StringUtils.isNotBlank(lastlevel)){
|
||||
sql.append(params.size() > 0 ? " and " : " where ");
|
||||
sql.append(" lastlevel = :lastlevel ");
|
||||
params.put("lastlevel", Integer.parseInt(lastlevel));
|
||||
}
|
||||
|
||||
Query query = this.entityManager.createQuery(sql.toString(), Brand.class);
|
||||
|
||||
setParameters(query, params);
|
||||
|
||||
return new ArrayList<Brand>(query.getResultList());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
LOG.error(e.getMessage(), e);
|
||||
throw new Exception(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public List<Spec> specAutoComplete(String keyCode, String areaid) throws Exception {
|
||||
try {
|
||||
Map<String,Object> params = new HashMap<String, Object>();
|
||||
|
||||
StringBuffer sql = new StringBuffer("from Spec ");
|
||||
if(StringUtils.isNotBlank(keyCode)){
|
||||
sql.append(params.size() > 0 ? " and " : " where ");
|
||||
sql.append(" (lower(name) like lower('%" + keyCode.replaceAll("'", "") + "%')");
|
||||
sql.append(" or lower(id) like lower('%" + keyCode.replaceAll("'", "") + "%'))");
|
||||
}
|
||||
|
||||
if(StringUtils.isNotBlank(areaid)){
|
||||
sql.append(params.size() > 0 ? " and " : " where ");
|
||||
sql.append(" areaid = :areaid ");
|
||||
params.put("areaid", areaid);
|
||||
}
|
||||
|
||||
Query query = this.entityManager.createQuery(sql.toString(), Spec.class);
|
||||
|
||||
setParameters(query, params);
|
||||
|
||||
return new ArrayList<Spec>(query.getResultList());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
LOG.error(e.getMessage(), e);
|
||||
throw new Exception(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public List<Account> accountAutoComplete(String keyCode, String areaid) throws Exception {
|
||||
try {
|
||||
Map<String,Object> params = new HashMap<String, Object>();
|
||||
|
||||
StringBuffer sql = new StringBuffer("from Account");
|
||||
if(StringUtils.isNotBlank(keyCode)){
|
||||
sql.append(params.size() > 0 ? " and " : " where ");
|
||||
sql.append(" (lower(name) like lower(:name)");
|
||||
sql.append(" or lower(id) like lower(:id)");
|
||||
sql.append(" or lower(shortString) like lower(:shortstring))");
|
||||
|
||||
params.put("name","%"+keyCode+"%");
|
||||
params.put("id","%"+keyCode+"%");
|
||||
params.put("shortstring","%"+keyCode+"%");
|
||||
}
|
||||
|
||||
if(StringUtils.isNotBlank(areaid)){
|
||||
sql.append(params.size() > 0 ? " and " : " where ");
|
||||
sql.append(" areaid = :areaid ");
|
||||
params.put("areaid", areaid);
|
||||
}
|
||||
|
||||
Query query = this.entityManager.createQuery(sql.toString(), Account.class);
|
||||
|
||||
setParameters(query, params);
|
||||
|
||||
return new ArrayList<Account>(query.getResultList());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
LOG.error(e.getMessage(), e);
|
||||
throw new Exception(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public List<Employee> employeeAutoComplete(String keyCode) throws Exception {
|
||||
try {
|
||||
Map<String,Object> params = new HashMap<String, Object>();
|
||||
|
||||
StringBuffer sql = new StringBuffer("from Employee");
|
||||
if(StringUtils.isNotBlank(keyCode)){
|
||||
sql.append(params.size() > 0 ? " and " : " where ");
|
||||
sql.append(" (lower(name) like lower(:name)");
|
||||
sql.append(" or lower(id) like lower(:id)");
|
||||
sql.append(" or lower(shortString) like lower(:shortstring))");
|
||||
|
||||
params.put("name","%"+keyCode+"%");
|
||||
params.put("id","%"+keyCode+"%");
|
||||
params.put("shortstring","%"+keyCode+"%");
|
||||
}
|
||||
|
||||
|
||||
Query query = this.entityManager.createQuery(sql.toString(), Employee.class);
|
||||
|
||||
setParameters(query, params);
|
||||
|
||||
return new ArrayList<Employee>(query.getResultList());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
LOG.error(e.getMessage(), e);
|
||||
throw new Exception(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public List<JcBill> jcBillAutoComplete(String keyCode) throws Exception {
|
||||
try {
|
||||
Map<String,Object> params = new HashMap<String, Object>();
|
||||
|
||||
StringBuffer sql = new StringBuffer("from JcBill ");
|
||||
if(StringUtils.isNotBlank(keyCode)){
|
||||
sql.append(params.size() > 0 ? " and " : " where ");
|
||||
sql.append(" lower(id) like lower('%" + keyCode.replaceAll("'", "") + "%')");
|
||||
params.put("id", keyCode);
|
||||
}
|
||||
|
||||
Query query = this.entityManager.createQuery(sql.toString(), JcBill.class);
|
||||
|
||||
List<JcBill> products = query.getResultList();
|
||||
|
||||
return products;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
LOG.error(e.getMessage(), e);
|
||||
throw new Exception(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public List<AbacusConfigItem> abacusConfigItemGroupAutoComplete(String keyCode, String keyGroup, String key) throws Exception {
|
||||
try {
|
||||
|
||||
Map<String,Object> params = new HashMap<String, Object>();
|
||||
|
||||
StringBuffer sql = new StringBuffer("from AbacusConfigItem");
|
||||
if(StringUtils.isNotBlank(keyCode)){
|
||||
sql.append(params.size() > 0 ? " and " : " where ");
|
||||
sql.append(" (lower(code) like lower(:code)");
|
||||
sql.append(" or lower(name) like lower(:name))");
|
||||
|
||||
params.put("code","%"+keyCode+"%");
|
||||
params.put("name","%"+keyCode+"%");
|
||||
}
|
||||
|
||||
if(StringUtils.isNotBlank(keyGroup)){
|
||||
sql.append(params.size() > 0 ? " and " : " where ");
|
||||
sql.append(" keyGroup = :keyGroup ");
|
||||
params.put("keyGroup", keyGroup);
|
||||
}
|
||||
if(StringUtils.isNotBlank(key)){
|
||||
sql.append(params.size() > 0 ? " and " : " where ");
|
||||
sql.append(" key = :key ");
|
||||
params.put("key", key);
|
||||
}
|
||||
|
||||
Query query = this.entityManager.createQuery(sql.toString(), AbacusConfigItem.class);
|
||||
|
||||
setParameters(query, params);
|
||||
|
||||
return new ArrayList<AbacusConfigItem>(query.getResultList());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
LOG.error(e.getMessage(), e);
|
||||
throw new Exception(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Map<String, String>> getGovbs() throws Exception {
|
||||
try {
|
||||
Map<String, Map<String, String>> map = new HashMap<String, Map<String, String>>();
|
||||
|
||||
String sql = "select city, id, name from basearea order by id desc offset 0 rows fetch next 3000 rows only ";
|
||||
List<BaseArea> lists = jdbcTemplate.query(sql, new BeanPropertyRowMapper<BaseArea>(BaseArea.class));
|
||||
|
||||
if(lists!=null&&!lists.isEmpty()){
|
||||
for(BaseArea obj:lists){
|
||||
Map<String, String> mapb = map.get(obj.getCity());
|
||||
if(mapb==null){
|
||||
mapb = new HashMap<String, String>();
|
||||
map.put(obj.getCity(), mapb);
|
||||
}
|
||||
mapb.put(obj.getId(), obj.getName());
|
||||
}
|
||||
}
|
||||
|
||||
return map;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
LOG.error(e.getMessage(), e);
|
||||
throw new Exception(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+670
@@ -0,0 +1,670 @@
|
||||
package abacus.springboot.example.impl;
|
||||
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import javax.persistence.PersistenceContext;
|
||||
import javax.persistence.Query;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageImpl;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.jdbc.core.BatchPreparedStatementSetter;
|
||||
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import abacus.springboot.example.dao.JcBill;
|
||||
import abacus.springboot.example.dao.JcBillHg;
|
||||
import abacus.springboot.example.dao.JcBillPhoto;
|
||||
import abacus.springboot.example.dao.JcBillSourceItem;
|
||||
import abacus.springboot.example.dao.JcSourceItem;
|
||||
import abacus.springboot.example.pi.JcBillAccessIF;
|
||||
import abacus.springboot.example.util.DateUtil;
|
||||
import abacus.springboot.example.vo.BaiduToken;
|
||||
import abacus.springboot.example.vo.SiDepositlocation;
|
||||
|
||||
/**
|
||||
* <p>Title:ApiJcBillAccess</p>
|
||||
<p>Description: 底层实现</p>
|
||||
@author chuanZeng
|
||||
@date 2026年8月18日
|
||||
*/
|
||||
@Repository
|
||||
public class JcBillAccess extends MyJpaUtils implements JcBillAccessIF {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(JcBillAccess.class);
|
||||
|
||||
@Autowired
|
||||
private JdbcTemplate jdbcTemplate;
|
||||
|
||||
@PersistenceContext
|
||||
private EntityManager em;
|
||||
|
||||
@Override
|
||||
public List<JcBillPhoto> queryJcBillPhoto(String srcid, String srcitemid, String typephoto)
|
||||
throws RuntimeException {
|
||||
try {
|
||||
Map<String,Object> params = new HashMap<String, Object>();
|
||||
List<Object> args = new ArrayList<Object>();
|
||||
StringBuffer sb = new StringBuffer("select id, version, srcid, srcitemid, typephoto, urlphoto, dt from jc_bill_photo a");
|
||||
|
||||
if(StringUtils.isNotBlank(srcid)) {
|
||||
sb.append(params.size() > 0 ?" and ":" where ");
|
||||
sb.append(" a.srcid = ? ");
|
||||
args.add(srcid);
|
||||
params.put("srcid", srcid);
|
||||
}
|
||||
if(StringUtils.isNotBlank(srcitemid)) {
|
||||
sb.append(params.size() > 0 ?" and ":" where ");
|
||||
sb.append(" a.srcitemid = ? ");
|
||||
args.add(srcitemid);
|
||||
params.put("srcitemid", srcitemid);
|
||||
}
|
||||
if(StringUtils.isNotBlank(typephoto)) {
|
||||
sb.append(params.size() > 0 ?" and ":" where ");
|
||||
sb.append(" a.typephoto = ? ");
|
||||
args.add(typephoto);
|
||||
params.put("typephoto", typephoto);
|
||||
}
|
||||
|
||||
LOG.info("queryJcBillPhoto>>>SQL>>>{}", sb.toString());
|
||||
|
||||
List<JcBillPhoto> lists = jdbcTemplate.query( sb.toString(), args.toArray(), new BeanPropertyRowMapper<JcBillPhoto>(JcBillPhoto.class));
|
||||
|
||||
return lists;
|
||||
}catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public List<JcBillPhoto> queryJcBillPhotoIn(List<String> srcids) throws RuntimeException {
|
||||
try {
|
||||
Map<String,Object> params = new HashMap<String, Object>();
|
||||
List<Object> args = new ArrayList<Object>();
|
||||
StringBuffer sb = new StringBuffer("select id, version, srcid, srcitemid, typephoto, urlphoto, dt from jc_bill_photo a");
|
||||
|
||||
if(srcids != null && srcids.size() >= 1) {
|
||||
sb.append(params.size() > 0 ?" and ":" where ");
|
||||
sb.append(" a.srcid in (");
|
||||
for(int i = 0; i < srcids.size(); i++){
|
||||
if(i > 0) sb.append(",");
|
||||
sb.append("?");
|
||||
args.add(srcids.get(i));
|
||||
}
|
||||
sb.append(") ");
|
||||
}
|
||||
|
||||
LOG.info("queryJcBillPhotoIn>>>SQL>>>{}", sb.toString());
|
||||
|
||||
List<JcBillPhoto> lists = jdbcTemplate.query( sb.toString(), args.toArray(), new BeanPropertyRowMapper<JcBillPhoto>(JcBillPhoto.class));
|
||||
|
||||
return lists;
|
||||
}catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateJcBill(JcBill bill) throws RuntimeException {
|
||||
try {
|
||||
List<Object> args = new ArrayList<Object>();
|
||||
StringBuffer sql = new StringBuffer(" update jc_bill ");
|
||||
sql.append(" set status = ?,");
|
||||
sql.append(" warehouse = ?,");
|
||||
sql.append(" warehousename = ?,");
|
||||
sql.append(" receivedt = ?,");
|
||||
sql.append(" quantity = ?,");
|
||||
sql.append(" subtotal = ?,");
|
||||
sql.append(" applicant = ?,");
|
||||
sql.append(" applicantname = ?,");
|
||||
sql.append(" applicantdt = ?");
|
||||
sql.append(" where id = ?");
|
||||
|
||||
args.add(bill.getStatus());
|
||||
args.add(bill.getWarehouse());
|
||||
args.add(bill.getWarehousename());
|
||||
args.add(bill.getReceivedt());
|
||||
args.add(bill.getQuantity());
|
||||
args.add(bill.getSubtotal());
|
||||
args.add(bill.getApplicant());
|
||||
args.add(bill.getApplicantname());
|
||||
args.add(DateUtil.formatDateTime(bill.getApplicantdt()));
|
||||
args.add(bill.getId());
|
||||
|
||||
this.jdbcTemplate.update(sql.toString(), args.toArray());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateJcBillSourceItem(List<JcBillSourceItem> items) throws RuntimeException {
|
||||
try {
|
||||
String sql = "update jc_billsource_item set recsource = ?, recplatform = ?, channel = ?, price = ?, quantity = ?,"
|
||||
+ " numbers = ?, subtotal = ?, goodsid = ?, logisticsid = ?"
|
||||
+ " where id = ?";
|
||||
|
||||
this.jdbcTemplate.batchUpdate(sql, new BatchPreparedStatementSetter() {
|
||||
|
||||
public void setValues(PreparedStatement ps, int i) throws SQLException {
|
||||
JcBillSourceItem item = items.get(i);
|
||||
ps.setString(1, item.getRecsource());
|
||||
ps.setString(2, item.getRecplatform());
|
||||
ps.setString(3, item.getChannel());
|
||||
ps.setDouble(4, item.getPrice());
|
||||
ps.setDouble(5, item.getQuantity());
|
||||
|
||||
ps.setDouble(6, item.getNumbers());
|
||||
ps.setDouble(7, item.getSubtotal());
|
||||
ps.setString(8, item.getGoodsid());
|
||||
ps.setString(9, item.getLogisticsid());
|
||||
|
||||
ps.setLong(10, item.getId());
|
||||
|
||||
}
|
||||
|
||||
public int getBatchSize() {
|
||||
return items.size();
|
||||
}
|
||||
});
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateJcBillPhoto(List<JcBillPhoto> photos) throws RuntimeException {
|
||||
try {
|
||||
String sql = "update jc_bill_photo set urlphoto = ?, dt = ? where srcid = ? and srcitemid = ? and typephoto = ?";
|
||||
|
||||
this.jdbcTemplate.batchUpdate(sql, new BatchPreparedStatementSetter() {
|
||||
|
||||
public void setValues(PreparedStatement ps, int i) throws SQLException {
|
||||
JcBillPhoto item = photos.get(i);
|
||||
ps.setString(1, item.getUrlphoto());
|
||||
ps.setDate(2, new java.sql.Date(item.getDt().getTime()));
|
||||
ps.setString(3, item.getSrcid());
|
||||
ps.setString(4, item.getSrcitemid());
|
||||
ps.setString(5, item.getTypephoto());
|
||||
|
||||
}
|
||||
|
||||
public int getBatchSize() {
|
||||
return photos.size();
|
||||
}
|
||||
});
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int countJcBillItemIndexno(String billId) throws RuntimeException {
|
||||
try {
|
||||
StringBuffer sb = new StringBuffer(" select max(indexno) from jc_billsource_item a where a.billid = ?");
|
||||
|
||||
Query q = this.em.createNativeQuery(sb.toString()).setParameter(1, billId);
|
||||
|
||||
return q.getSingleResult() == null ? 0 : Integer.valueOf(q.getSingleResult().toString());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String lastBillHgId() throws RuntimeException {
|
||||
try {
|
||||
StringBuffer sb = new StringBuffer(" select top 1 id from jc_billhg a where a.status = 1 order by founddt asc ");
|
||||
|
||||
List<JcBill> lists = jdbcTemplate.query(sb.toString(), new BeanPropertyRowMapper<JcBill>(JcBill.class));
|
||||
|
||||
return (lists != null && lists.size() >= 1) ? lists.get(0).getId() : "";
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JcSourceItem> queryJcSourceItemByBillId(String billId) {
|
||||
try {
|
||||
Map<String,Object> params = new HashMap<String, Object>();
|
||||
List<Object> args = new ArrayList<Object>();
|
||||
StringBuffer sb = new StringBuffer("select id, version, indexno, billid, srcitemid,");
|
||||
sb.append(" goodsid, logisticsid, billout, billoutdt, billoutwh,");
|
||||
sb.append(" billoutwhname, product, productname, account, accountname,");
|
||||
sb.append(" operator, operatorname, groupid, groupname, salearea,");
|
||||
sb.append(" saleareaname, source, dt");
|
||||
sb.append(" from jc_source_item a");
|
||||
|
||||
if(StringUtils.isNotBlank(billId)) {
|
||||
sb.append(params.size() > 0 ?" and ":" where ");
|
||||
sb.append(" a.billid = ? ");
|
||||
args.add(billId);
|
||||
params.put("billId", billId);
|
||||
}
|
||||
|
||||
LOG.info("queryJcSourceItemByBillId>>>SQL>>>{}", sb.toString());
|
||||
|
||||
List<JcSourceItem> lists = jdbcTemplate.query( sb.toString(), args.toArray(), new BeanPropertyRowMapper<JcSourceItem>(JcSourceItem.class));
|
||||
|
||||
return lists;
|
||||
}catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteJcSourceItemBySource(String billId) throws RuntimeException {
|
||||
try {
|
||||
StringBuffer sb = new StringBuffer(" delete from jc_source_item where billid = ? and source in ('业务中台', '二维码')");
|
||||
|
||||
LOG.info("deleteJcSourceItemBySource>>>SQL>>>{}", sb.toString());
|
||||
|
||||
jdbcTemplate.update(sb.toString(), billId);
|
||||
|
||||
}catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<JcBill> queryJcBill(String fromDate, String thruDate, String applicant, String goods, String id,
|
||||
String billin, String goodsid, String product, String status, int typ, Pageable pageable) throws RuntimeException {
|
||||
try {
|
||||
Map<String,Object> params = new HashMap<String, Object>();
|
||||
List<Object> args = new ArrayList<Object>();
|
||||
StringBuffer sb = new StringBuffer("");
|
||||
|
||||
if(StringUtils.isNotBlank(fromDate)) {
|
||||
sb.append(params.size() > 0 ? " and ":" where ");
|
||||
sb.append(" a.applicantdt >= ? ");
|
||||
args.add(fromDate);
|
||||
params.put("fromDate", fromDate);
|
||||
}
|
||||
if(StringUtils.isNotBlank(thruDate)) {
|
||||
sb.append(params.size() > 0 ? " and ":" where ");
|
||||
sb.append(" a.applicantdt <= ? ");
|
||||
args.add(thruDate);
|
||||
params.put("thruDate", thruDate);
|
||||
}
|
||||
if(StringUtils.isNotBlank(applicant)) {
|
||||
sb.append(params.size() > 0 ? " and ":" where ");
|
||||
sb.append(" a.applicant = ? ");
|
||||
args.add(applicant);
|
||||
params.put("applicant", applicant);
|
||||
}
|
||||
if(StringUtils.isNotBlank(goods)) {
|
||||
sb.append(params.size() > 0 ? " and ":" where ");
|
||||
sb.append(" a.goods = ? ");
|
||||
args.add(goods);
|
||||
params.put("goods", goods);
|
||||
}
|
||||
if(StringUtils.isNotBlank(id)) {
|
||||
sb.append(params.size() > 0 ? " and ":" where ");
|
||||
sb.append(" a.id = ? ");
|
||||
args.add(id);
|
||||
params.put("id", id);
|
||||
}
|
||||
if(StringUtils.isNotBlank(billin)) {
|
||||
sb.append(params.size() > 0 ? " and ":" where ");
|
||||
sb.append(" a.billin = ? ");
|
||||
args.add(billin);
|
||||
params.put("billin", billin);
|
||||
}
|
||||
if(StringUtils.isNotBlank(status)) {
|
||||
if(typ == 1) {
|
||||
sb.append(params.size() > 0 ? " and ":" where ");
|
||||
sb.append(" a.status = ? ");
|
||||
args.add(Integer.parseInt(status));
|
||||
params.put("status", Integer.parseInt(status));
|
||||
} else {
|
||||
|
||||
if("1".equals(status) || "2".equals(status)) {
|
||||
sb.append(params.size() > 0 ? " and ":" where ");
|
||||
sb.append(" a.hgstatus = ? ");
|
||||
args.add(Integer.parseInt(status));
|
||||
params.put("hgstatus", Integer.parseInt(status));
|
||||
} else {
|
||||
sb.append(params.size() > 0 ? " and ":" where ");
|
||||
sb.append(" a.status = ? ");
|
||||
args.add(Integer.parseInt(status));
|
||||
params.put("status", Integer.parseInt(status));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}else {
|
||||
if(typ == 1) {
|
||||
sb.append(params.size() > 0 ? " and ":" where ");
|
||||
sb.append(" a.status in (-3, -2, 2, 3, 4, 5) ");
|
||||
params.put("status", status);
|
||||
} else {
|
||||
sb.append(params.size() > 0 ? " and ":" where ");
|
||||
sb.append(" (a.status in (3, 4, 5) or a.hgstatus in (1, 2))");
|
||||
params.put("status", status);
|
||||
}
|
||||
}
|
||||
if(StringUtils.isNotBlank(goodsid)) {
|
||||
sb.append(params.size() > 0 ? " and ":" where ");
|
||||
sb.append(" a.id in (select b.billid from jc_billsource_item b where b.goods like ? ) ");
|
||||
args.add("%" + goodsid + "%");
|
||||
params.put("goodsid", goodsid);
|
||||
}
|
||||
if(StringUtils.isNotBlank(product)) {
|
||||
sb.append(params.size() > 0 ? " and ":" where ");
|
||||
sb.append(" a.id in (select b.billid from jc_billsource_item b where b.product = ? ) ");
|
||||
args.add(product);
|
||||
params.put("product", product);
|
||||
}
|
||||
|
||||
StringBuffer orderBy = new StringBuffer("");
|
||||
|
||||
orderBy.append(" order by dt desc ");
|
||||
|
||||
orderBy.append(" offset "+ (pageable.getPageNumber() * pageable.getPageSize()) + " rows fetch next "+ pageable.getPageSize() + " rows only ");
|
||||
|
||||
|
||||
StringBuffer sql = new StringBuffer("select id, version, status, hgstatus, goods, warehouse, warehousename,");
|
||||
sql.append(" receivedt, quantity, subtotal, billin, billindt, applicant, applicantname, applicantdt, dt");
|
||||
sql.append(" from jc_bill a ");
|
||||
sql.append(sb.toString());
|
||||
sql.append(orderBy.toString());
|
||||
|
||||
LOG.info("queryJcBill>>>SQL>>>{}", sql.toString());
|
||||
|
||||
List<JcBill> lists = jdbcTemplate.query(sql.toString(), args.toArray(), new BeanPropertyRowMapper<JcBill>(JcBill.class));
|
||||
|
||||
Long count = jdbcTemplate.queryForObject("select count(a.id) from jc_bill a " + sb.toString(), args.toArray(), Long.class);
|
||||
|
||||
Page<JcBill> scorePage = new PageImpl<JcBill>(lists, pageable, count);
|
||||
return scorePage;
|
||||
}catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveEvent(String srcid, String typ, String billtyp) throws RuntimeException {
|
||||
try {
|
||||
String sql="insert into si_siwdevent(srcid, typ, billtyp, deptid, stauts,"
|
||||
+ " node, remake, dt, inputdate)"
|
||||
+ " values (?, ?, ?, ?, ?,"
|
||||
+ " ?, ?, ?, ?) ";
|
||||
Query query = em.createNativeQuery(sql);
|
||||
query.setParameter(1, srcid);
|
||||
query.setParameter(2, typ);
|
||||
query.setParameter(3, billtyp);
|
||||
query.setParameter(4, "");
|
||||
query.setParameter(5, 0);
|
||||
|
||||
query.setParameter(6, 0);
|
||||
query.setParameter(7, "");
|
||||
query.setParameter(8, new Date());
|
||||
query.setParameter(9, new Date());
|
||||
query.executeUpdate();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<JcBillHg> queryJcBillHg(String fromDate, String thruDate, String account, String salearea, String id,
|
||||
String billId, String status, String product, String manager, int typ, Pageable pageable)
|
||||
throws RuntimeException {
|
||||
try {
|
||||
Map<String,Object> params = new HashMap<String, Object>();
|
||||
List<Object> args = new ArrayList<Object>();
|
||||
StringBuffer sb = new StringBuffer("");
|
||||
|
||||
if(StringUtils.isNotBlank(fromDate)) {
|
||||
sb.append(params.size() > 0 ? " and ":" where ");
|
||||
sb.append(" a.founddt >= ? ");
|
||||
args.add(fromDate);
|
||||
params.put("fromDate", fromDate);
|
||||
}
|
||||
if(StringUtils.isNotBlank(thruDate)) {
|
||||
sb.append(params.size() > 0 ? " and ":" where ");
|
||||
sb.append(" a.founddt <= ? ");
|
||||
args.add(thruDate);
|
||||
params.put("thruDate", thruDate);
|
||||
}
|
||||
if(StringUtils.isNotBlank(account)) {
|
||||
sb.append(params.size() > 0 ? " and ":" where ");
|
||||
sb.append(" a.account = ? ");
|
||||
args.add(account);
|
||||
params.put("account", account);
|
||||
}
|
||||
if(StringUtils.isNotBlank(salearea)) {
|
||||
sb.append(params.size() > 0 ? " and ":" where ");
|
||||
sb.append(" a.salearea = ? ");
|
||||
args.add(salearea);
|
||||
params.put("salearea", salearea);
|
||||
}
|
||||
if(StringUtils.isNotBlank(id)) {
|
||||
sb.append(params.size() > 0 ? " and ":" where ");
|
||||
sb.append(" a.id = ? ");
|
||||
args.add(id);
|
||||
params.put("id", id);
|
||||
}
|
||||
if(StringUtils.isNotBlank(billId)) {
|
||||
sb.append(params.size() > 0 ? " and ":" where ");
|
||||
sb.append(" a.billid = ? ");
|
||||
args.add(billId);
|
||||
params.put("billId", billId);
|
||||
}
|
||||
if(StringUtils.isNotBlank(status)) {
|
||||
sb.append(params.size() > 0 ? " and ":" where ");
|
||||
sb.append(" a.status = ? ");
|
||||
args.add(Integer.parseInt(status));
|
||||
params.put("status", Integer.parseInt(status));
|
||||
} else {
|
||||
if(typ == 1) {
|
||||
sb.append(params.size() > 0 ? " and ":" where ");
|
||||
sb.append(" a.status in (1, 2, 3) ");
|
||||
params.put("status", status);
|
||||
} else {
|
||||
sb.append(params.size() > 0 ? " and ":" where ");
|
||||
sb.append(" a.status in (4, 5, 6) ");
|
||||
params.put("status", status);
|
||||
}
|
||||
}
|
||||
|
||||
if(StringUtils.isNotBlank(product)) {
|
||||
sb.append(params.size() > 0 ? " and ":" where ");
|
||||
sb.append(" a.id in (select b.billhg from jc_billin_item b where b.product = ? ) ");
|
||||
args.add(product);
|
||||
params.put("product", product);
|
||||
}
|
||||
if(StringUtils.isNotBlank(manager)) {
|
||||
sb.append(params.size() > 0 ? " and ":" where ");
|
||||
sb.append(" a.manager = ? ");
|
||||
args.add(manager);
|
||||
params.put("manager", manager);
|
||||
}
|
||||
|
||||
|
||||
StringBuffer orderBy = new StringBuffer("");
|
||||
|
||||
orderBy.append(" order by founddt desc ");
|
||||
|
||||
orderBy.append(" offset "+ (pageable.getPageNumber() * pageable.getPageSize()) + " rows fetch next "+ pageable.getPageSize() + " rows only ");
|
||||
|
||||
|
||||
StringBuffer sql = new StringBuffer("select id, version, billid, status, source,");
|
||||
sql.append(" account, accountname, quantity, subtotal, freight,");
|
||||
sql.append(" manager, managername, consignee, consigneephone, province,");
|
||||
sql.append(" provincename, city, cityname, area, areaname,");
|
||||
sql.append(" address, receiveway, remark, remark1, salearea,");
|
||||
sql.append(" saleareaname, groupid, groupname, logisticsname, logisticscode,");
|
||||
sql.append(" logisticstype, logisticsno, found, foundname,");
|
||||
sql.append(" founddt, submit, submitname, submitdt, audit,");
|
||||
sql.append(" auditname, auditdt, dt, fhwarehouse, fhwarehousename,");
|
||||
sql.append(" wdtorder, wdtbillout, wdtbillouttyp");
|
||||
sql.append(" ,(select b.status from jc_bill b where b.id = a.billid ) as jcstatus");
|
||||
sql.append(" from jc_billhg a");
|
||||
sql.append(sb.toString());
|
||||
sql.append(orderBy.toString());
|
||||
|
||||
LOG.info("queryJcBillHg>>>SQL>>>{}", sb.toString());
|
||||
|
||||
List<JcBillHg> lists = jdbcTemplate.query(sql.toString(), args.toArray(), new BeanPropertyRowMapper<JcBillHg>(JcBillHg.class));
|
||||
|
||||
Long count = jdbcTemplate.queryForObject("select count(a.id) from jc_billhg a " + sb.toString(), args.toArray(), Long.class);
|
||||
|
||||
Page<JcBillHg> scorePage = new PageImpl<JcBillHg>(lists, pageable, count);
|
||||
return scorePage;
|
||||
}catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteJcSourceItem(List<Long> ids) throws RuntimeException {
|
||||
if(ids==null||ids.isEmpty()) return;
|
||||
for(int i=0;i<ids.size();i+=500){
|
||||
int end=(i+500)>ids.size()?ids.size():(i+500);
|
||||
em.createNativeQuery("delete from jc_source_item where id in (:ids) ").setParameter("ids", ids.subList(i, end)).executeUpdate();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteJcBillPhoto(String srcid, String srcitemid, String type) throws RuntimeException {
|
||||
try {
|
||||
StringBuffer sb = new StringBuffer(" delete from jc_bill_photo where"
|
||||
+ " srcid = ?"
|
||||
// + " and srcitemid = ?"
|
||||
+ " and typephoto = ?");
|
||||
|
||||
LOG.info("deleteJcBillPhoto>>>SQL>>>{}", sb.toString());
|
||||
|
||||
jdbcTemplate.update(sb.toString(), srcid, type);
|
||||
}catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBaiduToken() throws RuntimeException {
|
||||
try {
|
||||
StringBuffer sb = new StringBuffer("select token from si_baidu_token");
|
||||
|
||||
List<BaiduToken> lists = jdbcTemplate.query(sb.toString(), new BeanPropertyRowMapper<BaiduToken>(BaiduToken.class));
|
||||
|
||||
return (lists != null && lists.size() >= 1) ? lists.get(0).getToken() : "";
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JcBillSourceItem> queryJcBillSourceItemInBillId(List<String> billIds) throws RuntimeException {
|
||||
try {
|
||||
Map<String,Object> params = new HashMap<String, Object>();
|
||||
List<Object> args = new ArrayList<Object>();
|
||||
StringBuffer sb = new StringBuffer(" select billid, status, recsource, recplatform, channel ");
|
||||
sb.append(" from jc_billsource_item a ");
|
||||
|
||||
if(billIds != null && billIds.size() >= 1) {
|
||||
sb.append(params.size() > 0 ?" and ":" where ");
|
||||
sb.append(" a.billid in (");
|
||||
for(int i = 0; i < billIds.size(); i++){
|
||||
if(i > 0) sb.append(",");
|
||||
sb.append("?");
|
||||
args.add(billIds.get(i));
|
||||
}
|
||||
sb.append(") ");
|
||||
}
|
||||
|
||||
LOG.info("queryJcBillSourceItemInBillId>>>SQL>>>{}", sb.toString());
|
||||
|
||||
List<JcBillSourceItem> lsit = jdbcTemplate.query(sb.toString(), args.toArray(), new BeanPropertyRowMapper<JcBillSourceItem>(JcBillSourceItem.class));
|
||||
|
||||
return lsit;
|
||||
}catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public SiDepositlocation querySiDepositlocation(String srcid) throws Exception {
|
||||
try {
|
||||
List<Object> args = new ArrayList<Object>();
|
||||
StringBuffer sb = new StringBuffer("select a.id, a.push from wms_depositlocation a");
|
||||
sb.append(" where a.id in (select d.physicaldept from dept d where d.id in");
|
||||
sb.append(" (select c.warehouse from jc_bill c where c.id = ?))");
|
||||
args.add(srcid);
|
||||
|
||||
LOG.info("querySiDepositlocation>>>SQL>>>{}", sb.toString());
|
||||
|
||||
List<SiDepositlocation> lists = jdbcTemplate.query( sb.toString(), args.toArray(), new BeanPropertyRowMapper<SiDepositlocation>(SiDepositlocation.class));
|
||||
|
||||
return (lists != null && lists.size() >= 1) ? lists.get(0) : null;
|
||||
}catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public SiDepositlocation querySiDepositlocationHGfc(String srcid) throws Exception {
|
||||
try {
|
||||
List<Object> args = new ArrayList<Object>();
|
||||
StringBuffer sb = new StringBuffer("select a.id, a.push from wms_depositlocation a");
|
||||
sb.append(" where a.id in (select d.physicaldept from dept d where d.id in");
|
||||
sb.append(" (select c.fhwarehouse from jc_billhg c where c.id = ?))");
|
||||
args.add(srcid);
|
||||
|
||||
LOG.info("querySiDepositlocationHGfc>>>SQL>>>{}", sb.toString());
|
||||
|
||||
List<SiDepositlocation> lists = jdbcTemplate.query( sb.toString(), args.toArray(), new BeanPropertyRowMapper<SiDepositlocation>(SiDepositlocation.class));
|
||||
|
||||
return (lists != null && lists.size() >= 1) ? lists.get(0) : null;
|
||||
}catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteEvent(String srcid, String typ, String billtyp) throws RuntimeException {
|
||||
try {
|
||||
String sql="delete from si_siwdevent where srcid = ? and typ = ? and billtyp = ?";
|
||||
Query query = em.createNativeQuery(sql);
|
||||
query.setParameter(1, srcid);
|
||||
query.setParameter(2, typ);
|
||||
query.setParameter(3, billtyp);
|
||||
query.executeUpdate();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package abacus.springboot.example.impl;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import javax.persistence.Query;
|
||||
|
||||
public class MyJpaUtils {
|
||||
|
||||
|
||||
/**
|
||||
* 给hql参数设置值
|
||||
*
|
||||
* @param query 查询
|
||||
* @param params 参数
|
||||
*/
|
||||
public void setParameters(Query query, Map<String, Object> params) {
|
||||
for (Map.Entry<String, Object> entry : params.entrySet()) {
|
||||
query.setParameter(entry.getKey(), entry.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+200
@@ -0,0 +1,200 @@
|
||||
package abacus.springboot.example.pi;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import abacus.springboot.example.api.view.ApiBillHg;
|
||||
import abacus.springboot.example.api.view.ApiBillHgItem;
|
||||
import abacus.springboot.example.api.view.ApiBillHgPayment;
|
||||
import abacus.springboot.example.api.view.ApiJcBill;
|
||||
import abacus.springboot.example.api.view.ApiJcBillHgSearchItem;
|
||||
import abacus.springboot.example.api.view.ApiJcBillItem;
|
||||
import abacus.springboot.example.api.view.ApiJcBillSearch;
|
||||
import abacus.springboot.example.api.view.JcBillCount;
|
||||
import abacus.springboot.example.api.view.JcCodeFlow;
|
||||
import abacus.springboot.example.api.view.JcProduct;
|
||||
import abacus.springboot.example.api.view.JcProductBillSouce;
|
||||
import abacus.springboot.example.dao.JcBillHg;
|
||||
|
||||
/**
|
||||
* <p>Title:ApiJcBillAccess</p>
|
||||
<p>Description: 底层实现-interface</p>
|
||||
@author chuanZeng
|
||||
@date 2026年8月18日
|
||||
*/
|
||||
public interface ApiJcBillAccessIF {
|
||||
|
||||
/**
|
||||
* 稽查收货查询
|
||||
* @param keyword
|
||||
* @param status
|
||||
* @param pageable
|
||||
* @return
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public Page<ApiJcBillSearch> queryApiJcBillSearch(String keyword, String employee, String status, Pageable pageable) throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 稽查收货主单查询
|
||||
* @param id
|
||||
* @return
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public ApiJcBill queryApiJcBillById(String id) throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 稽查收货明细
|
||||
* @param billId
|
||||
* @return
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public List<ApiJcBillItem> queryApiJcBillItemByBIllId(String billId) throws RuntimeException;
|
||||
|
||||
|
||||
/**
|
||||
* 回购列表查询
|
||||
* @param keyword
|
||||
* @param status
|
||||
* @param pageable
|
||||
* @return
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public Page<ApiJcBillHgSearchItem> queryApiJcBillHgSearchItem(String keyword, String employee, String status, Pageable pageable) throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 回购;查询品种和件数汇总
|
||||
* @param ids
|
||||
* @return
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public List<JcBillCount> queryJcBillCount(List<String> ids) throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 回购:主单查询
|
||||
* @param id
|
||||
* @return
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public ApiBillHg queryApiBillHgById(String hgId) throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 回购:明细查询
|
||||
* @param billId
|
||||
* @return
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public List<ApiBillHgItem> queryApiBillHgItemByHgId(String hgId) throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 回购:支付明细查询
|
||||
* @param billId
|
||||
* @return
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public List<ApiBillHgPayment> queryApiBillHgPaymentByHgId(String hgId) throws RuntimeException;
|
||||
|
||||
public List<ApiBillHgPayment> queryApiBillHgPaymentByHgId(List<String> hgIds) throws RuntimeException;
|
||||
|
||||
|
||||
/**
|
||||
* 根据物流码,查询出库相关信息
|
||||
* @param code
|
||||
* @return
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public List<JcCodeFlow> queryJcCodeFlow(List<String> codes) throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 稽查货品查询-单号查询
|
||||
* @param product
|
||||
* @param stockInId
|
||||
* @param hgId
|
||||
* @return
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public List<JcProduct> queryJcProduct(String product, String stockInId, String hgId) throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 稽查货品查询-单号查询
|
||||
* @param product
|
||||
* @param stockInId
|
||||
* @param hgId
|
||||
* @return
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public List<JcProduct> queryJcProduct(String product, String stockInId) throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 根据稽查单号,查询对应的货品编号
|
||||
* @param billIds
|
||||
* @return
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public List<JcProductBillSouce> queryJcProductBillSouce(List<String> billIds)throws RuntimeException;
|
||||
|
||||
|
||||
public List<JcBillHg> qeryJcBillHgs(List<String> billids) throws RuntimeException;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+121
@@ -0,0 +1,121 @@
|
||||
package abacus.springboot.example.pi;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.abacus.pms.dao.Account;
|
||||
import com.abacus.pms.dao.Brand;
|
||||
import com.abacus.pms.dao.MoreCategory;
|
||||
import com.abacus.pms.dao.Product;
|
||||
import com.abacus.pms.dao.Spec;
|
||||
import com.abacus.xpos.foundation.dao.Dept;
|
||||
import com.abacus.xpos.foundation.dao.Employee;
|
||||
|
||||
import abacus.config.dao.AbacusConfigItem;
|
||||
import abacus.springboot.example.dao.JcBill;
|
||||
|
||||
/**
|
||||
* <p>Title:ApiJcBillAccess</p>
|
||||
<p>Description: 底层实现-interface</p>
|
||||
@author chuanZeng
|
||||
@date 2026年8月18日
|
||||
*/
|
||||
public interface AutoCompleteAccessIF {
|
||||
|
||||
/**
|
||||
* 检索:商品
|
||||
* @param keyCode
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<Product> prductAutoComplete(String keyCode, List<String> areaIds) throws Exception;
|
||||
|
||||
/**
|
||||
* 检索:门店
|
||||
* @param keycode
|
||||
* @param type
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<Dept> deptAutoComplete(String keyCode, String type) throws Exception;
|
||||
|
||||
/**
|
||||
* 检索:分类
|
||||
* @param keycode
|
||||
* @param type
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<MoreCategory> moreCategoryAutoComplete(String keyCode, String areaid, String levels, String lastlevel) throws Exception;
|
||||
|
||||
/**
|
||||
* 检索:品牌
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<Brand> brandAutoComplete(String keyCode, String areaid, String levels, String lastlevel) throws Exception;
|
||||
|
||||
/**
|
||||
* 检索:商品标签
|
||||
* @param keyCode
|
||||
* @param areaid
|
||||
* @param lastlevel
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<Spec> specAutoComplete(String keyCode, String areaid) throws Exception;
|
||||
|
||||
/**
|
||||
* 检索:客户
|
||||
* @param keyCode
|
||||
* @param areaid
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<Account> accountAutoComplete(String keyCode, String areaid) throws Exception;
|
||||
|
||||
/**
|
||||
* 检索:员工
|
||||
* @param keyCode
|
||||
* @param areaid
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<Employee> employeeAutoComplete(String keyCode) throws Exception;
|
||||
|
||||
|
||||
/**
|
||||
* 检索:稽查单号
|
||||
* @param keyCode
|
||||
* @param areaid
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<JcBill> jcBillAutoComplete(String keyCode) throws Exception;
|
||||
|
||||
/**
|
||||
* 检索:收货仓库
|
||||
* @param keyCode
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<AbacusConfigItem> abacusConfigItemGroupAutoComplete(String keyCode, String keyGroup, String key) throws Exception;
|
||||
|
||||
/** 查询区域 */
|
||||
public Map<String,Map<String,String>> getGovbs() throws Exception;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+268
@@ -0,0 +1,268 @@
|
||||
package abacus.springboot.example.pi;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import abacus.springboot.example.dao.JcBill;
|
||||
import abacus.springboot.example.dao.JcBillHg;
|
||||
import abacus.springboot.example.dao.JcBillPhoto;
|
||||
import abacus.springboot.example.dao.JcBillSourceItem;
|
||||
import abacus.springboot.example.dao.JcSourceItem;
|
||||
import abacus.springboot.example.vo.SiDepositlocation;
|
||||
|
||||
/**
|
||||
* <p>Title:ApiJcBillAccess</p>
|
||||
<p>Description: 底层实现-interface</p>
|
||||
@author chuanZeng
|
||||
@date 2026年8月18日
|
||||
*/
|
||||
public interface JcBillAccessIF {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 根据条件查询图片
|
||||
* @param srcid
|
||||
* @param srcitemid
|
||||
* @param typephoto
|
||||
* @return
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public List<JcBillPhoto> queryJcBillPhoto(String srcid, String srcitemid, String typephoto) throws RuntimeException;
|
||||
|
||||
public List<JcBillPhoto> queryJcBillPhotoIn(List<String> srcids) throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 修改
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public void updateJcBill(JcBill bill) throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 修改
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public void updateJcBillSourceItem(List<JcBillSourceItem> items) throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 修改
|
||||
* @param photos
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public void updateJcBillPhoto(List<JcBillPhoto> photos) throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 当前明细行号
|
||||
* @param billId
|
||||
* @return
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public int countJcBillItemIndexno(String billId) throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 查询:下一单待提交的回购单号
|
||||
* @return
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public String lastBillHgId() throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 查询朔源明细
|
||||
* @param billId
|
||||
* @return
|
||||
*/
|
||||
public List<JcSourceItem> queryJcSourceItemByBillId(String billId);
|
||||
|
||||
/**
|
||||
* 删除特定的来源
|
||||
* @param billId
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public void deleteJcSourceItemBySource(String billId) throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 界面查询
|
||||
* @param fromDate
|
||||
* @param thruDate
|
||||
* @param applicant
|
||||
* @param goods
|
||||
* @param id
|
||||
* @param billin
|
||||
* @param goodsid
|
||||
* @param product
|
||||
* @param status
|
||||
* @param pageable
|
||||
* @return
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public Page<JcBill> queryJcBill(String fromDate, String thruDate, String applicant,
|
||||
String goods, String id, String billin, String goodsid, String product, String status,
|
||||
int typ, Pageable pageable) throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 保存事件
|
||||
* @return
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public void saveEvent(String srcid, String typ, String billtyp) throws RuntimeException;
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询 回购订单
|
||||
* @param typ 1-回购认款,2-回购分仓
|
||||
* @return
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public Page<JcBillHg> queryJcBillHg(String fromDate, String thruDate, String account,
|
||||
String salearea, String id, String billId, String status, String product,
|
||||
String manager,
|
||||
int typ, Pageable pageable) throws RuntimeException;
|
||||
|
||||
|
||||
/**
|
||||
* 删除溯源明细信息
|
||||
* @param ids
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public void deleteJcSourceItem(List<Long> ids) throws RuntimeException;
|
||||
|
||||
|
||||
/**
|
||||
* 删除溯源明细图片
|
||||
* @param ids
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public void deleteJcBillPhoto(String srcid, String srcitemid, String type) throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 获取百度token
|
||||
* @return
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public String getBaiduToken() throws RuntimeException;
|
||||
|
||||
public List<JcBillSourceItem> queryJcBillSourceItemInBillId(List<String> billIds) throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 稽查:根据稽查单号,稽查单关联物理仓管理策略
|
||||
* @param dept
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public SiDepositlocation querySiDepositlocation(String srcid) throws Exception;
|
||||
|
||||
/**
|
||||
* 回购:根据回购单号,回购单关联物理仓管理策略
|
||||
* @param dept
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public SiDepositlocation querySiDepositlocationHGfc(String srcid) throws Exception;
|
||||
|
||||
|
||||
/**
|
||||
* 删除事件
|
||||
* @param srcid
|
||||
* @param typ
|
||||
* @param billtyp
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public void deleteEvent(String srcid, String typ, String billtyp) throws RuntimeException;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
package abacus.springboot.example.repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
|
||||
import abacus.springboot.example.dao.JcBillHgPay;
|
||||
|
||||
/**
|
||||
* <p>Title:ApiJcBillAccess</p>
|
||||
<p>Description: Repository</p>
|
||||
@author chuanZeng
|
||||
@date 2026年8月18日
|
||||
*/
|
||||
public interface JcBillHgPayRepository extends JpaRepository<JcBillHgPay, Long>,JpaSpecificationExecutor<JcBillHgPay> {
|
||||
|
||||
List<JcBillHgPay> findByBillhg(String billhg);
|
||||
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package abacus.springboot.example.repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
|
||||
import abacus.springboot.example.dao.JcBillHg;
|
||||
|
||||
public interface JcBillHgRepository extends JpaRepository<JcBillHg, String>,JpaSpecificationExecutor<JcBillHg> {
|
||||
|
||||
List<JcBillHg> findByBillid(String billid);
|
||||
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package abacus.springboot.example.repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
|
||||
import abacus.springboot.example.dao.JcBillInItem;
|
||||
|
||||
public interface JcBillInItemRepository extends JpaRepository<JcBillInItem, Long>,JpaSpecificationExecutor<JcBillInItem> {
|
||||
|
||||
List<JcBillInItem> findByBillid(String billid);
|
||||
|
||||
List<JcBillInItem> findByBillidAndStatus(String billid, int status);
|
||||
|
||||
List<JcBillInItem> findByBillhg(String billhg);
|
||||
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package abacus.springboot.example.repository;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
|
||||
import abacus.springboot.example.dao.JcBillPhoto;
|
||||
|
||||
public interface JcBillPhotoRepository extends JpaRepository<JcBillPhoto, Long>,JpaSpecificationExecutor<JcBillPhoto> {
|
||||
|
||||
JcBillPhoto findBySrcidAndSrcitemidAndTypephoto(String srcid, String srcitemid, String typephoto);
|
||||
|
||||
void deleteBySrcidAndSrcitemid(String srcid, String srcitemid);
|
||||
|
||||
void deleteBySrcidAndTypephoto(String srcid, String typephoto);
|
||||
void deleteBySrcidAndSrcitemidAndTypephoto(String srcid, String srcitemid, String typephoto);
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
package abacus.springboot.example.repository;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
|
||||
import abacus.springboot.example.dao.JcBill;
|
||||
|
||||
public interface JcBillRepository extends JpaRepository<JcBill, String>,JpaSpecificationExecutor<JcBill> {
|
||||
|
||||
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package abacus.springboot.example.repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
|
||||
import abacus.springboot.example.dao.JcBillSourceItem;
|
||||
|
||||
public interface JcBillSourceItemRepository extends JpaRepository<JcBillSourceItem, Long>,JpaSpecificationExecutor<JcBillSourceItem> {
|
||||
|
||||
List<JcBillSourceItem> findByBillid(String billid);
|
||||
|
||||
void deleteByBillid(String billid);
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package abacus.springboot.example.repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
|
||||
import abacus.springboot.example.dao.JcSourceItem;
|
||||
|
||||
public interface JcSourceItemRepository extends JpaRepository<JcSourceItem, Long>,JpaSpecificationExecutor<JcSourceItem> {
|
||||
|
||||
List<JcSourceItem> findByBillidAndSrcitemid(String billid, String srcitemid);
|
||||
|
||||
List<JcSourceItem> findByBillidAndSrcitemidAndStatus(String billid, String srcitemid, int status);
|
||||
}
|
||||
+143
@@ -0,0 +1,143 @@
|
||||
package abacus.springboot.example.util;
|
||||
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
/**
|
||||
* <p>Title:DateToUpperChinese</p>
|
||||
<p>Description: 日期转成中文大写形式</p>
|
||||
@author chuanZeng
|
||||
@date 2026年8月18日
|
||||
*/
|
||||
public class DateToUpperChinese {
|
||||
private static final String[] NUMBERS = {"零", "壹", "贰", "叁", "肆", "伍",
|
||||
"陆", "柒", "捌", "玖"};
|
||||
|
||||
/**
|
||||
* 通过 yyyy-MM-dd 得到中文大写格式 yyyy MM dd 日期
|
||||
*/
|
||||
public static synchronized String toChinese(String str) {
|
||||
StringBuffer sb = new StringBuffer();
|
||||
sb.append(getSplitDateStr(str, 0)).append(" ").append(
|
||||
getSplitDateStr(str, 1)).append(" ").append(
|
||||
getSplitDateStr(str, 2));
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 分别得到年月日的大写 默认分割符 "-"
|
||||
*/
|
||||
public static String getSplitDateStr(String str, int unit) {
|
||||
// unit是单位 0=年 1=月 2日
|
||||
String[] DateStr = str.split("-");
|
||||
if (unit > DateStr.length)
|
||||
unit = 0;
|
||||
StringBuffer sb = new StringBuffer();
|
||||
for (int i = 0; i < DateStr[unit].length(); i++) {
|
||||
|
||||
if ((unit == 1 || unit == 2) && Integer.valueOf(DateStr[unit]) > 9) {
|
||||
sb.append(convertNum(DateStr[unit].substring(0, 1)))
|
||||
.append("拾").append(
|
||||
convertNum(DateStr[unit].substring(1, 2)));
|
||||
break;
|
||||
} else {
|
||||
sb.append(convertNum(DateStr[unit].substring(i, i + 1)));
|
||||
}
|
||||
}
|
||||
if (unit == 1 || unit == 2) {
|
||||
return sb.toString().replaceAll("^壹", "").replace("零", "");
|
||||
}
|
||||
return sb.toString();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 转换数字为大写
|
||||
*/
|
||||
private static String convertNum(String str) {
|
||||
return NUMBERS[Integer.valueOf(str)];
|
||||
}
|
||||
public final static char[] upper = "零一二三四五六七八九十".toCharArray();
|
||||
|
||||
/**
|
||||
* 根据小写数字格式的日期转换成大写格式的日期
|
||||
* @param date
|
||||
* @return
|
||||
*/
|
||||
public static String getUpperDate(Date datez) {
|
||||
|
||||
//支持yyyy-MM-dd、yyyy/MM/dd、yyyyMMdd等格式
|
||||
if(datez == null) return null;
|
||||
|
||||
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
|
||||
String date = sdf.format(datez);
|
||||
|
||||
|
||||
//非数字的都去掉
|
||||
date = date.replaceAll("\\D", "");
|
||||
if(date.length() != 8) return null;
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (int i=0;i<4;i++) {//年
|
||||
sb.append(upper[Integer.parseInt(date.substring(i, i+1))]);
|
||||
}
|
||||
sb.append("年");//拼接年
|
||||
int month = Integer.parseInt(date.substring(4, 6));
|
||||
if(month <= 10) {
|
||||
sb.append(upper[month]);
|
||||
} else {
|
||||
sb.append("十").append(upper[month%10]);
|
||||
}
|
||||
sb.append("月");//拼接月
|
||||
|
||||
int day = Integer.parseInt(date.substring(6));
|
||||
if (day <= 10) {
|
||||
sb.append(upper[day]);
|
||||
} else if(day < 20) {
|
||||
sb.append("十").append(upper[day % 10]);
|
||||
} else {
|
||||
sb.append(upper[day / 10]).append("十");
|
||||
int tmp = day % 10;
|
||||
if (tmp != 0) sb.append(upper[tmp]);
|
||||
}
|
||||
sb.append("日");//拼接日
|
||||
return sb.toString();
|
||||
}
|
||||
/**
|
||||
* 判断是否是零或正整数
|
||||
*/
|
||||
public static boolean isNumeric(String str) {
|
||||
Pattern pattern = Pattern.compile("[0-9]*");
|
||||
Matcher isNum = pattern.matcher(str);
|
||||
if (!isNum.matches()) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static void main(String args[]) {
|
||||
System.out.println(getUpperDate(new Date()));
|
||||
|
||||
double d = 1000.0000;
|
||||
|
||||
String str = String.valueOf(d);
|
||||
|
||||
if(str.indexOf(".") > 0) {
|
||||
str = str.replace("0+?$", "");// 删除掉尾数为0的字符
|
||||
str = str.replace("[.]$", "");// 结尾如果是小数点,则去掉
|
||||
}
|
||||
System.out.println(str);
|
||||
// System.out.println(dStr.replace("\\.0*$", ""));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,883 @@
|
||||
package abacus.springboot.example.util;
|
||||
|
||||
import java.sql.Timestamp;
|
||||
import java.text.DateFormat;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.GregorianCalendar;
|
||||
import java.util.Locale;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
|
||||
/**
|
||||
* Title: 日期时间 Description: 工具类
|
||||
*
|
||||
* @author xuelin chen
|
||||
* @version 1.0
|
||||
*/
|
||||
public class DateUtil {
|
||||
|
||||
/** 本地化 */
|
||||
private static Locale locale = Locale.SIMPLIFIED_CHINESE;
|
||||
|
||||
/** 缺省的DateFormat对象,可以将一个java.util.Date格式化成 yyyy-mm-dd 输出 */
|
||||
private static DateFormat dateDF = new SimpleDateFormat("yyyy-MM-dd");
|
||||
|
||||
/** 缺省的DateFormat对象,可以将一个java.util.Date格式化成 HH:SS:MM 输出 */
|
||||
private static DateFormat timeDF = DateFormat.getTimeInstance(DateFormat.MEDIUM, locale);
|
||||
|
||||
/** 缺省的DateFormat对象,可以将一个java.util.Date格式化成 yyyy-mm-dd HH:SS:MM 输出 */
|
||||
// private static DateFormat datetimeDF = DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.MEDIUM, locale);
|
||||
|
||||
private static DateFormat datetimeDF = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
private static DateFormat fdt = new SimpleDateFormat("yyyyMMddHHmmss");
|
||||
private static DateFormat fdtsss = new SimpleDateFormat("yyyyMMddHHmmssSSS");
|
||||
|
||||
public static final String DATE_TIME_FORMAT = "yyyy-MM-dd HH:mm:ss";
|
||||
|
||||
/**
|
||||
* 私有构造函数,表示不可实例化
|
||||
*/
|
||||
private DateUtil() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 将任意时间生成为当天的第一秒 如:2013-10-23 0:12:12 生成为 2013-10-23 00:00:00
|
||||
* @param from 时间对象
|
||||
* @return
|
||||
*/
|
||||
public static Date getFromDate(Date from) {
|
||||
if (from == null) {
|
||||
return null;
|
||||
}
|
||||
Calendar cal = Calendar.getInstance();
|
||||
cal.clear();
|
||||
cal.setTime(new Date(from.getTime()));
|
||||
cal.set(Calendar.HOUR_OF_DAY, 0);
|
||||
cal.set(Calendar.MINUTE, 0);
|
||||
cal.set(Calendar.SECOND, 0);
|
||||
cal.set(Calendar.MILLISECOND, 0);
|
||||
return cal.getTime();
|
||||
}
|
||||
|
||||
/**
|
||||
* 将任意时间生成为当天的最后一秒 如:2013-10-23 0:12:12 生成为 2013-10-23 23:59:59
|
||||
* @param thru 时间对象
|
||||
* @return
|
||||
*/
|
||||
public static Date getThruDate(Date thru) {
|
||||
if (thru == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Calendar cal = Calendar.getInstance();
|
||||
cal.clear();
|
||||
cal.setTime(new Date(thru.getTime()));
|
||||
cal.set(Calendar.HOUR_OF_DAY, 23);
|
||||
cal.set(Calendar.MINUTE, 59);
|
||||
cal.set(Calendar.SECOND, 59);
|
||||
cal.set(Calendar.MILLISECOND, 998);
|
||||
return cal.getTime();
|
||||
}
|
||||
|
||||
/**
|
||||
* 时间减去几个小时
|
||||
* @param dateStart
|
||||
* @param num
|
||||
* @return dateStart-num
|
||||
*/
|
||||
public static java.util.Date nowDateMinusHour(java.util.Date dateStart, int num) {
|
||||
try {
|
||||
Calendar cal = Calendar.getInstance();
|
||||
cal.setTime(dateStart);
|
||||
cal.add(Calendar.HOUR_OF_DAY, -num);
|
||||
return cal.getTime();
|
||||
} catch (Exception ex) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 时间减几分钟
|
||||
* @param dateStart
|
||||
* @param num
|
||||
* @return
|
||||
*/
|
||||
public static java.util.Date nowDateMinusTime(java.util.Date dateStart, int num) {
|
||||
try {
|
||||
Calendar cal = Calendar.getInstance();
|
||||
cal.setTime(dateStart);
|
||||
cal.add(Calendar.MINUTE, -num);
|
||||
return cal.getTime();
|
||||
} catch (Exception ex) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/** 返回当前日期格式 yyyyMMddHHmmss*/
|
||||
public static String getDateFormat(Date date) {
|
||||
if (date == null)
|
||||
date = new Date();
|
||||
return fdt.format(date);
|
||||
}
|
||||
|
||||
public static String getDateFormatsss(Date date) {
|
||||
if (date == null)
|
||||
date = new Date();
|
||||
return fdtsss.format(date);
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回一个当前的时间,并按格式转换为字符串 例:17:27:03
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public static String getTime() {
|
||||
GregorianCalendar gcNow = new GregorianCalendar();
|
||||
java.util.Date dNow = gcNow.getTime();
|
||||
return timeDF.format(dNow);
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回一个当前日期,并按格式转换为字符串 例:2009-12-12
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public static String getDate() {
|
||||
GregorianCalendar gcNow = new GregorianCalendar();
|
||||
java.util.Date dNow = gcNow.getTime();
|
||||
return dateDF.format(dNow);
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回一个当前日期和时间,并按格式转换为字符串 例:2009-12-08 14:27:03
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public static String getDateTime() {
|
||||
GregorianCalendar gcNow = new GregorianCalendar();
|
||||
java.util.Date dNow = gcNow.getTime();
|
||||
return datetimeDF.format(dNow);
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回当前年的年号
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public static int getYear() {
|
||||
GregorianCalendar gcNow = new GregorianCalendar();
|
||||
return gcNow.get(GregorianCalendar.YEAR);
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回本月月号:从 0 开始
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public static int getMonth() {
|
||||
GregorianCalendar gcNow = new GregorianCalendar();
|
||||
return gcNow.get(GregorianCalendar.MONTH);
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回今天是本月的第几天
|
||||
*
|
||||
* @return int 从1开始
|
||||
*/
|
||||
public static int getToDayOfMonth() {
|
||||
GregorianCalendar gcNow = new GregorianCalendar();
|
||||
return gcNow.get(GregorianCalendar.DAY_OF_MONTH);
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回本月的第一天
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* 返回一格式化的日期
|
||||
*
|
||||
* @param date
|
||||
* java.util.Date
|
||||
* @return String yyyy-mm-dd 格式
|
||||
*/
|
||||
public static String formatDate(java.util.Date date) {
|
||||
return dateDF.format(date);
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回一格式化的日期
|
||||
*
|
||||
* @param date
|
||||
* @return
|
||||
*/
|
||||
public static String formatDate(long date) {
|
||||
return formatDate(new java.util.Date(date));
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回一格式化的时间
|
||||
*
|
||||
* @param date
|
||||
* Date
|
||||
* @return String hh:ss:mm 格式
|
||||
*/
|
||||
public static String formatTime(java.util.Date date) {
|
||||
return timeDF.format(date);
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回一格式化的时间
|
||||
*
|
||||
* @param date
|
||||
* @return
|
||||
*/
|
||||
public static String formatTime(long date) {
|
||||
return formatTime(new java.util.Date(date));
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回一格式化的日期时间
|
||||
*
|
||||
* @param date
|
||||
* Date
|
||||
* @return String yyyy-mm-dd hh:ss:mm 格式
|
||||
*/
|
||||
public static String formatDateTime(java.util.Date date) {
|
||||
return datetimeDF.format(date);
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回一格式化的日期时间
|
||||
*
|
||||
* @param date
|
||||
* @return
|
||||
*/
|
||||
public static String formatDateTime(long date) {
|
||||
return formatDateTime(new java.util.Date(date));
|
||||
}
|
||||
|
||||
/**
|
||||
* 将字串转成日期和时间,字串格式: yyyy-MM-dd HH:mm:ss
|
||||
*
|
||||
* @param string
|
||||
* String
|
||||
* @return Date
|
||||
*/
|
||||
public static java.util.Date toDateTime(String string) {
|
||||
try {
|
||||
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
return (java.util.Date) formatter.parse(string);
|
||||
} catch (Exception ex) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 将字串转成日期,字串格式: yyyy-MM-dd
|
||||
*
|
||||
* @param string
|
||||
* String
|
||||
* @return Date
|
||||
*/
|
||||
public static java.util.Date toDate(String string) {
|
||||
try {
|
||||
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
|
||||
return (java.util.Date) formatter.parse(string);
|
||||
} catch (Exception ex) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 将字串转成日期,字串格式: yyyyMMdd 转换成 yyyy-MM-dd
|
||||
*
|
||||
* @param string
|
||||
* String
|
||||
* @return Date
|
||||
*/
|
||||
public static String toDateyymmdd(String string) {
|
||||
try {
|
||||
DateFormat formatter = new SimpleDateFormat("yyyyMMdd");
|
||||
return dateDF.format((java.util.Date)formatter.parse(string));
|
||||
} catch (Exception ex) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 取值:某日期的年号
|
||||
*
|
||||
* @param date
|
||||
* 格式: yyyy-MM-dd
|
||||
* @return
|
||||
*/
|
||||
public static int getYear(String date) {
|
||||
java.util.Date d = toDate(date);
|
||||
if (d == null)
|
||||
return 0;
|
||||
|
||||
Calendar calendar = Calendar.getInstance(locale);
|
||||
calendar.setTime(d);
|
||||
return calendar.get(Calendar.YEAR);
|
||||
}
|
||||
|
||||
/**
|
||||
* 取值:某日期的月号
|
||||
*
|
||||
* @param date
|
||||
* 格式: yyyy-MM-dd
|
||||
* @return 从0开始
|
||||
*/
|
||||
public static int getMonth(String date) {
|
||||
java.util.Date d = toDate(date);
|
||||
if (d == null)
|
||||
return 0;
|
||||
|
||||
Calendar calendar = Calendar.getInstance(locale);
|
||||
calendar.setTime(d);
|
||||
return calendar.get(Calendar.MONTH);
|
||||
}
|
||||
|
||||
/**
|
||||
* 取值:某日期的日号
|
||||
*
|
||||
* @param date
|
||||
* 格式: yyyy-MM-dd
|
||||
* @return 从1开始
|
||||
*/
|
||||
public static int getDayOfMonth(String date) {
|
||||
java.util.Date d = toDate(date);
|
||||
if (d == null)
|
||||
return 0;
|
||||
|
||||
Calendar calendar = Calendar.getInstance(locale);
|
||||
calendar.setTime(d);
|
||||
return calendar.get(Calendar.DAY_OF_MONTH);
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算两个日期的年数差
|
||||
*
|
||||
* @param one
|
||||
* 格式: yyyy-MM-dd
|
||||
* @param two
|
||||
* 格式: yyyy-MM-dd
|
||||
* @return
|
||||
*/
|
||||
public static int compareYear(String one, String two) {
|
||||
return getYear(one) - getYear(two);
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算岁数
|
||||
*
|
||||
* @param date
|
||||
* 格式: yyyy-MM-dd
|
||||
* @return
|
||||
*/
|
||||
public static int compareYear(String date) {
|
||||
return getYear() - getYear(date);
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用format格式化Date对象为字符串
|
||||
*
|
||||
* @param date
|
||||
* date
|
||||
* @return String
|
||||
*/
|
||||
public static String getDateString(Date date) {
|
||||
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
|
||||
return format.format(date);
|
||||
}
|
||||
|
||||
public static String getyyyyMMdd(Date date) {
|
||||
SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd");
|
||||
return format.format(date);
|
||||
}
|
||||
|
||||
public static String getHHmmss(Date date) {
|
||||
SimpleDateFormat format = new SimpleDateFormat("HHmmss");
|
||||
return format.format(date);
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用format格式化Date对象为字符串,获取年份
|
||||
*
|
||||
* @param date
|
||||
* date
|
||||
* @return String
|
||||
*/
|
||||
static public String getYear(Date date) {
|
||||
SimpleDateFormat format = new SimpleDateFormat("yyyy");
|
||||
return format.format(date);
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用format格式化Date对象为字符串,获取月份
|
||||
*
|
||||
* @param date
|
||||
* date
|
||||
* @return String
|
||||
*/
|
||||
static public String getMonth(Date date) {
|
||||
SimpleDateFormat format = new SimpleDateFormat("MM");
|
||||
return format.format(date);
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用format格式化Date对象为字符串,获取日份
|
||||
*
|
||||
* @param date
|
||||
* date
|
||||
* @return String
|
||||
*/
|
||||
static public String getDay(Date date) {
|
||||
SimpleDateFormat format = new SimpleDateFormat("dd");
|
||||
return format.format(date);
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用format格式化Date对象为字符串,获取中文表示的年月日
|
||||
*
|
||||
* @param date
|
||||
* date
|
||||
* @return String 2009年12月08日
|
||||
*/
|
||||
static public String getDateStrC(Date date) {
|
||||
SimpleDateFormat format = new SimpleDateFormat("yyyy年MM月dd日");
|
||||
return format.format(date);
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用format格式化Date对象为字符串,获取年份
|
||||
*
|
||||
* @param date
|
||||
* date
|
||||
* @return String 20091208
|
||||
*/
|
||||
static public String getDateStrMonth(Date date) {
|
||||
if (date == null)
|
||||
return "";
|
||||
SimpleDateFormat format = new SimpleDateFormat("yyyyMM");
|
||||
String str = format.format(date);
|
||||
return str;
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用format格式化Date对象为字符串,获取年份
|
||||
*
|
||||
* @param date
|
||||
* date
|
||||
* @return String 20091208
|
||||
*/
|
||||
static public String getDateStrCompact(Date date) {
|
||||
if (date == null)
|
||||
return "";
|
||||
SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd");
|
||||
String str = format.format(date);
|
||||
return str;
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用format格式化Date对象为字符串,获取年月日和时间
|
||||
*
|
||||
* @param date
|
||||
* date
|
||||
* @return String 2009年12月8日 14时03分10秒
|
||||
*/
|
||||
static public String getDateTimeStrC(Date date) {
|
||||
SimpleDateFormat format = new SimpleDateFormat("yyyy年MM月dd日 HH时mm分ss秒");
|
||||
return format.format(date);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取指定日期当前小时起始时间
|
||||
*/
|
||||
static public Date getCurrentHoursFirstSecound(java.util.Date date) {
|
||||
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH");
|
||||
String dateStr = format.format(date);
|
||||
return toDateTime(dateStr + ":00:00");
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取指定日期当前下一个小时时间
|
||||
*/
|
||||
static public Date getCurrentNextHours(java.util.Date date) {
|
||||
Calendar scalendar = new GregorianCalendar();
|
||||
scalendar.setTime(date);
|
||||
scalendar.add(Calendar.HOUR, 1);
|
||||
return new Date(scalendar.getTime().getTime());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取指定日期后下一个月的第一天
|
||||
*
|
||||
* @param java.sql.Date
|
||||
* date
|
||||
* @return java.sql.Date
|
||||
*/
|
||||
static public java.sql.Date getNextMonthFirstDate(java.util.Date date) throws ParseException {
|
||||
Calendar scalendar = new GregorianCalendar();
|
||||
scalendar.setTime(date);
|
||||
scalendar.add(Calendar.MONTH, 1);
|
||||
scalendar.set(Calendar.DATE, 1);
|
||||
return new java.sql.Date(scalendar.getTime().getTime());
|
||||
}
|
||||
|
||||
static public java.sql.Date getNextMonthDate(java.util.Date date) {
|
||||
Calendar scalendar = new GregorianCalendar();
|
||||
scalendar.setTime(date);
|
||||
scalendar.add(Calendar.MONTH, 1);
|
||||
return new java.sql.Date(scalendar.getTime().getTime());
|
||||
}
|
||||
|
||||
/** 上一个月 */
|
||||
public static Date getLastMonthFirstDate(Date date, int month) {
|
||||
if (date == null)
|
||||
return date;
|
||||
Calendar calendar = new GregorianCalendar();
|
||||
calendar.setTime(date);
|
||||
calendar.add(Calendar.MONTH, month);
|
||||
date = calendar.getTime();
|
||||
return date;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取指定日期的前面几天
|
||||
*
|
||||
* @param java.sql.Date
|
||||
* date
|
||||
* @param dayCount
|
||||
* 表示前几天
|
||||
* @return java.sql.Date
|
||||
*/
|
||||
static public java.sql.Date getFrontDateByDayCount(java.sql.Date date, int dayCount) throws ParseException {
|
||||
Calendar scalendar = new GregorianCalendar();
|
||||
scalendar.setTime(date);
|
||||
scalendar.add(Calendar.DATE, -dayCount);
|
||||
return new java.sql.Date(scalendar.getTime().getTime());
|
||||
}
|
||||
|
||||
/**
|
||||
* 取得指定年份和月份的第一天
|
||||
*
|
||||
* @param year
|
||||
* 年
|
||||
* @param month
|
||||
* 月
|
||||
* @return Date
|
||||
*/
|
||||
static public Date getFirstDay(String year, String month) throws ParseException {
|
||||
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
|
||||
return format.parse(year + "-" + month + "-1");
|
||||
}
|
||||
|
||||
/**
|
||||
* 取得指定年份和月份的第一天
|
||||
*
|
||||
* @param year
|
||||
* 年
|
||||
* @param month
|
||||
* 月
|
||||
* @return Date
|
||||
*/
|
||||
static public Date getFirstDay(int year, int month) throws ParseException {
|
||||
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
|
||||
return format.parse(year + "-" + month + "-1");
|
||||
}
|
||||
|
||||
/**
|
||||
* 取得指定年份和月份的最后一天
|
||||
*
|
||||
* @param year
|
||||
* 年
|
||||
* @param month
|
||||
* 月
|
||||
* @return Date
|
||||
*/
|
||||
static public Date getLastDay(String year, String month) throws ParseException {
|
||||
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
|
||||
Date date = format.parse(year + "-" + month + "-1");
|
||||
|
||||
Calendar scalendar = new GregorianCalendar();
|
||||
scalendar.setTime(date);
|
||||
scalendar.add(Calendar.MONTH, 1);
|
||||
scalendar.add(Calendar.DATE, -1);
|
||||
date = scalendar.getTime();
|
||||
return date;
|
||||
}
|
||||
|
||||
/**
|
||||
* 取得指定年份和月份的最后一天
|
||||
*
|
||||
* @param year
|
||||
* 年
|
||||
* @param month
|
||||
* 月
|
||||
* @return Date
|
||||
*/
|
||||
static public Date getLastDay(int year, int month) throws ParseException {
|
||||
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
|
||||
Date date = format.parse(year + "-" + month + "-1");
|
||||
|
||||
Calendar scalendar = new GregorianCalendar();
|
||||
scalendar.setTime(date);
|
||||
scalendar.add(Calendar.MONTH, 1);
|
||||
scalendar.add(Calendar.DATE, -1);
|
||||
date = scalendar.getTime();
|
||||
return date;
|
||||
}
|
||||
|
||||
/**
|
||||
* 取得指定年份之间的相隔月数
|
||||
*
|
||||
* @param year
|
||||
* 年
|
||||
* @param month
|
||||
* 月
|
||||
* @return Date
|
||||
*/
|
||||
static public long getDistinceMonth(String beforedate, String afterdate) throws ParseException {
|
||||
SimpleDateFormat d = new SimpleDateFormat("yyyy-MM-dd");
|
||||
long monthCount = 0;
|
||||
try {
|
||||
java.util.Date before = d.parse(beforedate);
|
||||
java.util.Date after = d.parse(afterdate);
|
||||
|
||||
monthCount = (Integer.parseInt(DateUtil.getYear(after)) - Integer.parseInt(DateUtil.getYear(before))) * 12
|
||||
+ DateUtil.getMonth(afterdate) - DateUtil.getMonth(beforedate);
|
||||
|
||||
} catch (ParseException e) {
|
||||
System.out.println("Date parse error!");
|
||||
}
|
||||
return monthCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* 取得指定年份之间的相隔天数
|
||||
*
|
||||
* @param year
|
||||
* 年
|
||||
* @param month
|
||||
* 月
|
||||
* @return Date
|
||||
*/
|
||||
static public long getDistinceDay(String beforedate, String afterdate) throws ParseException {
|
||||
SimpleDateFormat d = new SimpleDateFormat("yyyy-MM-dd");
|
||||
long dayCount = 0;
|
||||
try {
|
||||
java.util.Date d1 = d.parse(beforedate);
|
||||
java.util.Date d2 = d.parse(afterdate);
|
||||
|
||||
dayCount = (d2.getTime() - d1.getTime()) / (24 * 60 * 60 * 1000);
|
||||
|
||||
} catch (ParseException e) {
|
||||
System.out.println("Date parse error!");
|
||||
// throw e;
|
||||
}
|
||||
return dayCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* 指定日期加一天
|
||||
*
|
||||
* @param date
|
||||
* @param day
|
||||
* @return
|
||||
*/
|
||||
static public Date getDaytoDay(Date date, int day) {
|
||||
if (date == null)
|
||||
return date;
|
||||
|
||||
Calendar calendar = new GregorianCalendar();
|
||||
calendar.setTime(date);
|
||||
calendar.add(Calendar.DATE, day);
|
||||
date = calendar.getTime();
|
||||
return date;
|
||||
}
|
||||
|
||||
static public Date getMonthtoMonth(Date date, int day) {
|
||||
if (date == null)
|
||||
return date;
|
||||
|
||||
Calendar calendar = new GregorianCalendar();
|
||||
calendar.setTime(date);
|
||||
calendar.add(Calendar.MONTH, day);
|
||||
date = calendar.getTime();
|
||||
return date;
|
||||
}
|
||||
|
||||
// 获取上一年或者下一年
|
||||
static public Date getYeartoYaer(Date date, int year) {
|
||||
if (date == null)
|
||||
return date;
|
||||
|
||||
Calendar calendar = new GregorianCalendar();
|
||||
calendar.setTime(date);
|
||||
calendar.add(Calendar.YEAR, year);
|
||||
date = calendar.getTime();
|
||||
return date;
|
||||
}
|
||||
|
||||
// 指定日期的最开始时间
|
||||
public static Date getDateStartTime(Date date) {
|
||||
if (date == null)
|
||||
return null;
|
||||
try {
|
||||
String strDate = formatDate(date);
|
||||
return toDateTime(strDate + " 00:00:00");
|
||||
} catch (Exception localException) {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static public Date getDateLastTime(Date date) {
|
||||
if (date == null)
|
||||
return null;
|
||||
try {
|
||||
String strDate = formatDate(date);
|
||||
return toDateTime(strDate + " 23:59:59");
|
||||
} catch (Exception localException) {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
// 单位秒
|
||||
static public long getDistinceFen(String beforedate, String afterdate) throws ParseException {
|
||||
SimpleDateFormat d = new SimpleDateFormat(DATE_TIME_FORMAT);
|
||||
long dayCount = 0;
|
||||
try {
|
||||
java.util.Date d1 = d.parse(beforedate);
|
||||
java.util.Date d2 = d.parse(afterdate);
|
||||
|
||||
dayCount = (d2.getTime() - d1.getTime()) / (1000);
|
||||
|
||||
} catch (ParseException e) {
|
||||
System.out.println("Date parse error!");
|
||||
// throw e;
|
||||
}
|
||||
return dayCount;
|
||||
}
|
||||
|
||||
static public Date getMINUTE(Date date, int day) {
|
||||
if (date == null)
|
||||
return date;
|
||||
|
||||
Calendar calendar = new GregorianCalendar();
|
||||
calendar.setTime(date);
|
||||
calendar.add(Calendar.MINUTE, day);
|
||||
date = calendar.getTime();
|
||||
return date;
|
||||
}
|
||||
|
||||
static public String CalTimeDifference(String fromTime, int overTime) {
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
Date date = null;
|
||||
try {
|
||||
date = dateFormat.parse(fromTime);
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(date);
|
||||
calendar.add(Calendar.HOUR, overTime);//这里是分钟,如果需要,可以更换为day,moth
|
||||
Date date1 = calendar.getTime();
|
||||
|
||||
Timestamp overQTimeKey = new Timestamp(calendar.getTime().getTime());
|
||||
SimpleDateFormat overQTimeDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
return overQTimeDateFormat.format(overQTimeKey);
|
||||
}
|
||||
|
||||
/**
|
||||
* 10位时间戳
|
||||
* @return
|
||||
*/
|
||||
static public String tenBitTime() {
|
||||
return String.valueOf(Calendar.getInstance().getTimeInMillis()/1000);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 使用format格式化Date对象为字符串
|
||||
*
|
||||
* @param date
|
||||
* date
|
||||
* @return String
|
||||
*/
|
||||
public static String getDatetoUpperCaseString() {
|
||||
// 获取当前日期
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
|
||||
// 转换成大写
|
||||
String year = toUpperCase(String.valueOf(calendar.get(Calendar.YEAR)));
|
||||
String month = toUpperCase(String.valueOf(calendar.get(Calendar.MONTH) + 1));
|
||||
String day = toUpperCase(String.valueOf(calendar.get(Calendar.DAY_OF_MONTH)));
|
||||
|
||||
// 组合成大写格式
|
||||
String dateInChinese = year + "年" + month + "月" + day + "日";
|
||||
return dateInChinese;
|
||||
}
|
||||
|
||||
// 将数字字符串转换成大写
|
||||
private static String toUpperCase(String str) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (int i = 0; i < str.length(); i++) {
|
||||
char c = str.charAt(i);
|
||||
switch (c) {
|
||||
case '0': sb.append('零'); break;
|
||||
case '1': sb.append('一'); break;
|
||||
case '2': sb.append('二'); break;
|
||||
case '3': sb.append('三'); break;
|
||||
case '4': sb.append('四'); break;
|
||||
case '5': sb.append('五'); break;
|
||||
case '6': sb.append('六'); break;
|
||||
case '7': sb.append('七'); break;
|
||||
case '8': sb.append('八'); break;
|
||||
case '9': sb.append('九'); break;
|
||||
default: sb.append(c);
|
||||
}
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws ParseException {
|
||||
// System.out.println(getDateStrC(getDaytoDay(new Date(),-7)));
|
||||
// System.out.println(getDateFormat(null));
|
||||
// getDistinceFen
|
||||
|
||||
// SimpleDateFormat format = new SimpleDateFormat("yyMMddHHmmss");
|
||||
|
||||
String code = "";
|
||||
|
||||
String[] codearray = code.split("/");
|
||||
System.out.println(JSON.toJSONString(codearray));
|
||||
System.out.println(codearray[codearray.length - 1]);
|
||||
|
||||
System.out.println(getDatetoUpperCaseString());
|
||||
|
||||
|
||||
// System.out.println(formatDateTime(nowDateMinusTime(toDateTime("2023-19-27 00:00:00"), -10)));
|
||||
// System.out.println(new Date().getTime());
|
||||
// System.out.println(1614849936503L - new Date().getTime());
|
||||
// DateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss");
|
||||
// 第一个当前日期 第二个证照有效的日期
|
||||
// Long s = DateUtil.getDistinceDay(DateUtil.getDate(), DateUtil.toDates("20190228"));
|
||||
// System.out.println(s);
|
||||
// System.out.println(DateUtil.toDateyymmdd("20180817"));
|
||||
// TODO Auto-generated catch block
|
||||
|
||||
/*
|
||||
* try { System.out.println(getDateFormat(null)); } catch
|
||||
* (ParseException e) { // TODO Auto-generated catch block
|
||||
* e.printStackTrace(); }
|
||||
*/
|
||||
}
|
||||
}
|
||||
+94
@@ -0,0 +1,94 @@
|
||||
package abacus.springboot.example.util;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
/**
|
||||
* <p>Title:JsonStringRemoveRepetUtil</p>
|
||||
<p>Description:json字符串-对比</p>
|
||||
@author chuanZeng
|
||||
@date 2026年8月18日
|
||||
*/
|
||||
public class JsonStringRemoveRepetUtil {
|
||||
|
||||
public String[] removeRepet(String oldStr,String newStr){
|
||||
if(StringUtils.isEmpty(oldStr)||StringUtils.isEmpty(newStr)) return new String[]{oldStr,newStr};
|
||||
try{
|
||||
JSONObject oldjo=JSONObject.parseObject(oldStr);
|
||||
JSONObject newjo=JSONObject.parseObject(newStr);
|
||||
if(oldjo==null||newjo==null) return new String[]{oldStr,newStr};
|
||||
List<String> rkeys=new ArrayList<String>();
|
||||
List<String> akeys=new ArrayList<String>();
|
||||
for(String key:oldjo.keySet()){
|
||||
if(oldjo.getString(key)==null&&newjo.getString(key)==null){
|
||||
rkeys.add(key);
|
||||
}else if(oldjo.getString(key)==null&&newjo.getString(key)!=null||oldjo.getString(key)!=null&&newjo.getString(key)==null){
|
||||
|
||||
}else if(oldjo.getString(key).startsWith("{")){//对象
|
||||
if(oldjo.getJSONObject(key).getString("id").equals(newjo.getJSONObject(key).getString("id"))){
|
||||
rkeys.add(key);
|
||||
}
|
||||
}else if(oldjo.getString(key).startsWith("[")){//数组
|
||||
if(oldjo.getString(key).equals(newjo.getString(key)))
|
||||
rkeys.add(key);
|
||||
else
|
||||
akeys.add(key);
|
||||
}else if(oldjo.getString(key).equals(newjo.getString(key))){
|
||||
rkeys.add(key);
|
||||
}
|
||||
}
|
||||
if(!rkeys.isEmpty()){
|
||||
for(String key:rkeys){
|
||||
oldjo.remove(key);
|
||||
newjo.remove(key);
|
||||
}
|
||||
}
|
||||
if(!akeys.isEmpty()){
|
||||
for(String key:akeys){
|
||||
JSONArray oldja= oldjo.getJSONArray(key);
|
||||
JSONArray newja= newjo.getJSONArray(key);
|
||||
if(oldja.isEmpty()||newja.isEmpty()) continue;
|
||||
List<String> oldli=new ArrayList<String>();
|
||||
for(Object obj:oldja){
|
||||
JSONObject jo=(JSONObject) obj;
|
||||
oldli.add(jo.toJSONString());
|
||||
}
|
||||
List<String> newli=new ArrayList<String>();
|
||||
for(Object obj:newja){
|
||||
JSONObject jo=(JSONObject) obj;
|
||||
newli.add(jo.toJSONString());
|
||||
}
|
||||
oldli.retainAll(newli);
|
||||
if(!oldli.isEmpty()){
|
||||
String olds=oldjo.getString(key);
|
||||
String news=newjo.getString(key);
|
||||
for(String str:oldli){
|
||||
olds=olds.replace(str, "").replace(",,", ",");
|
||||
news=news.replace(str, "").replace(",,", ",");
|
||||
}
|
||||
olds=olds.replace("[,", "[").replace(",]", "]");
|
||||
news=news.replace("[,", "[").replace(",]", "]");
|
||||
if(olds.equals("[]"))
|
||||
oldjo.remove(key);
|
||||
else
|
||||
oldjo.put(key, olds);
|
||||
if(news.equals("[]"))
|
||||
newjo.remove(key);
|
||||
else
|
||||
newjo.put(key, news);
|
||||
}
|
||||
}
|
||||
}
|
||||
oldStr=oldjo.toJSONString();
|
||||
newStr=newjo.toJSONString();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
return new String[]{oldStr,newStr};
|
||||
}
|
||||
}
|
||||
+112
@@ -0,0 +1,112 @@
|
||||
package abacus.springboot.example.util;
|
||||
import java.io.IOException;
|
||||
import java.net.InetAddress;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.net.Socket;
|
||||
import java.net.SocketAddress;
|
||||
import java.net.UnknownHostException;
|
||||
import java.security.KeyManagementException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.security.cert.CertificateException;
|
||||
import java.security.cert.X509Certificate;
|
||||
|
||||
import javax.net.SocketFactory;
|
||||
import javax.net.ssl.SSLContext;
|
||||
import javax.net.ssl.TrustManager;
|
||||
import javax.net.ssl.X509TrustManager;
|
||||
|
||||
import org.apache.commons.httpclient.ConnectTimeoutException;
|
||||
import org.apache.commons.httpclient.params.HttpConnectionParams;
|
||||
import org.apache.commons.httpclient.protocol.ProtocolSocketFactory;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 调过证书
|
||||
*
|
||||
* created at 2010-7-26 上午09:29:33
|
||||
*/
|
||||
public class MySSLProtocolSocketFactory implements ProtocolSocketFactory {
|
||||
|
||||
private SSLContext sslcontext = null;
|
||||
|
||||
private SSLContext createSSLContext() {
|
||||
SSLContext sslcontext=null;
|
||||
try {
|
||||
sslcontext = SSLContext.getInstance("SSL");
|
||||
sslcontext.init(null, new TrustManager[]{new TrustAnyTrustManager()}, new java.security.SecureRandom());
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
e.printStackTrace();
|
||||
} catch (KeyManagementException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return sslcontext;
|
||||
}
|
||||
|
||||
private SSLContext getSSLContext() {
|
||||
if (this.sslcontext == null) {
|
||||
this.sslcontext = createSSLContext();
|
||||
}
|
||||
return this.sslcontext;
|
||||
}
|
||||
|
||||
public Socket createSocket(Socket socket, String host, int port, boolean autoClose)
|
||||
throws IOException, UnknownHostException {
|
||||
return getSSLContext().getSocketFactory().createSocket(
|
||||
socket,
|
||||
host,
|
||||
port,
|
||||
autoClose
|
||||
);
|
||||
}
|
||||
|
||||
public Socket createSocket(String host, int port) throws IOException,
|
||||
UnknownHostException {
|
||||
return getSSLContext().getSocketFactory().createSocket(
|
||||
host,
|
||||
port
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
public Socket createSocket(String host, int port, InetAddress clientHost, int clientPort)
|
||||
throws IOException, UnknownHostException {
|
||||
return getSSLContext().getSocketFactory().createSocket(host, port, clientHost, clientPort);
|
||||
}
|
||||
|
||||
public Socket createSocket(String host, int port, InetAddress localAddress,
|
||||
int localPort, HttpConnectionParams params) throws IOException,
|
||||
UnknownHostException, ConnectTimeoutException {
|
||||
if (params == null) {
|
||||
throw new IllegalArgumentException("Parameters may not be null");
|
||||
}
|
||||
int timeout = params.getConnectionTimeout();
|
||||
SocketFactory socketfactory = getSSLContext().getSocketFactory();
|
||||
if (timeout == 0) {
|
||||
return socketfactory.createSocket(host, port, localAddress, localPort);
|
||||
} else {
|
||||
Socket socket = socketfactory.createSocket();
|
||||
SocketAddress localaddr = new InetSocketAddress(localAddress, localPort);
|
||||
SocketAddress remoteaddr = new InetSocketAddress(host, port);
|
||||
socket.bind(localaddr);
|
||||
socket.connect(remoteaddr, timeout);
|
||||
return socket;
|
||||
}
|
||||
}
|
||||
|
||||
//自定义私有类
|
||||
private static class TrustAnyTrustManager implements X509TrustManager {
|
||||
|
||||
public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException {
|
||||
}
|
||||
|
||||
public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException {
|
||||
}
|
||||
|
||||
public X509Certificate[] getAcceptedIssuers() {
|
||||
return new X509Certificate[]{};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+295
@@ -0,0 +1,295 @@
|
||||
package abacus.springboot.example.util;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.commons.httpclient.HttpClient;
|
||||
import org.apache.commons.httpclient.HttpStatus;
|
||||
import org.apache.commons.httpclient.NameValuePair;
|
||||
import org.apache.commons.httpclient.SimpleHttpConnectionManager;
|
||||
import org.apache.commons.httpclient.methods.GetMethod;
|
||||
import org.apache.commons.httpclient.methods.PostMethod;
|
||||
import org.apache.commons.httpclient.methods.StringRequestEntity;
|
||||
import org.apache.commons.httpclient.params.HttpClientParams;
|
||||
import org.apache.commons.httpclient.params.HttpMethodParams;
|
||||
import org.apache.commons.httpclient.protocol.Protocol;
|
||||
|
||||
import com.abacus.xpos.foundation.pubs.WebserviceException;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
/**
|
||||
* <p>Title:RequestUtil</p>
|
||||
<p>Description: http-工具</p>
|
||||
@author chuanZeng
|
||||
@date 2026年8月18日
|
||||
*/
|
||||
public class RequestUtil {
|
||||
private static final int connectTimeout = 5000; // 连接超时时间
|
||||
private static final int connectionRequestTimeout = 5000; // 请求超时时间
|
||||
private static final int socketTimeout = 5000; // 套接字连接超时(读取超时时间)
|
||||
|
||||
public static final String charset = "utf-8"; // 编码方式
|
||||
|
||||
/**
|
||||
* post Json提交
|
||||
* @param url
|
||||
* @param jsonStr
|
||||
* @return
|
||||
* @throws WebserviceException
|
||||
*/
|
||||
public static String send(String url ,String jsonStr, String id) throws WebserviceException{
|
||||
|
||||
HttpClientParams params = new HttpClientParams();
|
||||
params.setContentCharset("UTF-8");
|
||||
|
||||
HttpClient hc = new HttpClient(params,new SimpleHttpConnectionManager(true));
|
||||
hc.getHttpConnectionManager().getParams().setConnectionTimeout(5000);
|
||||
hc.getHttpConnectionManager().getParams().setSoTimeout(5000);
|
||||
PostMethod hm = new PostMethod(url);
|
||||
hm.setRequestHeader("Content-Type", "application/json; charset=UTF-8");
|
||||
try {
|
||||
System.out.println(DateUtil.getDateTime()+"-"+ id + "-url:"+url);
|
||||
hm.setRequestEntity(new StringRequestEntity(jsonStr, "application/json", "utf-8"));
|
||||
System.out.println(DateUtil.getDateTime()+"-"+ id + "-send报文:" + jsonStr.toString());
|
||||
int status = hc.executeMethod(hm);
|
||||
if(status == HttpStatus.SC_OK) {
|
||||
String temp = hm.getResponseBodyAsString();
|
||||
System.out.println(DateUtil.getDateTime()+"-"+ id + "-resp data:"+temp);
|
||||
return temp ;
|
||||
}else{
|
||||
throw new WebserviceException("请求出错!");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
System.out.println(e.getMessage());
|
||||
throw new WebserviceException(e.getMessage());
|
||||
}finally {
|
||||
hm.releaseConnection();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* POST 键值对提交
|
||||
* @param url
|
||||
* @param paramsMap
|
||||
* @return
|
||||
* @throws WebserviceException
|
||||
*/
|
||||
public static String sendParams(String url ,Map<String,Object> paramsMap, String id) throws WebserviceException{
|
||||
|
||||
HttpClientParams params = new HttpClientParams();
|
||||
params.setContentCharset("UTF-8");
|
||||
|
||||
HttpClient hc = new HttpClient(params,new SimpleHttpConnectionManager(true));
|
||||
hc.getHttpConnectionManager().getParams().setConnectionTimeout(10000);
|
||||
hc.getHttpConnectionManager().getParams().setSoTimeout(10000);
|
||||
PostMethod hm = new PostMethod(url);
|
||||
// GetMethod gm = new GetMethod(url);
|
||||
hm.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=UTF-8");
|
||||
|
||||
Protocol myhttps = new Protocol("https", new MySSLProtocolSocketFactory(), 443);
|
||||
Protocol.registerProtocol("https", myhttps);
|
||||
|
||||
try {
|
||||
for(String key : paramsMap.keySet()){
|
||||
hm.addParameter(key, paramsMap.get(key).toString());
|
||||
}
|
||||
System.out.println(DateUtil.getDateTime()+">>>" + id + ">>>url>>>" + url
|
||||
+ ">>>sendParams报文>>>" + paramsMap.toString());
|
||||
int status = hc.executeMethod(hm);
|
||||
if(status == HttpStatus.SC_OK) {
|
||||
String temp = hm.getResponseBodyAsString();
|
||||
System.out.println(DateUtil.getDateTime()+">>>" + id + ">>>resp data>>>"+ JSONObject.parseObject(temp));
|
||||
return temp ;
|
||||
}else{
|
||||
throw new WebserviceException("请求出错!"+status);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
System.out.println(e.getMessage());
|
||||
throw new WebserviceException(e.getMessage());
|
||||
}finally {
|
||||
hm.releaseConnection();
|
||||
}
|
||||
}
|
||||
|
||||
public static String sendGet(String url) throws WebserviceException{
|
||||
|
||||
HttpClientParams params = new HttpClientParams();
|
||||
params.setContentCharset("UTF-8");
|
||||
|
||||
HttpClient hc = new HttpClient(params,new SimpleHttpConnectionManager(true));
|
||||
hc.getHttpConnectionManager().getParams().setConnectionTimeout(5000);
|
||||
hc.getHttpConnectionManager().getParams().setSoTimeout(5000);
|
||||
GetMethod getMethod = new GetMethod(url);
|
||||
getMethod.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=UTF-8");
|
||||
try {
|
||||
System.out.println("url:"+url);
|
||||
|
||||
int status = hc.executeMethod(getMethod);
|
||||
|
||||
if(status == HttpStatus.SC_OK) {
|
||||
String temp = getMethod.getResponseBodyAsString();
|
||||
System.out.println("resp data:"+temp);
|
||||
return temp ;
|
||||
}else{
|
||||
throw new WebserviceException("请求出错!");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
System.out.println(e.getMessage());
|
||||
throw new WebserviceException(e.getMessage());
|
||||
}finally {
|
||||
getMethod.releaseConnection();
|
||||
}
|
||||
}
|
||||
|
||||
public static String postHttp(String urls, NameValuePair[] nvp) throws Exception {
|
||||
try {
|
||||
String result = "";
|
||||
// 定义http客户端对象--httpClient
|
||||
HttpClient httpClient = new HttpClient();
|
||||
// 定义并实例化客户端链接对象-postMethod
|
||||
PostMethod postMethod = new PostMethod(urls);
|
||||
httpClient.setConnectionTimeout(5000);
|
||||
|
||||
try {
|
||||
|
||||
postMethod.setRequestHeader("application/json", "UTF-8");
|
||||
|
||||
postMethod.getParams().setParameter(HttpMethodParams.HTTP_CONTENT_CHARSET, "utf-8");
|
||||
|
||||
// 将表单的值放入postMethod中
|
||||
postMethod.addParameters(nvp);
|
||||
// 定义访问地址的链接状态
|
||||
int statusCode = 0;
|
||||
try {
|
||||
// 客户端请求url数据
|
||||
statusCode = httpClient.executeMethod(postMethod);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
// 请求成功状态-200
|
||||
if (statusCode == HttpStatus.SC_OK) {
|
||||
try {
|
||||
result = postMethod.getResponseBodyAsString();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
|
||||
} finally {
|
||||
// 释放链接
|
||||
postMethod.releaseConnection();
|
||||
httpClient.getHttpConnectionManager().closeIdleConnections(0);
|
||||
}
|
||||
return result;
|
||||
} catch (Exception e) {
|
||||
throw new Exception(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public static String getHttp(String urls, NameValuePair[] nvp) throws Exception {
|
||||
try {
|
||||
String result = "";
|
||||
// 定义http客户端对象--httpClient
|
||||
HttpClient httpClient = new HttpClient();
|
||||
|
||||
// 定义并实例化客户端链接对象-postMethod
|
||||
GetMethod getMethod = new GetMethod(urls);
|
||||
|
||||
try {
|
||||
// 设置http的头
|
||||
|
||||
// (1)、这里可以设置自己想要的编码格式
|
||||
getMethod.getParams().setContentCharset("utf-8");
|
||||
|
||||
// (2)、对于get方法也可以这样设置
|
||||
getMethod.getParams().setParameter(HttpMethodParams.HTTP_CONTENT_CHARSET, "utf-8");
|
||||
|
||||
// (3)、还可以如下这样设置
|
||||
getMethod.addRequestHeader("Content-Type", "text/html; charset=UTF-8");
|
||||
|
||||
getMethod.setQueryString(nvp);
|
||||
|
||||
// 定义访问地址的链接状态
|
||||
int statusCode = 0;
|
||||
try {
|
||||
// 客户端请求url数据
|
||||
statusCode = httpClient.executeMethod(getMethod);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
// 请求成功状态-200
|
||||
if (statusCode == HttpStatus.SC_OK) {
|
||||
try {
|
||||
result = getMethod.getResponseBodyAsString();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else {
|
||||
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
||||
} finally {
|
||||
// 释放链接
|
||||
getMethod.releaseConnection();
|
||||
httpClient.getHttpConnectionManager().closeIdleConnections(0);
|
||||
}
|
||||
return result;
|
||||
} catch (Exception e) {
|
||||
throw new Exception(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
// 验证设备唯一码,验证设备分配账户号
|
||||
// Map<String, Object> paramsMap = new HashMap<String, Object>();
|
||||
// paramsMap.put("error_code","1");
|
||||
// paramsMap.put("msg","TRUE1");
|
||||
// paramsMap.put("data","{\"Result\":{\"ResponseStatus\":{\"ErrorCode\":500,\"IsSuccess\":false,\"Errors\":[{\"FieldName\":null,\"Message\":\"插件取消了保存操作,可能因为数据不合法。\",\"DIndex\":0}],\"SuccessEntitys\":[],\"SuccessMessages\":[],\"MsgCode\":0},\"Id\":\"\",\"NeedReturnData\":[{}]}}");
|
||||
//
|
||||
// List<Map<String, Object>> mapl = new ArrayList<Map<String, Object>>();
|
||||
// mapl.add(paramsMap);
|
||||
//
|
||||
// String str = JSONObject.toJSONString(mapl);
|
||||
// System.out.println(str);
|
||||
//
|
||||
//// JSONObject jsonObject = JSONObject.parseObject(str);
|
||||
// JSONArray jsonObject = JSONArray.parseArray(str);
|
||||
//
|
||||
// System.out.println(jsonObject.getJSONObject(0).getString("data"));
|
||||
//
|
||||
// JSONObject jsonObjects = JSONObject.parseObject(jsonObject.getJSONObject(0).getString("data")).getJSONObject("Result").getJSONObject("ResponseStatus");
|
||||
//
|
||||
// String message = jsonObjects.getInteger("ErrorCode") + ":" + jsonObjects.getJSONArray("Errors").getJSONObject(0).getString("Message");
|
||||
// String FieldName = jsonObjects.getInteger("ErrorCode") + ":" + jsonObjects.getJSONArray("Errors").getJSONObject(0).getString("FieldName");
|
||||
//
|
||||
// System.out.println(message);
|
||||
// System.out.println(FieldName);
|
||||
|
||||
// String context = "{\"type\":1,\"batchNub\":\"\",\"qctype\":2,\"prodNumber\":\"10401000006\",\"qrcode\":[\"https%3a%2f%2fbetascan.vats.com.cn%2fscan%2f3%2f001f3618fd5d4d1d84125c04d5c2ebe6\",\"https://betascan.vats.com.cn/scan/3/002f3618fd5d4d1d84125c04d5c2ebe6\",\"https://betascan.vats.com.cn/scan/3/003f3618fd5d4d1d84125c04d5c2ebe6\"],\"operateUser\":\"47\",\"companyCode\":\"25\"}";
|
||||
// try {
|
||||
//// String map1 = new RequestUtil().send("https://apistest.vatsliquor.com/hzztlgs/addProductQrcode?token=aHp6dC0xNTY2Mjc4OTcwMTE5LXZhdHM_", context);
|
||||
//
|
||||
//// System.out.println(map1);
|
||||
// } catch (WebserviceException e) {
|
||||
// // TODO Auto-generated catch block
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
//
|
||||
|
||||
|
||||
|
||||
// if("1".equals(jsonObject.get("error_code")) || "TRUE".equals(jsonObject.get("msg"))) {
|
||||
// System.out.println(jsonObject.get("data"));
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package abacus.springboot.example.vo;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>Title:BaiduToken</p>
|
||||
<p>Description: BaiduToken-临时对象</p>
|
||||
@author chuanZeng
|
||||
@date 2026年8月18日
|
||||
*/
|
||||
public class BaiduToken {
|
||||
|
||||
private long id;
|
||||
private int version;
|
||||
private String token;
|
||||
private String expirydate;
|
||||
private Date dt;
|
||||
public long getId() {
|
||||
return id;
|
||||
}
|
||||
public void setId(long id) {
|
||||
this.id = id;
|
||||
}
|
||||
public int getVersion() {
|
||||
return version;
|
||||
}
|
||||
public void setVersion(int version) {
|
||||
this.version = version;
|
||||
}
|
||||
public String getToken() {
|
||||
return token;
|
||||
}
|
||||
public void setToken(String token) {
|
||||
this.token = token;
|
||||
}
|
||||
public String getExpirydate() {
|
||||
return expirydate;
|
||||
}
|
||||
public void setExpirydate(String expirydate) {
|
||||
this.expirydate = expirydate;
|
||||
}
|
||||
public Date getDt() {
|
||||
return dt;
|
||||
}
|
||||
public void setDt(Date dt) {
|
||||
this.dt = dt;
|
||||
}
|
||||
}
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
package abacus.springboot.example.vo;
|
||||
|
||||
/**
|
||||
* <p>Title:PMSConfigKey</p>
|
||||
<p>Description:配置-key-全局设定</p>
|
||||
@author chuanZeng
|
||||
@date 2026年8月18日
|
||||
*/
|
||||
public interface PMSConfigKey {
|
||||
|
||||
/** keyGroup:系统号*/
|
||||
public static final String KEY_GROUP = "pms";
|
||||
|
||||
/** set:WMS接口对接参数配置*/
|
||||
public static final String PMS_WMSCONF = "pms.wmsconf";
|
||||
/** pms.wmsconf:访问地址*/
|
||||
public static final String PMS_WMSCONF_URL = "url";
|
||||
/** pms.wmsconf:appkey*/
|
||||
public static final String PMS_WMSCONF_APPKEY = "appkey";
|
||||
/** pms.wmsconf:sessionKey*/
|
||||
public static final String PMS_WMSCONF_SESSIONKEY = "sessionKey";
|
||||
/** pms.wmsconf:goodsOwner*/
|
||||
public static final String PMS_WMSCONF_GOODSOWNER = "goodsOwner";
|
||||
|
||||
public static final String PMS_WMSCONF_SHOPCODE = "shopCode";
|
||||
public static final String PMS_WMSCONF_SHOPNAME = "shopName";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
package abacus.springboot.example.vo;
|
||||
|
||||
/**
|
||||
* <p>Title:SiDepositlocation</p>
|
||||
<p>Description: JDBC-数据返回-临时存储对象</p>
|
||||
@author chuanZeng
|
||||
@date 2026年8月18日
|
||||
*/
|
||||
public class SiDepositlocation {
|
||||
|
||||
// 仓库编码
|
||||
private String id;
|
||||
// 是否推送WMS:1-WMS,0-WDT
|
||||
private int push;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
public int getPush() {
|
||||
return push;
|
||||
}
|
||||
public void setPush(int push) {
|
||||
this.push = push;
|
||||
}
|
||||
}
|
||||
+357
@@ -0,0 +1,357 @@
|
||||
package abacus.springboot.example.wsi;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import abacus.springboot.example.api.view.ApiBillHg;
|
||||
import abacus.springboot.example.api.view.ApiBillHgItem;
|
||||
import abacus.springboot.example.api.view.ApiBillHgPayment;
|
||||
import abacus.springboot.example.api.view.ApiJcBill;
|
||||
import abacus.springboot.example.api.view.ApiJcBillHgSearchItem;
|
||||
import abacus.springboot.example.api.view.ApiJcBillItem;
|
||||
import abacus.springboot.example.api.view.ApiJcBillSearch;
|
||||
import abacus.springboot.example.api.view.ApiReqJcBill;
|
||||
import abacus.springboot.example.api.view.JcBillCount;
|
||||
import abacus.springboot.example.api.view.JcCodeFlow;
|
||||
import abacus.springboot.example.api.view.JcProduct;
|
||||
import abacus.springboot.example.api.view.JcProductBillSouce;
|
||||
import abacus.springboot.example.dao.JcBill;
|
||||
import abacus.springboot.example.dao.JcBillHg;
|
||||
import abacus.springboot.example.dao.JcBillHgPay;
|
||||
import abacus.springboot.example.dao.JcBillInItem;
|
||||
import abacus.springboot.example.dao.JcBillPhoto;
|
||||
import abacus.springboot.example.dao.JcBillSourceItem;
|
||||
import abacus.springboot.example.dao.JcSourceItem;
|
||||
|
||||
/**
|
||||
* <p>Title:ApiJcBillServiceIF</p>
|
||||
<p>Description: 对外接口service服务</p>
|
||||
@author chuanZeng
|
||||
@date 2026年8月18日
|
||||
*/
|
||||
public interface ApiJcBillServiceIF {
|
||||
|
||||
/**
|
||||
* 稽查收货查询
|
||||
* @param keyword
|
||||
* @param status
|
||||
* @param pageable
|
||||
* @return
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public Page<ApiJcBillSearch> queryApiJcBillSearch(String keyword, String employee, String status, Pageable pageable) throws RuntimeException;
|
||||
|
||||
|
||||
/**
|
||||
* 稽查收货主单查询
|
||||
* @param id
|
||||
* @return
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public ApiJcBill queryApiJcBillById(String id) throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 稽查收货明细
|
||||
* @param billId
|
||||
* @return
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public List<ApiJcBillItem> queryApiJcBillItemByBIllId(String billId) throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 根据条件查询图片
|
||||
* @param srcid
|
||||
* @param srcitemid
|
||||
* @param typephoto
|
||||
* @return
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public Map<String, List<JcBillPhoto>> queryJcBillPhoto(String srcid) throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 根据条件查询图片
|
||||
* @param srcid
|
||||
* @param srcitemid
|
||||
* @param typephoto
|
||||
* @return
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public Map<String, List<JcBillPhoto>> queryJcBillPhotoIn(List<String> srcids) throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 保存
|
||||
* @param reqJcBill
|
||||
* @param jcBill
|
||||
* @param createItems
|
||||
* @return
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public ApiReqJcBill saveApiReqJcBill(ApiReqJcBill reqJcBill, JcBill jcBill, List<JcBillSourceItem> createItems) throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 修改
|
||||
* @param reqJcBill
|
||||
* @param jcBill
|
||||
* @param createItems
|
||||
* @param updateItems
|
||||
* @return
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public ApiReqJcBill updateApiReqJcBill(ApiReqJcBill reqJcBill, JcBill jcBill, List<JcBillSourceItem> createItems, List<JcBillSourceItem> updateItems) throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 当前明细行号
|
||||
* @param billId
|
||||
* @return
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public int countJcBillItemIndexno(String billId) throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 查询
|
||||
* @param billId
|
||||
* @return
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public JcBill queryJcBillById(String billId) throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 查询
|
||||
* @param billId
|
||||
* @return
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public List<JcBillSourceItem> queryJcBillSourceItemByBillId(String billId) throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 查询
|
||||
* @param id
|
||||
* @return
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public JcBillSourceItem queryJcBillSourceItembyId(Long id) throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 查询o
|
||||
* @param id
|
||||
* @return
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public JcBillInItem queryJcBillInItemById(Long id) throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 修改状态:待提交>>>待溯源
|
||||
* @param jcBill
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public void updateStatusJcBill(JcBill jcBill, int oldStatus) throws RuntimeException;
|
||||
|
||||
|
||||
/**
|
||||
* 回购列表查询
|
||||
* @param keyword
|
||||
* @param status
|
||||
* @param pageable
|
||||
* @return
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public Page<ApiJcBillHgSearchItem> queryApiJcBillHgSearchItem(String keyword, String employee, String status, Pageable pageable) throws RuntimeException;
|
||||
|
||||
|
||||
/**
|
||||
* 回购;查询品种和件数汇总
|
||||
* @param ids
|
||||
* @return
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public Map<String, JcBillCount> queryJcBillCount(List<String> ids) throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 回购:主单查询
|
||||
* @param id
|
||||
* @return
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public ApiBillHg queryApiBillHgById(String hgId) throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 回购:明细查询
|
||||
* @param billId
|
||||
* @return
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public List<ApiBillHgItem> queryApiBillHgItemByHgId(String hgId) throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 回购:支付明细查询
|
||||
* @param billId
|
||||
* @return
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public List<ApiBillHgPayment> queryApiBillHgPaymentByHgId(String hgId) throws RuntimeException;
|
||||
|
||||
public List<ApiBillHgPayment> queryApiBillHgPaymentByHgId(List<String> hgIds) throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 查询
|
||||
* @param billHg
|
||||
* @return
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public JcBillHg queryJcBillHg(String billHg) throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 修改
|
||||
* @param bill
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public void updateJcBillHg(JcBillHg entity, List<JcBillHgPay> pays) throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 查询图片
|
||||
* @param srcid
|
||||
* @param srcitemid
|
||||
* @param typephoto
|
||||
* @return
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public JcBillPhoto queryJcBillPhoto(String srcid, String srcitemid, String typephoto) throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 查询图片
|
||||
* @param srcid
|
||||
* @param srcitemid
|
||||
* @param typephoto
|
||||
* @return
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public List<JcBillPhoto> queryJcBillPhoto(String srcid, String typephoto) throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 删除或保存图片
|
||||
* @param photos
|
||||
* @param billHg
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public void saveAndDeletePhoto(List<JcBillPhoto> photos, JcBillHg billHg) throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 删除或保存图片
|
||||
* @param photos
|
||||
* @param billHg
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public void saveAndDeletePhoto(List<JcBillPhoto> photos, String billId) throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 查询:下一单待提交的回购单号
|
||||
* @return
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public String lastBillHgId() throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 根据物流码,查询出库相关信息
|
||||
* @param code
|
||||
* @return
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public List<JcCodeFlow> queryJcCodeFlow(List<String> codes) throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 查询朔源明细
|
||||
* @param billId
|
||||
* @return
|
||||
*/
|
||||
public List<JcSourceItem> queryJcSourceItemByBillId(String billId) throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 更新收货明细,以及保存溯源明细
|
||||
* @param items
|
||||
* @param sourceItems
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public void saveJcSourceItem(List<JcBillSourceItem> items, List<JcSourceItem> sourceItems, JcBill jcBill) throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 查询图片
|
||||
* @param srcid
|
||||
* @param srcitemid
|
||||
* @param typephoto
|
||||
* @return
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public JcBillPhoto queryJcBillPhotoById(String id) throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 删除图片
|
||||
* @param entity
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public void deleteJcBillPhotoById(JcBillPhoto entity) throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 删除订单详情以及对应的图片
|
||||
* @param billid
|
||||
* @param itemid
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public void deleteJcSourceItem(String billid, String itemid) throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 获取百度token
|
||||
* @return
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public String getBaiduToken() throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 稽查货品查询-单号查询
|
||||
* @param product
|
||||
* @param stockInId
|
||||
* @param hgId
|
||||
* @return
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public List<JcProduct> queryJcProduct(String product, String stockInId, String hgId) throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 稽查货品查询-单号查询
|
||||
* @param product
|
||||
* @param stockInId
|
||||
* @param hgId
|
||||
* @return
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public List<JcProduct> queryJcProduct(String product, String stockInId) throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 根据稽查单号,查询对应的货品编号
|
||||
* @param billIds
|
||||
* @return
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public Map<String, List<JcProductBillSouce>> queryJcProductBillSouce(List<String> billIds)throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 修改状态
|
||||
* @param jcBill
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public void updateStatusByJcBill(JcBill jcBill, int status) throws RuntimeException;
|
||||
|
||||
public List<JcBillHg> qeryJcBillHgs(List<String> billids) throws RuntimeException;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+341
@@ -0,0 +1,341 @@
|
||||
package abacus.springboot.example.wsi;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
import abacus.springboot.example.dao.JcBill;
|
||||
import abacus.springboot.example.dao.JcBillHg;
|
||||
import abacus.springboot.example.dao.JcBillInItem;
|
||||
import abacus.springboot.example.dao.JcBillPhoto;
|
||||
import abacus.springboot.example.dao.JcBillSourceItem;
|
||||
import abacus.springboot.example.dao.JcSourceItem;
|
||||
import abacus.springboot.example.vo.SiDepositlocation;
|
||||
|
||||
/**
|
||||
* <p>Title:JcBillServiceIF</p>
|
||||
<p>Description: service服务</p>
|
||||
@author chuanZeng
|
||||
@date 2026年8月18日
|
||||
*/
|
||||
public interface JcBillServiceIF {
|
||||
|
||||
/**
|
||||
* 稽查收货查询
|
||||
* @param fromDate
|
||||
* @param thruDate
|
||||
* @param id
|
||||
* @param applicant
|
||||
* @param goods
|
||||
* @param billin
|
||||
* @param goodsid
|
||||
* @param product
|
||||
* @param status
|
||||
* @param pageable
|
||||
* @param typ 1-溯源入库 2-回购通知
|
||||
* @return
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public Page<JcBill> queryJcBill(String fromDate, String thruDate, String id,
|
||||
String applicant, String goods, String billin, String goodsid, String product,
|
||||
String status, int typ, Pageable pageable) throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 查询
|
||||
* @param billId
|
||||
* @return
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public JcBill queryJcBillById(String billId) throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 查询
|
||||
* @param billId
|
||||
* @return
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public List<JcBillSourceItem> queryJcBillSourceItemByBillId(String billId) throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 查询
|
||||
* @param billHg
|
||||
* @return
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public JcBillHg queryJcBillHg(String billHg) throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 查询朔源明细
|
||||
* @param billId
|
||||
* @return
|
||||
*/
|
||||
public List<JcSourceItem> queryJcSourceItemByBillId(String billId) throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 查询朔源明细
|
||||
* @param billId
|
||||
* @return
|
||||
*/
|
||||
public List<JcSourceItem> queryJcSourceItemByBillId(String billId, String srcitemid) throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 查询朔源明细
|
||||
* @param billId
|
||||
* @return
|
||||
*/
|
||||
public List<JcSourceItem> queryJcSourceItemByBillId(String billId, String srcitemid, int status) throws RuntimeException;
|
||||
|
||||
|
||||
/**
|
||||
* 根据条件查询图片
|
||||
* @param srcid
|
||||
* @param srcitemid
|
||||
* @param typephoto
|
||||
* @return
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public Map<String, List<JcBillPhoto>> queryJcBillPhoto(String srcid) throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 查询稽查收货明细
|
||||
* @param id
|
||||
* @return
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public JcBillSourceItem queryJcBillSourceItemById(Long id) throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 稽查溯源明细
|
||||
* @param id
|
||||
* @return
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public JcSourceItem queryJcSourceItemById(Long id) throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 确认溯源
|
||||
* @param billItem
|
||||
* @param sourceItem
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public void saveQuerenBillSourceItem(JcBillSourceItem billItem, JcSourceItem sourceItem) throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 溯源信息驳回
|
||||
* @param billItem
|
||||
* @param sourceItem
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public void saveRejectJcSourceItems(JcBillSourceItem billItem, JcBill jcBill) throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 溯源完成
|
||||
* @param billItem
|
||||
* @param sourceItem
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public void saveCompleteJcBill(List<JcBillInItem> inItems, JcBill jcBill) throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 稽查收货:仓库修改
|
||||
* @param jcBill
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public void updateWarehouse(JcBill jcBill) throws RuntimeException;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param billId
|
||||
* @return
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public List<JcBillInItem> queryJcBillInItemByBillId(String billId) throws RuntimeException;
|
||||
|
||||
public List<JcBillInItem> queryJcBillInItemByBillId(String billId, int status) throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 稽查收货:生成入库单
|
||||
* @param jcBill
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public void createStockIn(JcBill jcBill) throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 查询回购单明细
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
public JcBillInItem queryJcBillInItemById(Long id) throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 终止回购
|
||||
* @param inItem
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public void saveTerminateHgInItem(JcBillInItem inItem) throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 批量查询回购单明细
|
||||
* @param ids
|
||||
* @return
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public List<JcBillInItem> findAllById(List<Long> ids) throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 确定通知
|
||||
* @param inItems
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public void saveInformHg(List<JcBillInItem> inItems, JcBill jcBill, JcBillHg jcBillHg, String photoUrl) throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 分页查询 回购订单
|
||||
* @param typ 1-回购认款,2-回购分仓
|
||||
* @return
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public Page<JcBillHg> queryJcBillHg(String fromDate, String thruDate, String account,
|
||||
String salearea, String id, String billId, String status, String product,
|
||||
String manager,
|
||||
int typ, Pageable pageable) throws RuntimeException;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param billId
|
||||
* @return
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public List<JcBillInItem> queryJcBillInItemByBillHg(String billHgId) throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 回购驳回
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public void saveRejectBillHg(int status, int typ, JcBill jcBill, JcBillHg billHg, List<JcBillInItem> inItems) throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 确认收款
|
||||
* @param billHg
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public void saveQuerenSk(JcBillHg billHg, boolean fcFlag) throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 分仓
|
||||
* @param billHg
|
||||
* @param fcFlag
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public void savecreateFc(JcBillHg billHg) throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 修改分仓仓库
|
||||
* @param oldJsonStr
|
||||
* @param billHg
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public void updateFcWarehouse(String oldJsonStr, JcBillHg billHg) throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 修改运营备注
|
||||
* @param oldJsonStr
|
||||
* @param billHg
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public void updateRemark(String oldJsonStr, JcBillHg billHg) throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 修改收货地址
|
||||
* @param oldJsonStr
|
||||
* @param billHg
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public void updatePac(String oldJsonStr, JcBillHg billHg) throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 保存溯源明细信息
|
||||
* @param item
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public JcSourceItem saveJcSourceItem(JcSourceItem item) throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 删除溯源明细信息
|
||||
* @param ids
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public void deleteJcSourceItem(List<Long> ids) throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 修改回购单价
|
||||
* @param inItem
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public void updateHgprice(JcBillInItem inItem)throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 修改回购单价
|
||||
* @param inItem
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public void updateOperatorname(JcBillInItem inItem, String oldStr)throws RuntimeException;
|
||||
|
||||
public void saveJcBillInItem(List<JcBillInItem> items)throws RuntimeException;
|
||||
|
||||
public List<JcBillSourceItem> queryJcBillSourceItemInBillId(List<String> billIds) throws RuntimeException;
|
||||
|
||||
|
||||
/**
|
||||
* 待入库撤回
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public void saveRejectBill(int status, JcBill jcBill, List<JcBillInItem> inItems, List<JcBillSourceItem> sourceItems) throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 修改溯源信息客户
|
||||
* @param inItems
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public void updateSourceItemAccount(String sourceItemLogJson, String billSourceItemLogJson, String billSourceItemNewLogJson, JcSourceItem sourceItem, List<JcBillSourceItem> billSourceItems,
|
||||
List<JcBillInItem> oldInItems, List<JcBillInItem> inItems)throws RuntimeException;
|
||||
|
||||
/**
|
||||
* 稽查:根据稽查单号,稽查单关联物理仓管理策略
|
||||
* @param dept
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public SiDepositlocation querySiDepositlocation(String srcid) throws Exception;
|
||||
|
||||
/**
|
||||
* 回购:根据回购单号,回购单关联物理仓管理策略
|
||||
* @param dept
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public SiDepositlocation querySiDepositlocationHGfc(String srcid) throws Exception;
|
||||
|
||||
/**
|
||||
* WMS取消订单接口
|
||||
* @param orderCode
|
||||
* @param orderType
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public JSONObject gwisSubCancelOrder(String orderCode, String orderType) throws Exception;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
##xxl-job
|
||||
xxl:
|
||||
job:
|
||||
# admin:
|
||||
### 调度中心部署跟地址 [选填]:如调度中心集群部署存在多个地址则用逗号分隔。执行器将会使用该地址进行"执行器心跳注册"和"任务结果回调";为空则关闭自动注册; http://localhost:9900/xxl-job-admin
|
||||
# addresses: http://localhost:9900
|
||||
# addresses: http://192.168.2.130:9900
|
||||
executor:
|
||||
### 执行器AppName [选填]:执行器心跳注册分组依据;为空则关闭自动注册
|
||||
# appname: example-test
|
||||
### 执行器注册 [选填]:优先使用该配置作为注册地址,为空时使用内嵌服务 ”IP:PORT“ 作为注册地址。从而更灵活的支持容器类型执行器动态IP和动态映射端口问题。
|
||||
# address:
|
||||
### 执行器IP [选填]:默认为空表示自动获取IP,多网卡时可手动设置指定IP,该IP不会绑定Host仅作为通讯实用;地址信息用于 "执行器注册" 和 "调度中心请求并触发任务";
|
||||
# ip:
|
||||
### 执行器AppName [选填]:执行器心跳注册分组依据;为空则关闭自动注册
|
||||
### 使用产品
|
||||
appname: example
|
||||
### 执行器端口号 [选填]:小于等于0则自动获取;默认端口为9999,单机部署多个执行器时,注意要配置不同执行器端口;
|
||||
#因为使用docker部署,为了方便docker镜像映射,发布时固定使用“9001”作为定时任务执行器端口
|
||||
port: 9061
|
||||
### 执行器日志文件保存天数 [选填] : 过期日志自动清理, 限制值大于等于3时生效; 否则, 如-1, 关闭自动清理功能;
|
||||
logretentiondays: 7
|
||||
### 执行器运行日志文件存储磁盘路径 [选填] :需要对该路径拥有读写权限;为空则使用默认路径;
|
||||
logpath: D:\apps\file\work\log\xxljob\
|
||||
### 执行器通讯TOKEN [选填]:非空时启用;
|
||||
# accessToken:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,100 @@
|
||||
logging:
|
||||
config: classpath:logback-spring.xml
|
||||
maxhistory: 7
|
||||
|
||||
server:
|
||||
port: 9060
|
||||
max-http-header-size: 20480
|
||||
servlet:
|
||||
context-path: /example
|
||||
session:
|
||||
timeout: PT4H
|
||||
|
||||
|
||||
spring:
|
||||
data:
|
||||
jpa:
|
||||
repositories:
|
||||
bootstrap-mode: lazy #jpa延迟启动
|
||||
main:
|
||||
lazy-initialization: true #bean延迟启动
|
||||
servlet:
|
||||
multipart:
|
||||
max-file-size: 50MB #上传文件的大小限定
|
||||
max-request-size: 50MB #上传请求数据的大小限定,限定请求的总数据大小
|
||||
profiles:
|
||||
active: xxljob
|
||||
datasource:
|
||||
druid:
|
||||
#如果连接泄露,是否需要回收泄露的连接,默认false
|
||||
removeAbandoned: true
|
||||
#如果回收了泄露的连接,是否要打印一条log,默认false
|
||||
logAbandoned: true
|
||||
#连接回收的超时时间(单位:秒),默认5分钟
|
||||
removeAbandonedTimeout: 300
|
||||
#查询超时时间(单位:秒)
|
||||
query-timeout: 300
|
||||
#事务查询超时时间(单位:秒),如果小于或等于0,则取query-timeout配置
|
||||
#transaction-query-timeout: 5
|
||||
# 配置初始化大小、最小、最大
|
||||
initial-size: 10
|
||||
minIdle: 11
|
||||
max-active: 60
|
||||
# 配置获取连接等待超时的时间(单位:毫秒)
|
||||
max-wait: 60000
|
||||
|
||||
|
||||
|
||||
#在线接口文档扫描类路径
|
||||
springdoc:
|
||||
packages-to-scan:
|
||||
- abacus.springboot.example.api
|
||||
paths-to-match:
|
||||
|
||||
|
||||
abacus:
|
||||
#在线数据字典扫描类路径
|
||||
entitypackages:
|
||||
- abacus.springboot.example.dao
|
||||
#本系统Controller扫描类路径
|
||||
controllerPackages:
|
||||
- abacus.springboot.example.controller
|
||||
#以下uri将不被统一响应体拦截包装器进行包装
|
||||
responseExcludePath:
|
||||
|
||||
# acas系统编码
|
||||
acas:
|
||||
current:
|
||||
number: example
|
||||
|
||||
|
||||
feign:
|
||||
client:
|
||||
config:
|
||||
#feign全局超时配置,单位:毫秒
|
||||
default:
|
||||
connectTimeout: 10000
|
||||
readTimeout: 30000
|
||||
#单个微服务超时配置,优先级高于全局
|
||||
# abacus-oauth2:
|
||||
# connectTimeout: 10000
|
||||
# readTimeout: 10000
|
||||
|
||||
|
||||
management:
|
||||
endpoint:
|
||||
metrics:
|
||||
enabled: true
|
||||
prometheus:
|
||||
enabled: true
|
||||
startup:
|
||||
enabled: true
|
||||
endpoints:
|
||||
web:
|
||||
exposure:
|
||||
include: "*"
|
||||
base-path: /services/actuator
|
||||
metrics:
|
||||
export:
|
||||
prometheus:
|
||||
enabled: true
|
||||
@@ -0,0 +1,31 @@
|
||||
spring:
|
||||
application:
|
||||
name: example
|
||||
cloud:
|
||||
nacos:
|
||||
username: v10dev
|
||||
password: Abacus2022
|
||||
config:
|
||||
server-addr: 192.168.2.130:8848
|
||||
namespace: 3d18c67a-d086-4c16-b377-a633c487eafb
|
||||
file-extension: yml
|
||||
group: DEFAULT_GROUP
|
||||
extension-configs:
|
||||
- data-id: abacus-database.yml
|
||||
group: COMMON_GROUP
|
||||
refresh: false
|
||||
- data-id: abacus-discovery.yml
|
||||
group: COMMON_GROUP
|
||||
refresh: false
|
||||
- data-id: abacus-acas.yml
|
||||
group: COMMON_GROUP
|
||||
refresh: false
|
||||
- data-id: abacus-redis.yml
|
||||
group: COMMON_GROUP
|
||||
refresh: false
|
||||
- data-id: abacus-actuator.yml
|
||||
group: COMMON_GROUP
|
||||
refresh: false
|
||||
- data-id: abacus-xxljob.yml
|
||||
group: COMMON_GROUP
|
||||
refresh: false
|
||||
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration>
|
||||
<!-- always a good activate OnConsoleStatusListener -->
|
||||
<statusListener
|
||||
class="ch.qos.logback.core.status.OnConsoleStatusListener" />
|
||||
|
||||
<springProperty name="LOGPATH" source="logging.path" />
|
||||
<springProperty name="APPNAME" source="spring.application.name" />
|
||||
|
||||
<property name="log.path" value="F:/Eclipse/work/log/${APPNAME:-.}/${HOSTNAME:-.}" />
|
||||
|
||||
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/access/access.log</file>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
|
||||
<fileNamePattern>${log.path}/access/access-%i.log</fileNamePattern>
|
||||
<minIndex>1</minIndex>
|
||||
<maxIndex>1</maxIndex>
|
||||
</rollingPolicy>
|
||||
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
|
||||
<maxFileSize>10MB</maxFileSize>
|
||||
</triggeringPolicy>
|
||||
<encoder>
|
||||
<pattern>%t{yyyy-MM-dd HH:mm:ss.SS} "%r" %s %b %D %h "%i{Referer}" "%i{User-Agent}" "%i{X-Request-ID}" "%i{X-Forwarded-For}"</pattern>
|
||||
<charset>UTF-8</charset>
|
||||
</encoder>
|
||||
</appender>
|
||||
<appender-ref ref="FILE" />
|
||||
</configuration>
|
||||
@@ -0,0 +1,140 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- 日志级别从低到高分为TRACE < DEBUG < INFO < WARN < ERROR < FATAL,如果设置为WARN,则低于WARN的信息都不会输出 -->
|
||||
<!-- scan:当此属性设置为true时,配置文件如果发生改变,将会被重新加载,默认值为true -->
|
||||
<!-- scanPeriod:设置监测配置文件是否有修改的时间间隔,如果没有给出时间单位,默认单位是毫秒。当scan为true时,此属性生效。默认的时间间隔为1分钟。 -->
|
||||
<!-- debug:当此属性设置为true时,将打印出logback内部日志信息,实时查看logback运行状态。默认值为false。 -->
|
||||
<configuration scan="true">
|
||||
|
||||
<contextName>logback</contextName>
|
||||
|
||||
<springProperty name="APPNAME" source="spring.application.name" />
|
||||
<springProperty name="LOGMAXHISTORY" source="logging.maxhistory" />
|
||||
|
||||
<property name="log.path" value="F:/Eclipse/work//log/${APPNAME:-.}/${HOSTNAME:-.}" />
|
||||
<property name="log.maxhistory" value="${LOGMAXHISTORY:-7}" />
|
||||
<property name="log.maxfilesize" value="50MB" />
|
||||
<property name="log.pattern" value="%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level [%15.15t] %-40.40logger{39} [%X{traceId:-},%X{spanId:-}] : %m%n" />
|
||||
|
||||
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
|
||||
<level>info</level>
|
||||
</filter>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
<charset>UTF-8</charset>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<appender name="INFO_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/info/info.log</file>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<fileNamePattern>${log.path}/info/info.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
|
||||
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
|
||||
<maxFileSize>${log.maxfilesize}</maxFileSize>
|
||||
</timeBasedFileNamingAndTriggeringPolicy>
|
||||
<maxHistory>${log.maxhistory}</maxHistory>
|
||||
</rollingPolicy>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<level>INFO</level>
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
<charset>UTF-8</charset>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<appender name="WARN_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/warn/warn.log</file>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<fileNamePattern>${log.path}/warn/warn.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
|
||||
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
|
||||
<maxFileSize>${log.maxfilesize}</maxFileSize>
|
||||
</timeBasedFileNamingAndTriggeringPolicy>
|
||||
<maxHistory>${log.maxhistory}</maxHistory>
|
||||
</rollingPolicy>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<level>WARN</level>
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
<charset>UTF-8</charset>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<appender name="ERROR_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/error/error.log</file>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<fileNamePattern>${log.path}/error/error.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
|
||||
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
|
||||
<maxFileSize>${log.maxfilesize}</maxFileSize>
|
||||
</timeBasedFileNamingAndTriggeringPolicy>
|
||||
<maxHistory>${log.maxhistory}</maxHistory>
|
||||
</rollingPolicy>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<level>ERROR</level>
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
<charset>UTF-8</charset>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<appender name="DEBUG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/debug/debug.log</file>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<fileNamePattern>${log.path}/debug/debug.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
|
||||
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
|
||||
<maxFileSize>${log.maxfilesize}</maxFileSize>
|
||||
</timeBasedFileNamingAndTriggeringPolicy>
|
||||
<maxHistory>${log.maxhistory}</maxHistory>
|
||||
</rollingPolicy>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<level>DEBUG</level>
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
<charset>UTF-8</charset>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
|
||||
<!--慢sql输出-->
|
||||
<appender name="ABACUSSLOWSQL_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/slowsql/slowsql.log</file>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<fileNamePattern>${log.path}/slowsql/slowsql.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
|
||||
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
|
||||
<maxFileSize>${log.maxfilesize}</maxFileSize>
|
||||
</timeBasedFileNamingAndTriggeringPolicy>
|
||||
<MaxHistory>30</MaxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
<charset>UTF-8</charset>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<logger name="abacusslowsql" additivity="false" >
|
||||
<appender-ref ref="ABACUSSLOWSQL_FILE"/>
|
||||
</logger>
|
||||
|
||||
<root level="info">
|
||||
<appender-ref ref="CONSOLE" />
|
||||
<appender-ref ref="DEBUG_FILE" />
|
||||
<appender-ref ref="INFO_FILE" />
|
||||
<appender-ref ref="WARN_FILE" />
|
||||
<appender-ref ref="ERROR_FILE" />
|
||||
</root>
|
||||
|
||||
|
||||
<!--开发环境:打印控制台-->
|
||||
|
||||
</configuration>
|
||||
@@ -0,0 +1,31 @@
|
||||
##xxl-job
|
||||
xxl:
|
||||
job:
|
||||
# admin:
|
||||
### 调度中心部署跟地址 [选填]:如调度中心集群部署存在多个地址则用逗号分隔。执行器将会使用该地址进行"执行器心跳注册"和"任务结果回调";为空则关闭自动注册; http://localhost:9900/xxl-job-admin
|
||||
# addresses: http://localhost:9900
|
||||
# addresses: http://192.168.2.130:9900
|
||||
executor:
|
||||
### 执行器AppName [选填]:执行器心跳注册分组依据;为空则关闭自动注册
|
||||
# appname: example-test
|
||||
### 执行器注册 [选填]:优先使用该配置作为注册地址,为空时使用内嵌服务 ”IP:PORT“ 作为注册地址。从而更灵活的支持容器类型执行器动态IP和动态映射端口问题。
|
||||
# address:
|
||||
### 执行器IP [选填]:默认为空表示自动获取IP,多网卡时可手动设置指定IP,该IP不会绑定Host仅作为通讯实用;地址信息用于 "执行器注册" 和 "调度中心请求并触发任务";
|
||||
# ip:
|
||||
### 执行器AppName [选填]:执行器心跳注册分组依据;为空则关闭自动注册
|
||||
### 使用产品
|
||||
appname: example
|
||||
### 执行器端口号 [选填]:小于等于0则自动获取;默认端口为9999,单机部署多个执行器时,注意要配置不同执行器端口;
|
||||
#因为使用docker部署,为了方便docker镜像映射,发布时固定使用“9001”作为定时任务执行器端口
|
||||
port: 9061
|
||||
### 执行器日志文件保存天数 [选填] : 过期日志自动清理, 限制值大于等于3时生效; 否则, 如-1, 关闭自动清理功能;
|
||||
logretentiondays: 7
|
||||
### 执行器运行日志文件存储磁盘路径 [选填] :需要对该路径拥有读写权限;为空则使用默认路径;
|
||||
logpath: D:\apps\file\work\log\xxljob\
|
||||
### 执行器通讯TOKEN [选填]:非空时启用;
|
||||
# accessToken:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
server:
|
||||
port: 9000
|
||||
max-http-header-size: 20480
|
||||
servlet:
|
||||
session:
|
||||
timeout: PT4H
|
||||
|
||||
|
||||
spring:
|
||||
data:
|
||||
jpa:
|
||||
repositories:
|
||||
bootstrap-mode: lazy #jpa延迟启动
|
||||
main:
|
||||
lazy-initialization: true #bean延迟启动
|
||||
servlet:
|
||||
multipart:
|
||||
max-file-size: 50MB #上传文件的大小限定
|
||||
max-request-size: 50MB #上传请求数据的大小限定,限定请求的总数据大小
|
||||
profiles:
|
||||
active: xxljob
|
||||
datasource:
|
||||
druid:
|
||||
#如果连接泄露,是否需要回收泄露的连接,默认false
|
||||
removeAbandoned: true
|
||||
#如果回收了泄露的连接,是否要打印一条log,默认false
|
||||
logAbandoned: true
|
||||
#连接回收的超时时间,默认5分钟
|
||||
#removeAbandonedTimeout: 10
|
||||
#查询超时时间(单位:秒)
|
||||
query-timeout: 300
|
||||
#事务查询超时时间(单位:秒),如果小于或等于0,则取query-timeout配置
|
||||
#transaction-query-timeout: 5
|
||||
# 配置初始化大小、最小、最大
|
||||
initial-size: 5
|
||||
minIdle: 10
|
||||
max-active: 30
|
||||
# 配置获取连接等待超时的时间(单位:毫秒)
|
||||
max-wait: 60000
|
||||
|
||||
# acas系统编码
|
||||
acas:
|
||||
current:
|
||||
number: example
|
||||
|
||||
|
||||
#在线接口文档扫描类路径
|
||||
springdoc:
|
||||
packages-to-scan:
|
||||
- abacus.springboot.example.springdoc
|
||||
paths-to-match:
|
||||
|
||||
|
||||
abacus:
|
||||
#在线数据字典扫描类路径
|
||||
entitypackages:
|
||||
- abacus.springboot.example
|
||||
#本系统Controller扫描类路径
|
||||
controllerPackages:
|
||||
- abacus.springboot.example
|
||||
#以下uri将不被统一响应体拦截包装器进行包装
|
||||
responseExcludePath:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
spring:
|
||||
application:
|
||||
name: example
|
||||
cloud:
|
||||
nacos:
|
||||
username: v10dev
|
||||
password: Abacus2022
|
||||
config:
|
||||
server-addr: 192.168.2.130:8848
|
||||
namespace: 3d18c67a-d086-4c16-b377-a633c487eafb
|
||||
file-extension: yml
|
||||
group: DEFAULT_GROUP
|
||||
extension-configs:
|
||||
- data-id: abacus-database.yml
|
||||
group: COMMON_GROUP
|
||||
refresh: false
|
||||
- data-id: abacus-discovery.yml
|
||||
group: COMMON_GROUP
|
||||
refresh: false
|
||||
- data-id: abacus-acas.yml
|
||||
group: COMMON_GROUP
|
||||
refresh: false
|
||||
- data-id: abacus-redis.yml
|
||||
group: COMMON_GROUP
|
||||
refresh: false
|
||||
- data-id: abacus-actuator.yml
|
||||
group: COMMON_GROUP
|
||||
refresh: false
|
||||
- data-id: abacus-xxljob.yml
|
||||
group: COMMON_GROUP
|
||||
refresh: false
|
||||
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration>
|
||||
<!-- always a good activate OnConsoleStatusListener -->
|
||||
<statusListener
|
||||
class="ch.qos.logback.core.status.OnConsoleStatusListener" />
|
||||
|
||||
<springProperty name="LOGPATH" source="logging.path" />
|
||||
<springProperty name="APPNAME" source="spring.application.name" />
|
||||
|
||||
<property name="log.path" value="/apps/log/${APPNAME:-.}/${HOSTNAME:-.}" />
|
||||
|
||||
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/access/access.log</file>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
|
||||
<fileNamePattern>${log.path}/access/access-%i.log</fileNamePattern>
|
||||
<minIndex>1</minIndex>
|
||||
<maxIndex>1</maxIndex>
|
||||
</rollingPolicy>
|
||||
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
|
||||
<maxFileSize>100MB</maxFileSize>
|
||||
</triggeringPolicy>
|
||||
<encoder>
|
||||
<pattern>%t{yyyy-MM-dd HH:mm:ss.SSS} "%r" %s %b %D %h "%i{Referer}" "%i{User-Agent}" "%i{X-Request-ID}" "%i{X-Forwarded-For}" "%i{commonParam}" </pattern>
|
||||
<charset>UTF-8</charset>
|
||||
</encoder>
|
||||
</appender>
|
||||
<appender-ref ref="FILE" />
|
||||
</configuration>
|
||||
@@ -0,0 +1,168 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- 日志级别从低到高分为TRACE < DEBUG < INFO < WARN < ERROR < FATAL,如果设置为WARN,则低于WARN的信息都不会输出 -->
|
||||
<!-- scan:当此属性设置为true时,配置文件如果发生改变,将会被重新加载,默认值为true -->
|
||||
<!-- scanPeriod:设置监测配置文件是否有修改的时间间隔,如果没有给出时间单位,默认单位是毫秒。当scan为true时,此属性生效。默认的时间间隔为1分钟。 -->
|
||||
<!-- debug:当此属性设置为true时,将打印出logback内部日志信息,实时查看logback运行状态。默认值为false。 -->
|
||||
<configuration scan="true">
|
||||
|
||||
<contextName>logback</contextName>
|
||||
|
||||
<springProperty name="APPNAME" source="spring.application.name" />
|
||||
<springProperty name="LOGMAXHISTORY" source="logging.maxhistory" />
|
||||
<conversionRule conversionWord="menu" converterClass="abacus.commons.log.MenuConverter" />
|
||||
<conversionRule conversionWord="module" converterClass="abacus.commons.log.ModuleConverter" />
|
||||
<conversionRule conversionWord="rid" converterClass="abacus.commons.log.RequestIdConverter" />
|
||||
|
||||
|
||||
<property name="log.path" value="/apps/log/${APPNAME:-.}/${HOSTNAME:-.}" />
|
||||
<property name="log.maxhistory" value="${LOGMAXHISTORY:-365}" />
|
||||
<property name="log.maxfilesize" value="100MB" />
|
||||
<property name="log.pattern" value="%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level [%15.15t] %-40.40logger{39} [%rid,%X{traceId:-},%X{spanId:-}] [%menu,%module] : %m%n" />
|
||||
|
||||
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
|
||||
<level>info</level>
|
||||
</filter>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
<charset>UTF-8</charset>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<appender name="INFO_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/info/info.log</file>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<fileNamePattern>${log.path}/info/info.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
|
||||
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
|
||||
<maxFileSize>${log.maxfilesize}</maxFileSize>
|
||||
</timeBasedFileNamingAndTriggeringPolicy>
|
||||
<maxHistory>${log.maxhistory}</maxHistory>
|
||||
</rollingPolicy>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<level>INFO</level>
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
<charset>UTF-8</charset>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<appender name="WARN_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/warn/warn.log</file>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<fileNamePattern>${log.path}/warn/warn.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
|
||||
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
|
||||
<maxFileSize>${log.maxfilesize}</maxFileSize>
|
||||
</timeBasedFileNamingAndTriggeringPolicy>
|
||||
<maxHistory>${log.maxhistory}</maxHistory>
|
||||
</rollingPolicy>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<level>WARN</level>
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
<charset>UTF-8</charset>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<appender name="ERROR_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/error/error.log</file>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<fileNamePattern>${log.path}/error/error.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
|
||||
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
|
||||
<maxFileSize>${log.maxfilesize}</maxFileSize>
|
||||
</timeBasedFileNamingAndTriggeringPolicy>
|
||||
<maxHistory>${log.maxhistory}</maxHistory>
|
||||
</rollingPolicy>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<level>ERROR</level>
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
<charset>UTF-8</charset>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<appender name="DEBUG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/debug/debug.log</file>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<fileNamePattern>${log.path}/debug/debug.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
|
||||
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
|
||||
<maxFileSize>${log.maxfilesize}</maxFileSize>
|
||||
</timeBasedFileNamingAndTriggeringPolicy>
|
||||
<maxHistory>${log.maxhistory}</maxHistory>
|
||||
</rollingPolicy>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<level>DEBUG</level>
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
<charset>UTF-8</charset>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
|
||||
<!--慢sql输出-->
|
||||
<appender name="ABACUSSLOWSQL_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/slowsql/slowsql.log</file>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<fileNamePattern>${log.path}/slowsql/slowsql.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
|
||||
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
|
||||
<maxFileSize>${log.maxfilesize}</maxFileSize>
|
||||
</timeBasedFileNamingAndTriggeringPolicy>
|
||||
<MaxHistory>30</MaxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
<charset>UTF-8</charset>
|
||||
</encoder>
|
||||
</appender>
|
||||
<logger name="abacusslowsql" additivity="false" >
|
||||
<appender-ref ref="CONSOLE" />
|
||||
<appender-ref ref="ABACUSSLOWSQL_FILE"/>
|
||||
</logger>
|
||||
|
||||
<!--请求外部日志输出-->
|
||||
<appender name="EXTERNALREQUESTLOG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/resttemplate/resttemplate.log</file>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<fileNamePattern>${log.path}/resttemplate/resttemplate.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
|
||||
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
|
||||
<maxFileSize>${log.maxfilesize}</maxFileSize>
|
||||
</timeBasedFileNamingAndTriggeringPolicy>
|
||||
<MaxHistory>30</MaxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
<charset>UTF-8</charset>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<logger name="externalrequestlog" additivity="false" >
|
||||
<appender-ref ref="CONSOLE" />
|
||||
<appender-ref ref="EXTERNALREQUESTLOG_FILE"/>
|
||||
</logger>
|
||||
|
||||
|
||||
|
||||
|
||||
<root level="info">
|
||||
<appender-ref ref="CONSOLE" />
|
||||
<appender-ref ref="DEBUG_FILE" />
|
||||
<appender-ref ref="INFO_FILE" />
|
||||
<appender-ref ref="WARN_FILE" />
|
||||
<appender-ref ref="ERROR_FILE" />
|
||||
</root>
|
||||
|
||||
|
||||
<!--开发环境:打印控制台-->
|
||||
|
||||
</configuration>
|
||||
@@ -0,0 +1,17 @@
|
||||
##xxl-job
|
||||
xxl:
|
||||
job:
|
||||
executor:
|
||||
### 执行器AppName [选填]:执行器心跳注册分组依据;为空则关闭自动注册
|
||||
### 使用产品
|
||||
appname: example
|
||||
### 执行器端口号 [选填]:小于等于0则自动获取;默认端口为9999,单机部署多个执行器时,注意要配置不同执行器端口;
|
||||
#因为使用docker部署,为了方便docker镜像映射,发布时固定使用“9001”作为定时任务执行器端口
|
||||
port: 9001
|
||||
### 执行器日志文件保存天数 [选填] : 过期日志自动清理, 限制值大于等于3时生效; 否则, 如-1, 关闭自动清理功能;
|
||||
logretentiondays: 7
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
server:
|
||||
port: 9000
|
||||
spring:
|
||||
jackson:
|
||||
date-format: yyyy-MM-dd HH:mm:ss
|
||||
time-zone: GMT+8
|
||||
profiles:
|
||||
active: xxljob
|
||||
jpa:
|
||||
show-sql: false
|
||||
datasource:
|
||||
druid:
|
||||
#如果连接泄露,是否需要回收泄露的连接,默认false
|
||||
removeAbandoned: true
|
||||
#如果回收了泄露的连接,是否要打印一条log,默认false
|
||||
logAbandoned: true
|
||||
#连接回收的超时时间,默认5分钟
|
||||
#removeAbandonedTimeout: 10
|
||||
#查询超时时间(单位:秒)
|
||||
query-timeout: 300
|
||||
#事务查询超时时间(单位:秒),如果小于或等于0,则取query-timeout配置
|
||||
#transaction-query-timeout: 5
|
||||
# 配置初始化大小、最小、最大
|
||||
initial-size: 5
|
||||
minIdle: 10
|
||||
max-active: 30
|
||||
# 配置获取连接等待超时的时间(单位:毫秒)
|
||||
max-wait: 60000
|
||||
|
||||
acas:
|
||||
current:
|
||||
number: example
|
||||
|
||||
springdoc:
|
||||
packages-to-scan:
|
||||
- abacus.springboot.example.api
|
||||
paths-to-match:
|
||||
|
||||
abacus:
|
||||
entitypackages:
|
||||
- abacus.springboot.example
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
spring:
|
||||
application:
|
||||
name: example
|
||||
cloud:
|
||||
nacos:
|
||||
username: v10dev
|
||||
password: Abacus2022
|
||||
config:
|
||||
server-addr: v10sys.abacus.private:8848
|
||||
namespace: 3d18c67a-d086-4c16-b377-a633c487eafb
|
||||
file-extension: yml
|
||||
group: DEFAULT_GROUP
|
||||
extension-configs:
|
||||
- data-id: abacus-database.yml
|
||||
group: COMMON_GROUP
|
||||
refresh: false
|
||||
- data-id: abacus-discovery.yml
|
||||
group: COMMON_GROUP
|
||||
refresh: false
|
||||
- data-id: abacus-acas.yml
|
||||
group: COMMON_GROUP
|
||||
refresh: false
|
||||
- data-id: abacus-redis.yml
|
||||
group: COMMON_GROUP
|
||||
refresh: false
|
||||
- data-id: abacus-actuator.yml
|
||||
group: COMMON_GROUP
|
||||
refresh: false
|
||||
- data-id: abacus-xxljob.yml
|
||||
group: COMMON_GROUP
|
||||
refresh: false
|
||||
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration>
|
||||
<!-- always a good activate OnConsoleStatusListener -->
|
||||
<statusListener
|
||||
class="ch.qos.logback.core.status.OnConsoleStatusListener" />
|
||||
|
||||
<springProperty name="LOGPATH" source="logging.path" />
|
||||
<springProperty name="APPNAME" source="spring.application.name" />
|
||||
|
||||
<property name="log.path" value="/apps/log/${APPNAME:-.}/${HOSTNAME:-.}" />
|
||||
|
||||
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/access/access.log</file>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
|
||||
<fileNamePattern>${log.path}/access/access-%i.log</fileNamePattern>
|
||||
<minIndex>1</minIndex>
|
||||
<maxIndex>1</maxIndex>
|
||||
</rollingPolicy>
|
||||
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
|
||||
<maxFileSize>10MB</maxFileSize>
|
||||
</triggeringPolicy>
|
||||
<encoder>
|
||||
<pattern>%t{yyyy-MM-dd HH:mm:ss.SSS} "%r" %s %b %D %h "%i{Referer}" "%i{User-Agent}" "%i{X-Request-ID}" "%i{X-Forwarded-For}" "%i{commonParam}" </pattern>
|
||||
<charset>UTF-8</charset>
|
||||
</encoder>
|
||||
</appender>
|
||||
<appender-ref ref="FILE" />
|
||||
</configuration>
|
||||
@@ -0,0 +1,168 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- 日志级别从低到高分为TRACE < DEBUG < INFO < WARN < ERROR < FATAL,如果设置为WARN,则低于WARN的信息都不会输出 -->
|
||||
<!-- scan:当此属性设置为true时,配置文件如果发生改变,将会被重新加载,默认值为true -->
|
||||
<!-- scanPeriod:设置监测配置文件是否有修改的时间间隔,如果没有给出时间单位,默认单位是毫秒。当scan为true时,此属性生效。默认的时间间隔为1分钟。 -->
|
||||
<!-- debug:当此属性设置为true时,将打印出logback内部日志信息,实时查看logback运行状态。默认值为false。 -->
|
||||
<configuration scan="true">
|
||||
|
||||
<contextName>logback</contextName>
|
||||
|
||||
<springProperty name="APPNAME" source="spring.application.name" />
|
||||
<springProperty name="LOGMAXHISTORY" source="logging.maxhistory" />
|
||||
<conversionRule conversionWord="menu" converterClass="abacus.commons.log.MenuConverter" />
|
||||
<conversionRule conversionWord="module" converterClass="abacus.commons.log.ModuleConverter" />
|
||||
<conversionRule conversionWord="rid" converterClass="abacus.commons.log.RequestIdConverter" />
|
||||
|
||||
|
||||
<property name="log.path" value="/apps/log/${APPNAME:-.}/${HOSTNAME:-.}" />
|
||||
<property name="log.maxhistory" value="${LOGMAXHISTORY:-7}" />
|
||||
<property name="log.maxfilesize" value="50MB" />
|
||||
<property name="log.pattern" value="%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level [%15.15t] %-40.40logger{39} [%rid,%X{traceId:-},%X{spanId:-}] [%menu,%module] : %m%n" />
|
||||
|
||||
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
|
||||
<level>info</level>
|
||||
</filter>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
<charset>UTF-8</charset>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<appender name="INFO_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/info/info.log</file>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<fileNamePattern>${log.path}/info/info.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
|
||||
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
|
||||
<maxFileSize>${log.maxfilesize}</maxFileSize>
|
||||
</timeBasedFileNamingAndTriggeringPolicy>
|
||||
<maxHistory>${log.maxhistory}</maxHistory>
|
||||
</rollingPolicy>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<level>INFO</level>
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
<charset>UTF-8</charset>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<appender name="WARN_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/warn/warn.log</file>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<fileNamePattern>${log.path}/warn/warn.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
|
||||
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
|
||||
<maxFileSize>${log.maxfilesize}</maxFileSize>
|
||||
</timeBasedFileNamingAndTriggeringPolicy>
|
||||
<maxHistory>${log.maxhistory}</maxHistory>
|
||||
</rollingPolicy>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<level>WARN</level>
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
<charset>UTF-8</charset>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<appender name="ERROR_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/error/error.log</file>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<fileNamePattern>${log.path}/error/error.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
|
||||
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
|
||||
<maxFileSize>${log.maxfilesize}</maxFileSize>
|
||||
</timeBasedFileNamingAndTriggeringPolicy>
|
||||
<maxHistory>${log.maxhistory}</maxHistory>
|
||||
</rollingPolicy>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<level>ERROR</level>
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
<charset>UTF-8</charset>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<appender name="DEBUG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/debug/debug.log</file>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<fileNamePattern>${log.path}/debug/debug.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
|
||||
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
|
||||
<maxFileSize>${log.maxfilesize}</maxFileSize>
|
||||
</timeBasedFileNamingAndTriggeringPolicy>
|
||||
<maxHistory>${log.maxhistory}</maxHistory>
|
||||
</rollingPolicy>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<level>DEBUG</level>
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
<charset>UTF-8</charset>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
|
||||
<!--慢sql输出-->
|
||||
<appender name="ABACUSSLOWSQL_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/slowsql/slowsql.log</file>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<fileNamePattern>${log.path}/slowsql/slowsql.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
|
||||
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
|
||||
<maxFileSize>${log.maxfilesize}</maxFileSize>
|
||||
</timeBasedFileNamingAndTriggeringPolicy>
|
||||
<MaxHistory>30</MaxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
<charset>UTF-8</charset>
|
||||
</encoder>
|
||||
</appender>
|
||||
<logger name="abacusslowsql" additivity="false" >
|
||||
<appender-ref ref="CONSOLE" />
|
||||
<appender-ref ref="ABACUSSLOWSQL_FILE"/>
|
||||
</logger>
|
||||
|
||||
<!--请求外部日志输出-->
|
||||
<appender name="EXTERNALREQUESTLOG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/resttemplate/resttemplate.log</file>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<fileNamePattern>${log.path}/resttemplate/resttemplate.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
|
||||
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
|
||||
<maxFileSize>${log.maxfilesize}</maxFileSize>
|
||||
</timeBasedFileNamingAndTriggeringPolicy>
|
||||
<MaxHistory>30</MaxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
<charset>UTF-8</charset>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<logger name="externalrequestlog" additivity="false" >
|
||||
<appender-ref ref="CONSOLE" />
|
||||
<appender-ref ref="EXTERNALREQUESTLOG_FILE"/>
|
||||
</logger>
|
||||
|
||||
|
||||
|
||||
|
||||
<root level="info">
|
||||
<appender-ref ref="CONSOLE" />
|
||||
<appender-ref ref="DEBUG_FILE" />
|
||||
<appender-ref ref="INFO_FILE" />
|
||||
<appender-ref ref="WARN_FILE" />
|
||||
<appender-ref ref="ERROR_FILE" />
|
||||
</root>
|
||||
|
||||
|
||||
<!--开发环境:打印控制台-->
|
||||
|
||||
</configuration>
|
||||
@@ -0,0 +1,16 @@
|
||||
# 子系统中文名称(负责人姓名)
|
||||
|
||||
## 1.0.1(2024-04-12)
|
||||
**依赖子系统**
|
||||
**前置条件**
|
||||
**更新说明**
|
||||
- 2026-08-18 M2 示例净化(示范即正确):D1 `JcBillAccess` 原生 SQL 全量参数化(86 处 `?` 占位符,0 处字符串拼参);D2 `JcBillController` 业务编排下沉至新建 `esb/JcBillBizService`(含 `saveJcBill`/`updateJcbill`/`hgAnalyze` 等 5 方法),并移除死代码 `jcAnalyze`;D3 包名 `repositroy`→`repository`(含 7 个接口文件名重命名)。详见 `docs/log/2026-08-18-m2-example-purify.md`。
|
||||
|
||||
## 1.0.2(2026-08-19)
|
||||
**依赖子系统**
|
||||
**前置条件**
|
||||
**更新说明**
|
||||
- 治理体系落地(ADS Retrofit):新增 `.project.agents/`(CLAUDE/AGENTS/SELF_CONSTRAINTS/VIBECODING_GUIDE/settings + context 四文档),前后端共享约束单源化于工作区 `docs/`(`coding-standards.md`/`architecture.md`/`agent-guide.md`),本仓库文档以指针引用。
|
||||
- 分层约定与 `docs/coding-standards.md` 对齐(api/controller/dao/esb/pi/impl/repository/wsi/config/util/vo);`util`、`vo` 包冻结(既有兼容、新增禁止)。
|
||||
- 工作区纳入单一 git 仓库(`D:\workBuddySpace\member`)。
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1,259 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- 配置说明: 节点<abacus> 属性[id],系统唯一标识 数据库语法翻译器属性[translator],配置为“false”,则不开启对各个数据库的翻译功能,不配置或配置其他值默认为“true”;
|
||||
当[translator]为true时,升级sql使用mssqlserver数据库的语法进行配置;列如,ERP的各个系统,需要满足不同数据库的部署需求;
|
||||
当[translator]为false时,升级sql使用那种数据库语法由开发者自己指定;例如,云商城相关各个系统,直接使用MySQL语法进行配置;
|
||||
<abacus translator="true"> 节点<upgrade>,配置每个版本的升级sql,版本属性[version],值格式“yyyy-MM-dd”或"yyyy-MM-dd.count",
|
||||
count代表次数,如日期相同,则对比次数 <upgrade id="example" version="2022-03-03"> 节点<sql>,配置该版本需要执行的sql,每条sql使用符号“;”分隔
|
||||
<sql></sql> 以下为可选配置,并且晚于节点<sql>中的sql执行: 节点<oracle>,指定oracle数据库专用sql,例如有oracle专用关键字的sql
|
||||
<oracle></oracle> 节点<sybase>,指定sybase数据库专用sql,例如有sybase专用关键字的sql <sybase></sybase>
|
||||
节点<mysql>,指定mysql数据库专用sql,例如有mysql专用关键字的sql <mysql></mysql> </upgrade> </abacus>
|
||||
注意事项: 1、应用第一次部署时,以当天日期作为初始版本 2、当一次升级有多个版本升级sql需要执行时,会以version值升序排序,从上到下执行
|
||||
3、更新sql尽量配置产品功能升级的常规sql,例如建表、新增字段等等。 需要大量调整数据的sql、带有逻辑调整数据的sql、使用了列存储索引的表,单独联系项目人员执行。
|
||||
4、不建议建表或者新增字段时使用“default”默认一个值,mssqlserver删除或者修改字段时,会因为DF约束执行失败,最好由程序指定默认值
|
||||
5、自增关键字identity固定放在字段类型后面,否则在sybase数据库会执行失败 6、翻译器现支持mssqlserver转mysql、oracle、sybase的部分语法,具体语法参考语法测试用例 -->
|
||||
<abacus id="example" translator="true">
|
||||
<upgrade version="2026-08-18.2">
|
||||
<sql>
|
||||
-- 稽查主单
|
||||
create table jc_bill (
|
||||
id varchar(20) not null,
|
||||
version int not null,
|
||||
status int default (1) null,
|
||||
goods varchar(120) null,
|
||||
warehouse varchar(20) null,
|
||||
warehousename varchar(120) null,
|
||||
receivedt varchar(10) null,
|
||||
quantity decimal(30,8) null,
|
||||
subtotal decimal(30,2) null,
|
||||
billin varchar(20) null,
|
||||
billindt datetime null,
|
||||
applicant varchar(20) null,
|
||||
applicantname varchar(120) null,
|
||||
applicantdt datetime null,
|
||||
dt datetime default current_timestamp not null,
|
||||
constraint pk_jc_bill primary key (id)
|
||||
);
|
||||
create index jc_bill_search on jc_bill(id, applicant, status, goods,
|
||||
applicantdt, dt);
|
||||
create index jc_bill_id on jc_bill(id, goods, dt);
|
||||
create index jc_bill_dt on jc_bill(dt);
|
||||
|
||||
-- 稽查明细
|
||||
create table jc_billsource_item (
|
||||
id bigint auto_increment not null primary key, -- 自增长编码
|
||||
version int not null,
|
||||
indexno int null,
|
||||
billid varchar(20) not null,
|
||||
status int default (1) null,
|
||||
recsource varchar(20) null,
|
||||
recplatform varchar(20) null,
|
||||
channel varchar(60) null,
|
||||
price decimal(30,8) null,
|
||||
quantity decimal(30,8) null,
|
||||
numbers decimal(30,8) null,
|
||||
subtotal decimal(30,2) null,
|
||||
goodsid varchar(20) null,
|
||||
logisticsid varchar(60) null,
|
||||
billout varchar(600) null,
|
||||
billoutdt datetime null,
|
||||
billoutwh varchar(20) null,
|
||||
billoutwhname varchar(60) null,
|
||||
product varchar(20) null,
|
||||
productname varchar(200) null,
|
||||
account varchar(20) null,
|
||||
accountname varchar(200) null,
|
||||
operator varchar(20) null,
|
||||
operatorname varchar(60) null,
|
||||
groupid varchar(20) null,
|
||||
groupname varchar(60) null,
|
||||
salearea varchar(20) null,
|
||||
saleareaname varchar(60) null,
|
||||
source varchar(20) null,
|
||||
reason varchar(300) null,
|
||||
dt datetime default current_timestamp not null
|
||||
);
|
||||
create index jc_billsource_item_billid on jc_billsource_item(billid);
|
||||
|
||||
-- 溯源明细
|
||||
create table jc_source_item (
|
||||
id bigint auto_increment not null primary key, -- 自增长编码
|
||||
version int not null,
|
||||
billid varchar(20) not null,
|
||||
srcitemid varchar(20) not null,
|
||||
status int default (0) null,
|
||||
goodsid varchar(20) null,
|
||||
logisticsid varchar(60) null,
|
||||
billout varchar(20) null,
|
||||
billoutdt datetime null,
|
||||
billoutwh varchar(20) null,
|
||||
billoutwhname varchar(60) null,
|
||||
product varchar(20) null,
|
||||
productname varchar(200) null,
|
||||
account varchar(20) null,
|
||||
accountname varchar(200) null,
|
||||
operator varchar(20) null,
|
||||
operatorname varchar(60) null,
|
||||
groupid varchar(20) null,
|
||||
groupname varchar(60) null,
|
||||
salearea varchar(20) null,
|
||||
saleareaname varchar(60) null,
|
||||
source varchar(20) null,
|
||||
dt datetime default current_timestamp not null
|
||||
);
|
||||
create index jc_source_item_billid on jc_source_item(billid, source,
|
||||
srcitemid);
|
||||
create index jc_source_item_billid_status on jc_source_item(billid,
|
||||
srcitemid, status);
|
||||
|
||||
-- 稽查入库(回购通知)明细(对溯源信息汇总的入库信息-待生成回购)
|
||||
create table jc_billin_item (
|
||||
id bigint auto_increment not null primary key, -- 自增长编码
|
||||
version int not null,
|
||||
billid varchar(20) not null,
|
||||
billin varchar(20) null,
|
||||
billhg varchar(20) null,
|
||||
status int default (1) null,
|
||||
channel varchar(60) null,
|
||||
account varchar(20) null,
|
||||
accountname varchar(200) null,
|
||||
product varchar(20) null,
|
||||
productname varchar(200) null,
|
||||
price decimal(30,8) null,
|
||||
quantity decimal(30,8) null,
|
||||
numbers decimal(30,8) null,
|
||||
hgprice decimal(30,8) null,
|
||||
hgamount decimal(30,2) null,
|
||||
operator varchar(20) null,
|
||||
operatorname varchar(60) null,
|
||||
groupid varchar(20) null,
|
||||
groupname varchar(60) null,
|
||||
salearea varchar(20) null,
|
||||
saleareaname varchar(60) null,
|
||||
fhquantity decimal(30,8) null,
|
||||
fhnumbers decimal(30,8) null,
|
||||
fhwarehouse varchar(20) null,
|
||||
fhwarehousename varchar(120) null,
|
||||
wdtorder varchar(20) null,
|
||||
wdtbillout varchar(20) null,
|
||||
wdtbillouttyp varchar(20) null,
|
||||
wdtdt datetime null,
|
||||
dt datetime default current_timestamp not null
|
||||
);
|
||||
create index jc_billin_item_billid on jc_billin_item(billhg, billid,
|
||||
billin);
|
||||
create index jc_billin_item_status on jc_billin_item(status);
|
||||
|
||||
-- 回购单-主单
|
||||
create table jc_billhg (
|
||||
id varchar(20) not null,
|
||||
version int not null,
|
||||
billid varchar(20) not null,
|
||||
status int default (1) null,
|
||||
source varchar(20) null,
|
||||
account varchar(20) null,
|
||||
accountname varchar(200) null,
|
||||
quantity decimal(30,8) null,
|
||||
subtotal decimal(30,2) null,
|
||||
freight decimal(30,2) null,
|
||||
manager varchar(20) null,
|
||||
managername varchar(60) null,
|
||||
consignee varchar(20) null,
|
||||
consigneephone varchar(30) null,
|
||||
province varchar(10) null,
|
||||
provincename varchar(60) null,
|
||||
city varchar(10) null,
|
||||
cityname varchar(60) null,
|
||||
area varchar(10) null,
|
||||
areaname varchar(60) null,
|
||||
address varchar(300) null,
|
||||
receiveway varchar(20) null,
|
||||
remark varchar(300) null,
|
||||
remark1 varchar(300) null,
|
||||
salearea varchar(20) null,
|
||||
saleareaname varchar(60) null,
|
||||
groupid varchar(20) null,
|
||||
groupname varchar(60) null,
|
||||
fhwarehouse varchar(20) null,
|
||||
fhwarehousename varchar(120) null,
|
||||
wdtorder varchar(20) null,
|
||||
wdtbillout varchar(20) null,
|
||||
wdtbillouttyp varchar(20) null,
|
||||
wdtdt datetime null,
|
||||
logisticsname varchar(60) null,
|
||||
logisticscode varchar(60) null,
|
||||
logisticstype varchar(60) null,
|
||||
logisticsno varchar(20) null,
|
||||
found varchar(20) null,
|
||||
foundname varchar(60) null,
|
||||
founddt datetime null,
|
||||
submit varchar(20) null,
|
||||
submitname varchar(60) null,
|
||||
submitdt datetime null,
|
||||
audit varchar(20) null,
|
||||
auditname varchar(60) null,
|
||||
auditdt datetime null,
|
||||
dt datetime default current_timestamp not null,
|
||||
constraint pk_jc_billhg primary key (id)
|
||||
);
|
||||
create index jc_billhg_founddt on jc_billhg(founddt, account, salearea,
|
||||
billid, status, manager);
|
||||
create index jc_billhg_billid on jc_billhg(billid);
|
||||
create index jc_billhg_status_founddt on jc_billhg(status, founddt);
|
||||
create index jc_billhg_consigneephone on jc_billhg(consigneephone, account,
|
||||
accountname);
|
||||
create index jc_billhg_dt on jc_billhg(dt);
|
||||
|
||||
-- 回购单-支付明细
|
||||
create table jc_billhg_pay (
|
||||
id bigint auto_increment not null primary key, -- 自增长编码
|
||||
version int not null,
|
||||
billid varchar(20) not null,
|
||||
billhg varchar(20) not null,
|
||||
payment varchar(20) not null,
|
||||
amount decimal(30,2) null,
|
||||
zhmc varchar(20) not null,
|
||||
khyh varchar(150) not null,
|
||||
yhzh varchar(60) not null,
|
||||
dt datetime default current_timestamp not null
|
||||
);
|
||||
create index jc_billhg_pay_billhg on jc_billhg_pay(billhg, payment);
|
||||
create index jc_billhg_pay_billid on jc_billhg_pay(billid);
|
||||
create index jc_billhg_pay_dt on jc_billhg_pay(dt);
|
||||
|
||||
-- 图片
|
||||
create table jc_bill_photo (
|
||||
id bigint auto_increment not null primary key, -- 自增长编码
|
||||
version int not null,
|
||||
srcid varchar(20) not null,
|
||||
srcitemid varchar(20) not null,
|
||||
typephoto varchar(30) not null,
|
||||
urlphoto varchar(200) not null,
|
||||
dt datetime default current_timestamp not null
|
||||
);
|
||||
create index jc_bill_photo_srcitemid on jc_bill_photo(srcid, srcitemid,
|
||||
typephoto);
|
||||
create index jc_bill_photo_srcid on jc_bill_photo(srcid, typephoto);
|
||||
|
||||
-- 2025-03-14
|
||||
alter table jc_billhg add column proofaccountname varchar(150) null;
|
||||
alter table jc_billhg add column proofdt datetime null;
|
||||
alter table jc_bill add column hgstatus int default 0 null;
|
||||
|
||||
-- 2025-01-22(alter column 改为 modify column)
|
||||
alter table jc_billsource_item modify column billout varchar(600) null;
|
||||
|
||||
-- 2025-01-16
|
||||
alter table jc_billin_item add column wdtoutdt datetime null;
|
||||
alter table jc_billin_item add column wdtindt datetime null;
|
||||
alter table jc_billhg add column wdtoutdt datetime null;
|
||||
alter table jc_billhg add column wdtindt datetime null;
|
||||
alter table jc_billsource_item modify column logisticsid varchar(600)
|
||||
null;
|
||||
alter table jc_source_item modify column logisticsid varchar(600) null;
|
||||
|
||||
-- 2025-01-06(原文件重复出现两次,已去重)
|
||||
alter table jc_bill add column dept varchar(20) null;
|
||||
|
||||
</sql>
|
||||
</upgrade>
|
||||
</abacus>
|
||||
Reference in New Issue
Block a user