1.长泰区医院新增供应商字典上传,生产企业上传,生产企业下载;

2.诏安单据审核问题
dev
anthonywj 1 year ago
parent 939f8f2c04
commit 1f34327049

@ -23,6 +23,15 @@ public interface BaseHttpClient {
*/
BaseResponse getUnit(UdiwmsUnitRequest udiwmsUnitRequest);
/**
*
*
* @param udiwmsManuRequest
* @return
*/
BaseResponse getManu(UdiwmsManuRequest udiwmsManuRequest);
/**
*
*
@ -115,6 +124,14 @@ public interface BaseHttpClient {
*/
BaseResponse submitUnit(UdiwmsAddUnitRequest udiwmsAddUnitRequest);
/**
*
*
* @return
*/
BaseResponse submitManu(UdiwmsAddManuRequest udiwmsAddManuRequest);
/**
*
*

@ -92,6 +92,11 @@ public abstract class CommonHttpClient implements BaseHttpClient {
return baseResponse;
}
@Override
public BaseResponse getManu(UdiwmsManuRequest udiwmsManuRequest) {
return null;
}
@Override
public BaseResponse getProducts(UdiwmsProductRequest udiwmsProductRequest) {
String response = httpClient.postJson(thrSystemDetailService.getUrl(Constants.URL_NAME_PI_QUERY_URL), udiwmsProductRequest);
@ -181,6 +186,13 @@ public abstract class CommonHttpClient implements BaseHttpClient {
return null;
}
@Override
public BaseResponse submitManu(UdiwmsAddManuRequest udiwmsAddManuRequest) {
return null;
}
@Override
public BaseResponse submitPreInOrders(UdiwmsPreInOrderRequest udiwmsPreInOrderRequest) {
return null;

@ -57,10 +57,7 @@ import com.glxp.mipsdl.service.order.OrderUploadLogService;
import com.glxp.mipsdl.service.system.SysParamConfigService;
import com.glxp.mipsdl.service.thrsys.ThrCorpService;
import com.glxp.mipsdl.service.thrsys.ThrSystemDetailService;
import com.glxp.mipsdl.util.DateUtil;
import com.glxp.mipsdl.util.IntUtil;
import com.glxp.mipsdl.util.ResultVOUtils;
import com.glxp.mipsdl.util.SubmitOrderUtil;
import com.glxp.mipsdl.util.*;
import lombok.extern.slf4j.Slf4j;
import org.dom4j.Document;
import org.dom4j.DocumentException;
@ -158,6 +155,7 @@ public class CtqyyClient extends CommonHttpClient {
@Override
public BaseResponse getUnit(UdiwmsUnitRequest udiwmsUnitRequest) {
CtqyyRequest ctqyyRequest = new CtqyyRequest();
udiwmsUnitRequest.setUnitType("1");
ctqyyRequest.setMsgHeader(getMsgHeader("getMaterialUnit"));
ctqyyRequest.setMsgBody(JSONUtil.toJsonStr(udiwmsUnitRequest));
String response = httpClient.postJson(thrSystemDetailService.getUrlExclude(Constants.URL_NAME_CORP_URL), ctqyyRequest);
@ -166,12 +164,32 @@ public class CtqyyClient extends CommonHttpClient {
BaseResponse baseResponse = JSONObject.parseObject(response, BaseResponse.class);
return baseResponse;
} catch (Exception e) {
log.error("解析漳州中医院智业接口返回往来单位字典数据异常,返回结果:{}", response);
log.error("解析长泰区医院智业接口返回往来单位字典数据异常,返回结果:{}", response);
log.error("异常信息:{}", e);
return ResultVOUtils.error(500, "网络错误,或远程服务器异常无法返回正确结果(" + response + ")");
}
}
@Override
public BaseResponse getManu(UdiwmsManuRequest udiwmsManuRequest) {
CtqyyRequest ctqyyRequest = new CtqyyRequest();
ctqyyRequest.setMsgHeader(getMsgHeader("getMaterialUnit"));
udiwmsManuRequest.setUnitType("2");
ctqyyRequest.setMsgBody(JSONUtil.toJsonStr(udiwmsManuRequest));
String response = httpClient.postJson(thrSystemDetailService.getUrlExclude(Constants.URL_NAME_CORP_URL), ctqyyRequest);
response = parserResult(response);
try {
BaseResponse baseResponse = JSONObject.parseObject(response, BaseResponse.class);
return baseResponse;
} catch (Exception e) {
log.error("解析长泰区医院智业接口返回生产企业字典数据异常,返回结果:{}", response);
log.error("异常信息:{}", e);
return ResultVOUtils.error(500, "网络错误,或远程服务器异常无法返回正确结果(" + response + ")");
}
}
@Override
public BaseResponse getProducts(UdiwmsProductRequest udiwmsProductRequest) {
CtqyyRequest ctqyyRequest = new CtqyyRequest();
@ -200,7 +218,7 @@ public class CtqyyClient extends CommonHttpClient {
baseResponse.setData(map);
return baseResponse;
} catch (Exception e) {
log.error("解析漳州中医院智业接口返回产品信息字典数据异常,返回结果:{}", response);
log.error("解析长泰区医院智业接口返回产品信息字典数据异常,返回结果:{}", response);
log.error("异常信息:{}", e);
return ResultVOUtils.error(500, "网络错误,或远程服务器异常无法返回正确结果(" + response + ")");
}
@ -217,7 +235,7 @@ public class CtqyyClient extends CommonHttpClient {
BaseResponse baseResponse = JSONObject.parseObject(response, BaseResponse.class);
return baseResponse;
} catch (Exception e) {
log.error("解析漳州中医院智业接口返回单据类型数据异常,返回结果:{}", response);
log.error("解析长泰区医院智业接口返回单据类型数据异常,返回结果:{}", response);
log.error("异常信息:{}", e);
return ResultVOUtils.error(500, "网络错误,或远程服务器异常无法返回正确结果(" + response + ")");
}
@ -726,7 +744,37 @@ public class CtqyyClient extends CommonHttpClient {
@Override
public BaseResponse submitUnit(UdiwmsAddUnitRequest udiwmsAddUnitRequest) {
return null;
CtqyyRequest ctqyyRequest = new CtqyyRequest();
ctqyyRequest.setMsgHeader(getMsgHeader("addSupplierDict"));
ctqyyRequest.setMsgBody(JSONUtil.toJsonStr(udiwmsAddUnitRequest));
String response = httpClient.postJson(thrSystemDetailService.getUrlExclude(Constants.URL_NAME_PRODUCT_SUBMIT_URL), ctqyyRequest);
response = parserResult(response);
try {
log.error("提交往来单位/生产厂家:" + ctqyyRequest.getMsgBody());
CtBaseResponse baseResponse = JSONObject.parseObject(response, CtBaseResponse.class);
if (baseResponse.getCode() != 20000) {
String errMsg = "提交往来单位/生产厂家,异常:{}" + response;
log.error(errMsg);
return ResultVOUtils.error(500, "提交往来单位/生产厂家失败!");
} else {
BasicCorpEntity basicCorpEntity = new BasicCorpEntity();
basicCorpEntity.setErpId(CustomUtil.getUnitId());
basicCorpEntity.setName(udiwmsAddUnitRequest.getSupplierName());
basicCorpEntity.setCorpType(2);
basicCorpEntity.setThirdId(baseResponse.getSupplierCode());
basicCorpDao.insert(basicCorpEntity);
log.error("提交往来单位/生产厂家,成功:{}", response);
return ResultVOUtils.success(baseResponse.getMaterialNo());
}
} catch (Exception e) {
String errMsg = "提交往来单位/生产厂家,异常:{}" + response;
log.error(errMsg);
log.error("异常信息:{}", e);
return ResultVOUtils.error(500, errMsg);
}
}
@Override
@ -892,7 +940,7 @@ public class CtqyyClient extends CommonHttpClient {
BaseResponse baseResponse = JSONObject.parseObject(response, BaseResponse.class);
return baseResponse;
} catch (Exception e) {
log.error("解析漳州中医院智业接口提交单据返回数据异常,返回结果:{}", response);
log.error("解析长泰区医院智业接口提交单据返回数据异常,返回结果:{}", response);
log.error("异常信息:{}", e);
return ResultVOUtils.error(500, "网络错误,或远程服务器异常无法返回正确结果(" + response + ")");
}

@ -405,10 +405,7 @@ public class ZaxyyClient extends CommonHttpClient {
public String getUserName(IoOrderEntity orderEntity) {
AuthUserEntity authUserEntity = null;
//创建人非供应商
if (StrUtil.isNotEmpty(orderEntity.getCheckUser())) {
authUserEntity = authUserDao.selectById(orderEntity.getCheckUser());
} else if (StrUtil.isNotEmpty(orderEntity.getReviewUser())) {
if (StrUtil.isNotEmpty(orderEntity.getReviewUser())) {
authUserEntity = authUserDao.selectById(orderEntity.getReviewUser());
} else if (StrUtil.isNotEmpty(orderEntity.getCreateUser()) && orderEntity.getCreateUser().length() != 14) {
authUserEntity = authUserDao.selectById(orderEntity.getCreateUser());

@ -39,6 +39,18 @@ public class UdiWmsController {
return ClientProcessor.getHttpClient().getUnit(udiwmsUnitRequest);
}
/**
*
*
* @param udiwmsManuRequest
* @return
*/
@PostMapping("/udiwms/erp/getManus")
public BaseResponse getManus(@RequestBody UdiwmsManuRequest udiwmsManuRequest) {
return ClientProcessor.getHttpClient().getManu(udiwmsManuRequest);
}
/**
*
*
@ -140,6 +152,18 @@ public class UdiWmsController {
}
/**
*
*
* @param udiwmsAddManuRequest
* @return
*/
@PostMapping("/udiwms/erp/post/manu")
public BaseResponse postManu(@RequestBody UdiwmsAddManuRequest udiwmsAddManuRequest) {
return ClientProcessor.getHttpClient().submitManu(udiwmsAddManuRequest);
}
/**
*
*

@ -103,7 +103,7 @@ public class BasicCorpEntity {
private String thirdName4;
/**
* 1.23,4.
* 1.23,4.;5.
*/
@TableField(value = "corpType")
private Integer corpType;
@ -143,4 +143,4 @@ public class BasicCorpEntity {
*/
@TableField(value = "remark")
private String remark;
}
}

@ -0,0 +1,38 @@
package com.glxp.mipsdl.req.base;
import lombok.Data;
@Data
public class UdiwmsAddManuRequest {
/**
* ID
*/
private String unitId;
/**
*
*/
private String name;
/**
*
*/
private String addr;
/**
*
*/
private String creditNo;
/**
*
*/
private String contact;
/**
*
*/
private String mobile;
}

@ -38,4 +38,7 @@ public class UdiwmsAddUnitRequest {
*/
private String mobile;
private String dictType;
private String supplierName;
}

@ -0,0 +1,39 @@
package com.glxp.mipsdl.req.base;
import lombok.Data;
import java.util.List;
/**
*
*/
@Data
public class UdiwmsManuRequest extends ListPageRequest {
/**
*
*/
private String key;
/**
*
*/
private String unitId;
/**
*
*/
private String name;
/**
*
*/
private String lastUpdateTime;
/**
* 1 2
*/
private String unitType;
}

@ -28,4 +28,10 @@ public class UdiwmsUnitRequest extends ListPageRequest {
*/
private String lastUpdateTime;
/**
* 1 2
*/
private String unitType;
}

@ -17,4 +17,8 @@ public class CtBaseResponse {
private String returnMessage;
@JsonProperty("materialNo")
private String materialNo;
@JsonProperty("supplierCode")
private String supplierCode;
}

@ -0,0 +1,76 @@
package com.glxp.mipsdl.util;
import java.util.*;
public class CustomUtil {
public static String getUUId() {
UUID uuid = UUID.randomUUID();
return uuid.toString().replace("-", "");
}
//随机生成ID
public static String getId() {
String id = System.currentTimeMillis() + "";
int number = new Random().nextInt(90) + 10;
id = id + number;
return id.substring(1);
}
public static <T> List<List<T>> splitList(List<T> list, int len) {
if (list == null || list.isEmpty() || len < 1) {
return Collections.emptyList();
}
List<List<T>> result = new ArrayList<>();
int size = list.size();
int count = (size + len - 1) / len;
for (int i = 0; i < count; i++) {
List<T> subList = list.subList(i * len, ((i + 1) * len > size ? size : len * (i + 1)));
result.add(subList);
}
return result;
}
//随机生成往来单位ID
public static String getUnitId() {
String id = System.currentTimeMillis() + "";
int number = new Random().nextInt(90) + 10;
id = id + number;
return "HZ" + id.substring(4);
}
public static boolean isEmpty(List data) {
if (data == null || data.isEmpty()) {
return true;
}
return false;
}
public static boolean isNotEmpty(List data) {
if (data != null && !data.isEmpty()) {
return true;
}
return false;
}
//生成当前时间字符串
public static String getDate(){
Calendar ca = Calendar.getInstance();
String year = String.valueOf(ca.get(Calendar.YEAR));//获取年份
String month=String.valueOf(ca.get(Calendar.MONTH));//获取月份
String day=String.valueOf(ca.get(Calendar.DATE));//获取日
String minute=String.valueOf(ca.get(Calendar.MINUTE));//分
String hour=String.valueOf(ca.get(Calendar.HOUR));//小时
String second=String.valueOf(ca.get(Calendar.SECOND));//秒
return year+month+day+hour+minute+second;
}
}
Loading…
Cancel
Save