平潭库存对比,诏安发票确认后上传

dev
anthonywj 1 year ago
parent cf77eeb91c
commit 19d6023f34

@ -7,6 +7,7 @@ import com.glxp.mipsdl.req.ctqyy.GetSickPrescribeRequest;
import com.glxp.mipsdl.req.ctqyy.GetSickRequest;
import com.glxp.mipsdl.req.post.*;
import com.glxp.mipsdl.res.BaseResponse;
import com.glxp.mipsdl.res.udiwms.InvProductRequest;
import org.springframework.web.bind.annotation.RequestBody;
/**
@ -62,6 +63,15 @@ public interface BaseHttpClient {
*/
BaseResponse getInvProducts(UdiwmsInvProductsRequest udiwmsInvProductsRequest);
/**
*
*
* @param udiwmsInvProductsRequest
* @return
*/
BaseResponse getInvResult(InvProductRequest udiwmsInvProductsRequest);
/**
*
*

@ -31,6 +31,7 @@ import com.glxp.mipsdl.req.ctqyy.GetSickPrescribeRequest;
import com.glxp.mipsdl.req.ctqyy.GetSickRequest;
import com.glxp.mipsdl.req.post.*;
import com.glxp.mipsdl.res.BaseResponse;
import com.glxp.mipsdl.res.udiwms.InvProductRequest;
import com.glxp.mipsdl.service.auth.AuthWarehouseService;
import com.glxp.mipsdl.service.thrsys.ThrCorpService;
import com.glxp.mipsdl.service.thrsys.ThrSystemDetailService;
@ -258,4 +259,9 @@ public abstract class CommonHttpClient implements BaseHttpClient {
public BaseResponse getHsfl(FilterThrHslbRequest hslbRequest) {
return null;
}
@Override
public BaseResponse getInvResult(InvProductRequest udiwmsInvProductsRequest) {
return null;
}
}

@ -37,11 +37,17 @@ import com.glxp.mipsdl.entity.inout.*;
import com.glxp.mipsdl.entity.thrsys.ThrInvWarehouseEntity;
import com.glxp.mipsdl.entity.thrsys.ThrSystemBusApiEntity;
import com.glxp.mipsdl.http.HttpClient;
import com.glxp.mipsdl.req.base.UdiwmsInvProductsRequest;
import com.glxp.mipsdl.req.base.UdiwmsOrderDetailRequest;
import com.glxp.mipsdl.req.base.UdiwmsOrderRequest;
import com.glxp.mipsdl.req.ptxhyy.PtxhyyInvRequest;
import com.glxp.mipsdl.req.ptxhyy.PtxhyyOrderDetailRequest;
import com.glxp.mipsdl.req.ptxhyy.PtxhyyOrderRequest;
import com.glxp.mipsdl.res.BaseResponse;
import com.glxp.mipsdl.res.PageSimpleResponse;
import com.glxp.mipsdl.res.ptxhyy.PtxhInvResponse;
import com.glxp.mipsdl.res.udiwms.InvProductRequest;
import com.glxp.mipsdl.res.udiwms.ThrInvResultResponse;
import com.glxp.mipsdl.service.auth.AuthWarehouseService;
import com.glxp.mipsdl.service.order.OrderUploadLogService;
import com.glxp.mipsdl.service.thrsys.ThrCorpService;
@ -288,6 +294,7 @@ public class PtxhyyClient extends CommonHttpClient {
return submitOrder(orderEntity, ptxhyyOrderRequest);
}
/**
*
*
@ -370,6 +377,13 @@ public class PtxhyyClient extends CommonHttpClient {
}
/**
*
*
* @param orderEntity
* @param udiwmsOrderRequest
* @return
*/
public BaseResponse submitOrder(IoOrderEntity orderEntity, Object udiwmsOrderRequest) {
//记录日志
IoOrderUploadLogEntity uploadLog = new IoOrderUploadLogEntity();
@ -422,6 +436,45 @@ public class PtxhyyClient extends CommonHttpClient {
}
/**
* /
*/
public BaseResponse getInvResult(InvProductRequest invProductRequest) {
PtxhyyInvRequest ptxhyyInvRequest = new PtxhyyInvRequest();
ptxhyyInvRequest.setKssj(DateUtil.formatDate(invProductRequest.getStartDate(), "yyyy-MM-dd"));
ptxhyyInvRequest.setJssj(DateUtil.formatDate(invProductRequest.getEndDate(), "yyyy-MM-dd"));
String response = httpClient.postJson(thrSystemDetailService.getUrlExclude(null) + "/api/foreign/CKCX", ptxhyyInvRequest);
BaseResponse<PageSimpleResponse<PtxhInvResponse>> baseResponse =
JSONObject.parseObject(response, new TypeReference<BaseResponse<PageSimpleResponse<PtxhInvResponse>>>() {
});
if (baseResponse.getCode() == 20000) {
List<PtxhInvResponse> ptxhInvResponses = baseResponse.getData().getList();
List<ThrInvResultResponse> thrInvResultResponses = new ArrayList<>();
if (CollUtil.isNotEmpty(ptxhInvResponses)) {
for (PtxhInvResponse ptxhInvResponse : ptxhInvResponses) {
ThrInvResultResponse thrInvResultResponse = new ThrInvResultResponse();
thrInvResultResponse.setThrCode(ptxhInvResponse.getFyxh());
thrInvResultResponse.setCpmctymc(ptxhInvResponse.getFymc());
thrInvResultResponse.setPrice(ptxhInvResponse.getFydj());
thrInvResultResponse.setMeasname(ptxhInvResponse.getDw());
thrInvResultResponse.setDeptName(ptxhInvResponse.getZxks());
thrInvResultResponse.setInvName(ptxhInvResponse.getZxks());
thrInvResultResponse.setType(ptxhInvResponse.getLb());
thrInvResultResponse.setRelCount(ptxhInvResponse.getZsl());
thrInvResultResponses.add(thrInvResultResponse);
}
}
PageSimpleResponse<ThrInvResultResponse> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(thrInvResultResponses.size() + 0l);
pageSimpleResponse.setList(thrInvResultResponses);
return ResultVOUtils.success(pageSimpleResponse);
}
return baseResponse;
}
// public void getHslb() {
// String response = httpClient.postJson(thrSystemDetailService.getUrl(null), udiwmsUnitRequest);
// BaseResponse baseResponse = JSONObject.parseObject(response, BaseResponse.class);

@ -23,6 +23,7 @@ import com.glxp.mipsdl.dao.basic.BasicBussinessTypeDao;
import com.glxp.mipsdl.dao.basic.BasicCorpDao;
import com.glxp.mipsdl.dao.inout.*;
import com.glxp.mipsdl.dao.thrsys.ThrInvWarehouseDao;
import com.glxp.mipsdl.dao.thrsys.ThrOrderUploadBustypesMapper;
import com.glxp.mipsdl.dao.thrsys.ThrSystemBusApiDao;
import com.glxp.mipsdl.entity.auth.AuthUserEntity;
import com.glxp.mipsdl.entity.auth.AuthWarehouseEntity;
@ -32,6 +33,7 @@ import com.glxp.mipsdl.entity.basic.BasicCorpEntity;
import com.glxp.mipsdl.entity.inout.*;
import com.glxp.mipsdl.entity.thrsys.ThrCorpEntity;
import com.glxp.mipsdl.entity.thrsys.ThrInvWarehouseEntity;
import com.glxp.mipsdl.entity.thrsys.ThrOrderUploadBustypesEntity;
import com.glxp.mipsdl.entity.thrsys.ThrSystemBusApiEntity;
import com.glxp.mipsdl.http.HttpClient;
import com.glxp.mipsdl.req.base.*;
@ -110,6 +112,8 @@ public class ZaxyyClient extends CommonHttpClient {
private SubmitOrderUtil submitOrderUtil;
@Resource
AuthWarehouseUserMapper authWarehouseUserMapper;
@Resource
private ThrOrderUploadBustypesMapper thrOrderUploadBustypesMapper;
/**
* xml
@ -358,8 +362,21 @@ public class ZaxyyClient extends CommonHttpClient {
fprq = DateUtil.formatDateTime(invoiceList.get(0).getInvoiceDate());
}
i.setFirstSalesInvNo(fphm);
i.setSecSalesInvNo(fphm);
i.setInvoiceDate(fprq);
boolean isNeedFp = false;
ThrOrderUploadBustypesEntity thrOrderUploadBustypesEntity = thrOrderUploadBustypesMapper.selectOne(new QueryWrapper<ThrOrderUploadBustypesEntity>().eq("action", basicBussinessTypeEntity.getAction()).last("limit 1"));
if (thrOrderUploadBustypesEntity != null && IntUtil.value(thrOrderUploadBustypesEntity.getOrderStatus()) == 3) {
isNeedFp = true;
}
if (basicBussinessTypeEntity.getMainAction().equals(ConstantType.TYPE_PUT) && StrUtil.isEmpty(fphm) && isNeedFp) {
String errMsg = "提交失败,错误信息:" + i.getProductName() + "发票缺失,请补齐后重新提交";
orderUploadLogService.updateLocalErr(orderEntity, errMsg);
return ResultVOUtils.error(500, errMsg);
}
}
//构造诏安接口参数
ZaZyRequest zaZyRequest = new ZaZyRequest();
//

@ -105,6 +105,18 @@ public class UdiWmsController {
return ClientProcessor.getHttpClient().getInvProducts(udiwmsInvProductsRequest);
}
/**
* /
*
* @param udiwmsInvProductsRequest
* @return
*/
@PostMapping("/udiwms/erp/inv/getInvResult")
public BaseResponse getInvResult(@RequestBody UdiwmsInvProductsRequest udiwmsInvProductsRequest) {
return ClientProcessor.getHttpClient().getInvProducts(udiwmsInvProductsRequest);
}
/**
*
*

@ -2,6 +2,7 @@ package com.glxp.mipsdl.req.base;
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
@ -70,4 +71,107 @@ public class UdiwmsInvProductsRequest extends ListPageRequest {
*/
private String registerNo;
/**
*
*/
private String cpmctymc;
/**
* DI
*/
private String nameCode;
/**
* UDI
*/
private String udiCode;
/**
* ID
*/
private String relIdFk;
/**
*
*/
private String ggxh;
/**
*
*/
private String productionDate;
/**
*
*/
private String expireDate;
/**
*
*/
private String ylqxzcrbarmc;
/**
*
*/
private String zczbhhzbapzbh;
/**
* ID
*/
private String customerId;
/**
* ID
*/
private String supId;
/**
*
*/
private String deptCode;
/**
*
*/
private String invCode;
/**
*
*/
private List<String> invCodes;
/**
*
*/
private String cplb;
/**
*
*/
private String invSpaceCode;
/**
* 0
*/
private Integer filterCount;
private String code;
private String serialNo;
private String diCode;
private String basicPrductRemak1;
private String category;
private Integer filterNoInv;
private Date startDate;
private Date endDate;
private String thirdSys;
}

@ -0,0 +1,14 @@
package com.glxp.mipsdl.req.ptxhyy;
import lombok.Data;
@Data
public class PtxhyyInvRequest {
/**
* yyyy-mm-dd
*/
private String kssj;
private String jssj;
}

@ -0,0 +1,17 @@
package com.glxp.mipsdl.res.ptxhyy;
import lombok.Data;
@Data
public class PtxhInvResponse {
private String fyxh;
private String fymc;
private String fydj;
private String dw;
private String zxks;
private String zsl;
private String lb;
}

@ -0,0 +1,13 @@
package com.glxp.mipsdl.res.udiwms;
import lombok.Data;
import java.util.Date;
@Data
public class InvProductRequest {
private Date startDate;
private Date endDate;
}

@ -0,0 +1,34 @@
package com.glxp.mipsdl.res.udiwms;
import lombok.Data;
@Data
public class ThrInvResultResponse {
private Integer id;
private String cpmctymc;
private String thrCode;
private String nameCode;
private String ggxh;
private String batchNo;
private String measname;
private String price;
private String productionDate;
private String expireDate;
private String ylqxzcrbarmc;
private String zczbhhzbapzbh;
private String inCount;
private String outCount;
private String relCount;
private String supName;
private String deptName;
private String deptCode;
private String invName;
private String invCode;
private String remark;
/**
*
*/
private String type;
}
Loading…
Cancel
Save