diff --git a/api-admin/src/main/java/com/glxp/api/admin/controller/auth/ConnectTestController.java b/api-admin/src/main/java/com/glxp/api/admin/controller/auth/ConnectTestController.java new file mode 100644 index 00000000..94f3dc5d --- /dev/null +++ b/api-admin/src/main/java/com/glxp/api/admin/controller/auth/ConnectTestController.java @@ -0,0 +1,18 @@ +package com.glxp.api.admin.controller.auth; + +import com.glxp.api.admin.req.auth.ConnectRequest; +import com.glxp.api.common.res.BaseResponse; +import com.glxp.api.common.util.ResultVOUtils; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class ConnectTestController { + + @GetMapping("/udiwms/auth/device/connect") + public BaseResponse index(ConnectRequest connequest) { + return ResultVOUtils.success("连接UDI管理系统成功!"); + } + + +} diff --git a/api-admin/src/main/java/com/glxp/api/admin/controller/auth/LoginController.java b/api-admin/src/main/java/com/glxp/api/admin/controller/auth/LoginController.java index b5f83045..f425978e 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/controller/auth/LoginController.java +++ b/api-admin/src/main/java/com/glxp/api/admin/controller/auth/LoginController.java @@ -1,10 +1,13 @@ package com.glxp.api.admin.controller.auth; +import cn.hutool.core.util.StrUtil; import com.glxp.api.admin.entity.auth.AuthCheckEntity; +import com.glxp.api.admin.entity.info.DeviceKeyEntity; import com.glxp.api.admin.req.auth.LoginRequest; import com.glxp.api.admin.req.auth.PCLoginRequest; import com.glxp.api.admin.req.auth.UpdatePasswordRequest; import com.glxp.api.admin.service.auth.AuthCheckService; +import com.glxp.api.admin.service.auth.DeviceKeyService; import com.glxp.api.admin.util.*; import com.glxp.api.common.enums.ResultEnum; import com.glxp.api.common.res.BaseResponse; @@ -44,6 +47,8 @@ public class LoginController { @Resource private AuthCheckService authCheckService; + @Resource + DeviceKeyService deviceKeyService; /** * 用户登录 @@ -70,6 +75,18 @@ public class LoginController { throw new JsonException(ResultEnum.DATA_NOT, "该用户已被禁用!"); } + if (StrUtil.isNotEmpty(loginRequest.getImei())) { + DeviceKeyEntity deviceKeyEntity = deviceKeyService.findDeviceByImei(loginRequest.getImei()); + if (deviceKeyEntity == null) { + return ResultVOUtils.error(410, "该设备未注册"); + } else if (deviceKeyEntity.getIsCheck() == 0) { + return ResultVOUtils.error(411, "该设备登记审核中,请等待,或联系管理员"); + } else if (deviceKeyEntity.getIsCheck() == 2) { + return ResultVOUtils.error(412, "该设备被拒绝登录,请联系管理员!"); + } + + } + // 更新登录状态 AuthAdmin authAdminUp = new AuthAdmin(); authAdminUp.setId(authAdmin.getId()); diff --git a/api-admin/src/main/java/com/glxp/api/admin/controller/basic/BasicThirdSysController.java b/api-admin/src/main/java/com/glxp/api/admin/controller/basic/BasicThirdSysController.java index 0eb8c7aa..6f903d29 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/controller/basic/BasicThirdSysController.java +++ b/api-admin/src/main/java/com/glxp/api/admin/controller/basic/BasicThirdSysController.java @@ -10,6 +10,7 @@ import com.glxp.api.admin.req.basic.FilterBasicThirdSysDetailRequest; import com.glxp.api.admin.req.basic.FilterBasicThirdSysRequest; import com.glxp.api.admin.res.PageSimpleResponse; import com.glxp.api.admin.res.basic.BasicThirdSysResponse; +import com.glxp.api.admin.res.basic.BussinessOriginTypeResponse; import com.glxp.api.admin.service.basic.*; import com.glxp.api.common.enums.ResultEnum; import com.glxp.api.common.res.BaseResponse; @@ -239,6 +240,13 @@ public class BasicThirdSysController { if (null == basicThirdSysBusApiEntity || null == basicThirdSysBusApiEntity.getType()) { return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL); } + + BussinessOriginTypeResponse bussinessOriginTypeResponse = bussinessOriginTypeService.finByLocalAction(basicThirdSysBusApiEntity.getCode()); + if (bussinessOriginTypeResponse != null) { + basicThirdSysBusApiEntity.setThirdBuyCode(bussinessOriginTypeResponse.getThirdAction()); + basicThirdSysBusApiEntity.setThirdBuyName(bussinessOriginTypeResponse.getThirdName()); + } + boolean result = basicThirdSysBusApiService.saveBusTypes(basicThirdSysBusApiEntity); if (result) { return ResultVOUtils.success(); diff --git a/api-admin/src/main/java/com/glxp/api/admin/controller/basic/BussinessOriginTypeController.java b/api-admin/src/main/java/com/glxp/api/admin/controller/basic/BussinessOriginTypeController.java index 05027219..2a60d582 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/controller/basic/BussinessOriginTypeController.java +++ b/api-admin/src/main/java/com/glxp/api/admin/controller/basic/BussinessOriginTypeController.java @@ -135,25 +135,36 @@ public class BussinessOriginTypeController { } FilterBasicThirdSysDetailRequest filterBasicThirdSysDetailRequest = new FilterBasicThirdSysDetailRequest(); filterBasicThirdSysDetailRequest.setThirdSysFk(bussinessOriginTypeFilterRequest.getThirdSys()); - - BaseResponse> baseResponse = erpBasicClient.getBusTypes(filterBasicThirdSysDetailRequest); - if (baseResponse != null && baseResponse.getCode() == 20000) { - List basicThirdSysBusApiEntities = baseResponse.getData().getList(); - if (CollUtil.isNotEmpty(basicThirdSysBusApiEntities)) { - for (BasicThirdSysBusApiEntity basicThirdSysBusApiEntity : basicThirdSysBusApiEntities) { - BussinessOriginTypeEntity bussinessOriginTypeEntity = new BussinessOriginTypeEntity(); - bussinessOriginTypeEntity.setName(basicThirdSysBusApiEntity.getName()); - bussinessOriginTypeEntity.setAction(basicThirdSysBusApiEntity.getCode()); - bussinessOriginTypeEntity.setThirdSys(bussinessOriginTypeFilterRequest.getThirdSys()); - bussinessOriginTypeEntity.setInoutType(basicThirdSysBusApiEntity.getInoutType()); - bussinessOriginTypeEntity.setEnable(true); - bussinessOriginTypeEntity.setUpdateTime(new Date()); - bussinessOriginTypeService.insertBusOriginType(bussinessOriginTypeEntity); + int page = 1; + int limit = 100; + while (true) { + filterBasicThirdSysDetailRequest.setPage(page); + filterBasicThirdSysDetailRequest.setLimit(limit); + BaseResponse> baseResponse = erpBasicClient.getBusTypes(filterBasicThirdSysDetailRequest); + if (baseResponse != null && baseResponse.getCode() == 20000) { + List basicThirdSysBusApiEntities = baseResponse.getData().getList(); + if (CollUtil.isNotEmpty(basicThirdSysBusApiEntities)) { + for (BasicThirdSysBusApiEntity basicThirdSysBusApiEntity : basicThirdSysBusApiEntities) { + BussinessOriginTypeEntity bussinessOriginTypeEntity = new BussinessOriginTypeEntity(); + bussinessOriginTypeEntity.setName(basicThirdSysBusApiEntity.getName()); + bussinessOriginTypeEntity.setAction(basicThirdSysBusApiEntity.getCode()); + bussinessOriginTypeEntity.setThirdSys(bussinessOriginTypeFilterRequest.getThirdSys()); + bussinessOriginTypeEntity.setInoutType(basicThirdSysBusApiEntity.getInoutType()); + bussinessOriginTypeEntity.setRemark(basicThirdSysBusApiEntity.getRemark()); + bussinessOriginTypeEntity.setEnable(true); + bussinessOriginTypeEntity.setUpdateTime(new Date()); + bussinessOriginTypeService.insertBusOriginType(bussinessOriginTypeEntity); + } + if (basicThirdSysBusApiEntities.size() >= 100) { + page++; + } + } else { + break; } + } else { + return baseResponse; } } - - return ResultVOUtils.success("下载成功"); } } diff --git a/api-admin/src/main/java/com/glxp/api/admin/controller/info/DeviceKeyController.java b/api-admin/src/main/java/com/glxp/api/admin/controller/info/DeviceKeyController.java new file mode 100644 index 00000000..6426ecdd --- /dev/null +++ b/api-admin/src/main/java/com/glxp/api/admin/controller/info/DeviceKeyController.java @@ -0,0 +1,128 @@ +package com.glxp.api.admin.controller.info; + +import com.github.pagehelper.PageInfo; +import com.glxp.api.admin.entity.info.DeviceKeyEntity; +import com.glxp.api.admin.req.info.FilterDeviceKeyRequest; +import com.glxp.api.admin.req.inout.DeleteRequest; +import com.glxp.api.admin.res.PageSimpleResponse; +import com.glxp.api.admin.service.auth.DeviceKeyService; +import com.glxp.api.admin.util.DateUtil; +import com.glxp.api.common.enums.ResultEnum; +import com.glxp.api.common.res.BaseResponse; +import com.glxp.api.common.util.ResultVOUtils; +import lombok.extern.slf4j.Slf4j; +import org.springframework.validation.BindingResult; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; +import javax.validation.Valid; +import java.security.MessageDigest; +import java.util.List; + +@Slf4j +@RestController +public class DeviceKeyController { + // @Value("${spring.mail.username}") +// private String mail; +// @Value("${toMail}") +// private String toMail; + @Resource + DeviceKeyService deviceKeyService; +// @Resource +// private JavaMailSender javaMailSender; + + @GetMapping("sale/device/registerList") + public BaseResponse registerList(FilterDeviceKeyRequest filterDeviceKeyRequest) { + List deviceKeyEntities = deviceKeyService.findDeviceKey(filterDeviceKeyRequest); + PageInfo pageInfo; + pageInfo = new PageInfo<>(deviceKeyEntities); + PageSimpleResponse pageSimpleResponse = new PageSimpleResponse<>(); + pageSimpleResponse.setTotal(pageInfo.getTotal()); + pageSimpleResponse.setList(deviceKeyEntities); + return ResultVOUtils.success(pageSimpleResponse); + } + + + @PostMapping("sale/device/check") + public BaseResponse checkRegister(@RequestBody @Valid DeviceKeyEntity deviceKeyEntity, + BindingResult bindingResult) { + + if (bindingResult.hasErrors()) { + return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); + } + deviceKeyEntity.setDate(DateUtil.getDate()); + deviceKeyService.updateDeviceKey(deviceKeyEntity); + return ResultVOUtils.success("审核成功"); + + } + + @PostMapping("/sale/info/registerKey") + public BaseResponse registerKey(@RequestBody DeviceKeyEntity deviceKeyEntity) { + String key = md5("glxp2020" + deviceKeyEntity.getImei()); + FilterDeviceKeyRequest filterDeviceKeyRequest = new FilterDeviceKeyRequest(); + filterDeviceKeyRequest.setImei(deviceKeyEntity.getImei()); + DeviceKeyEntity deviceKeyEntity1 = deviceKeyService.findDeviceByImei(filterDeviceKeyRequest); + if (deviceKeyEntity1 == null) { + return ResultVOUtils.success("1"); + } else if (deviceKeyEntity1.getIsCheck() == 0) { + return ResultVOUtils.success("0"); + } else { + return ResultVOUtils.success(key); + } + } + + + @PostMapping("/sale/info/deleterKey") + public BaseResponse deleterKey(@RequestBody DeleteRequest deleteRequest) { + + deviceKeyService.deleteDeviceKey(deleteRequest); + return ResultVOUtils.success("删除成功"); + + } + + + @PostMapping("sale/device/register") + public BaseResponse saveRegister(@RequestBody DeviceKeyEntity deviceKeyEntity, + BindingResult bindingResult) { + + if (bindingResult.hasErrors()) { + return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); + } + deviceKeyEntity.setDate(DateUtil.getDateTime()); + deviceKeyEntity.setIsCheck(0); + deviceKeyService.insertDeviceKey(deviceKeyEntity); + return ResultVOUtils.success("1"); + } + +// public void sendMail(String title, String content, String to) { +// SimpleMailMessage message = new SimpleMailMessage(); +// message.setFrom(mail); +// message.setTo(to); +// message.setSubject(title); +// message.setText(content); +// javaMailSender.send(message); +// } + + public String md5(String password) { + try { + MessageDigest digest = MessageDigest.getInstance("MD5"); + byte[] bytes = digest.digest(password.getBytes()); + StringBuilder sb = new StringBuilder(); + for (byte b : bytes) { + int c = b & 0xff; //负数转换成正数 + String result = Integer.toHexString(c); //把十进制的数转换成十六进制的书 + if (result.length() < 2) { + sb.append(0); //让十六进制全部都是两位数 + } + sb.append(result); + } + return sb.toString(); //返回加密后的密文 + } catch (Exception ex) { + ex.printStackTrace(); + return ""; + } + } +} diff --git a/api-admin/src/main/java/com/glxp/api/admin/controller/inventory/InvWarehouseController.java b/api-admin/src/main/java/com/glxp/api/admin/controller/inventory/InvWarehouseController.java index 772f6d6f..e889ab12 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/controller/inventory/InvWarehouseController.java +++ b/api-admin/src/main/java/com/glxp/api/admin/controller/inventory/InvWarehouseController.java @@ -409,7 +409,7 @@ public class InvWarehouseController { */ @AuthRuleAnnotation("") @PostMapping("/spms/inv/warehouse/bindThrWarehouse") - public BaseResponse bindThrWarehouse(Integer id, Integer thridWarehouseId, String sysId) { + public BaseResponse bindThrWarehouse(Integer id, String thridWarehouseId, String sysId) { if (null == id || null == thridWarehouseId || StrUtil.isBlank(sysId)) { return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL); } diff --git a/api-admin/src/main/java/com/glxp/api/admin/controller/thrsys/ThrInvWarehouseController.java b/api-admin/src/main/java/com/glxp/api/admin/controller/thrsys/ThrInvWarehouseController.java index 3ce81528..50feb7b3 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/controller/thrsys/ThrInvWarehouseController.java +++ b/api-admin/src/main/java/com/glxp/api/admin/controller/thrsys/ThrInvWarehouseController.java @@ -1,11 +1,14 @@ package com.glxp.api.admin.controller.thrsys; import cn.hutool.core.util.StrUtil; +import com.github.pagehelper.PageInfo; import com.glxp.api.admin.dao.basic.BasicThirdSysDao; import com.glxp.api.admin.entity.basic.BasicThirdSysEntity; +import com.glxp.api.admin.entity.thrsys.ThrCorpEntity; import com.glxp.api.admin.entity.thrsys.ThrInvWarehouseEntity; import com.glxp.api.admin.req.inout.DeleteRequest; import com.glxp.api.admin.req.thrsys.FilterThrInvWarehouseRequest; +import com.glxp.api.admin.res.PageSimpleResponse; import com.glxp.api.admin.res.thrsys.ThrInvWarehouseResponse; import com.glxp.api.admin.service.thrsys.ThrInvWarehouseService; import com.glxp.api.common.enums.ResultEnum; @@ -41,11 +44,21 @@ public class ThrInvWarehouseController { @GetMapping("spms/thrsys/warehouse/filter") public BaseResponse filterInvWarehouse(FilterThrInvWarehouseRequest filterThrInvWarehouseRequest) { List thrInvWarehouseEntities = thrInvWarehouseService.filterThrInvWarehouse(filterThrInvWarehouseRequest); - List merge = merge(thrInvWarehouseEntities, 0); - Map restMap = new HashMap<>(); - restMap.put("list", merge); - return ResultVOUtils.success(restMap); + + PageInfo pageInfo; + pageInfo = new PageInfo<>(thrInvWarehouseEntities); + PageSimpleResponse pageSimpleResponse = new PageSimpleResponse<>(); + pageSimpleResponse.setTotal(pageInfo.getTotal()); + pageSimpleResponse.setList(thrInvWarehouseEntities); + return ResultVOUtils.success(pageSimpleResponse); + + +// List merge = merge(thrInvWarehouseEntities, 0); +// +// Map restMap = new HashMap<>(); +// restMap.put("list", merge); +// return ResultVOUtils.success(restMap); } public List merge(List thrInvWarehouseEntities, Integer pid) { @@ -83,27 +96,11 @@ public class ThrInvWarehouseController { thrInvWarehouseEntity.setPid(0); // 默认设置 FilterThrInvWarehouseRequest filterThrInvWarehouseRequest = new FilterThrInvWarehouseRequest(); filterThrInvWarehouseRequest.setPid(thrInvWarehouseEntity.getPid()); -// ThrInvWarehouseEntity codeEntity = thrInvWarehouseService.selectMaxCode(filterThrInvWarehouseRequest); -// if(codeEntity == null) -// if (codeEntity == null) { -// int code = Integer.parseInt("1") * 1000; -// thrInvWarehouseEntity.setCode(code + ""); -// } else { -// thrInvWarehouseEntity.setCode(Integer.parseInt(codeEntity.getCode()) + 1 + ""); -// } -// thrInvWarehouseEntity.setCode(Integer.parseInt(codeEntity.getCode()) + 1 + ""); } else {//货位 FilterThrInvWarehouseRequest filterThrInvWarehouseRequest = new FilterThrInvWarehouseRequest(); filterThrInvWarehouseRequest.setPid(thrInvWarehouseEntity.getPid()); -// ThrInvWarehouseEntity codeEntity = thrInvWarehouseService.selectMaxCode(filterThrInvWarehouseRequest); ThrInvWarehouseEntity pEntity = thrInvWarehouseService.selectById(thrInvWarehouseEntity.getPid() + ""); -// if (codeEntity == null) { -// int code = Integer.parseInt(pEntity.getCode()) * 1000; -// thrInvWarehouseEntity.setCode(code + ""); -// } else { -// thrInvWarehouseEntity.setCode(Integer.parseInt(codeEntity.getCode()) + 1 + ""); -// } thrInvWarehouseEntity.setAdvanceType(pEntity.getAdvanceType()); thrInvWarehouseEntity.setLevel(pEntity.getLevel()); thrInvWarehouseEntity.setPcode(pEntity.getPcode()); @@ -149,6 +146,7 @@ public class ThrInvWarehouseController { /** * 下载第三方系统的仓库 + * * @param thirdSysFk * @return */ diff --git a/api-admin/src/main/java/com/glxp/api/admin/dao/auth/DeviceKeyDao.java b/api-admin/src/main/java/com/glxp/api/admin/dao/auth/DeviceKeyDao.java new file mode 100644 index 00000000..b33ceed0 --- /dev/null +++ b/api-admin/src/main/java/com/glxp/api/admin/dao/auth/DeviceKeyDao.java @@ -0,0 +1,24 @@ +package com.glxp.api.admin.dao.auth; + +import com.glxp.api.admin.entity.info.DeviceKeyEntity; +import com.glxp.api.admin.req.info.FilterDeviceKeyRequest; +import com.glxp.api.admin.req.inout.DeleteRequest; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +@Mapper +public interface DeviceKeyDao { + DeviceKeyEntity findDeviceByImei(FilterDeviceKeyRequest filterDeviceKeyRequest); + + List findDeviceKey(FilterDeviceKeyRequest filterDeviceKeyRequest); + + void insertDeviceKey(DeviceKeyEntity deviceKeyEntity); + + void updateDeviceKey(DeviceKeyEntity deviceKeyEntity); + + void updateDeviceKeyByImei(DeviceKeyEntity deviceKeyEntity); + + void deleteDeviceKey(DeleteRequest deleteRequest); + +} diff --git a/api-admin/src/main/java/com/glxp/api/admin/dao/inventory/InvWarehouseDao.java b/api-admin/src/main/java/com/glxp/api/admin/dao/inventory/InvWarehouseDao.java index b23f2026..fb108b6c 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/dao/inventory/InvWarehouseDao.java +++ b/api-admin/src/main/java/com/glxp/api/admin/dao/inventory/InvWarehouseDao.java @@ -41,6 +41,6 @@ public interface InvWarehouseDao { * @param sysId * @return */ - boolean updateThridId(@Param("id") Integer id, @Param("thridWarehouseId") Integer thridWarehouseId, @Param("sysId") String sysId); + boolean updateThridId(@Param("id") Integer id, @Param("thridWarehouseId") String thridWarehouseId, @Param("sysId") String sysId); } diff --git a/api-admin/src/main/java/com/glxp/api/admin/entity/basic/BasicThirdSysBusApiEntity.java b/api-admin/src/main/java/com/glxp/api/admin/entity/basic/BasicThirdSysBusApiEntity.java index 7232395e..6a099662 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/entity/basic/BasicThirdSysBusApiEntity.java +++ b/api-admin/src/main/java/com/glxp/api/admin/entity/basic/BasicThirdSysBusApiEntity.java @@ -24,4 +24,10 @@ public class BasicThirdSysBusApiEntity { private String filed4; + /** + * "code": "29104", + * "name": "采购入库", + * "remark": "无形资产入库单", + * "inoutType": "1" + */ } diff --git a/api-admin/src/main/java/com/glxp/api/admin/entity/info/DeviceKeyEntity.java b/api-admin/src/main/java/com/glxp/api/admin/entity/info/DeviceKeyEntity.java new file mode 100644 index 00000000..84e512b5 --- /dev/null +++ b/api-admin/src/main/java/com/glxp/api/admin/entity/info/DeviceKeyEntity.java @@ -0,0 +1,19 @@ +package com.glxp.api.admin.entity.info; + +import lombok.Data; + +@Data +public class DeviceKeyEntity { + private String id; + private String imei; + private int isCheck; + private String companyName; + private String phone; + private String contact; + private String imeiKey; + private String date; + private String creditNum; + private int checkCode; + private String rgType; + private String remark; +} diff --git a/api-admin/src/main/java/com/glxp/api/admin/entity/inout/OrderEntity.java b/api-admin/src/main/java/com/glxp/api/admin/entity/inout/OrderEntity.java index 1a21aa92..d3544a52 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/entity/inout/OrderEntity.java +++ b/api-admin/src/main/java/com/glxp/api/admin/entity/inout/OrderEntity.java @@ -49,6 +49,7 @@ public class OrderEntity { private Date updateTime; private boolean preCheck; + private String thirdBillNo; } diff --git a/api-admin/src/main/java/com/glxp/api/admin/httpclient/ErpBasicClient.java b/api-admin/src/main/java/com/glxp/api/admin/httpclient/ErpBasicClient.java index 2025e7d9..f5e0a3a7 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/httpclient/ErpBasicClient.java +++ b/api-admin/src/main/java/com/glxp/api/admin/httpclient/ErpBasicClient.java @@ -80,8 +80,6 @@ public class ErpBasicClient { String url = basicThirdSysEntity.getThridUrl() + "/udiwms/erp/getOrderType"; UdiwmsBusTypeRequest udiwmsBusTypeRequest = new UdiwmsBusTypeRequest(); udiwmsBusTypeRequest.setThirdSys(filterBasicThirdSysDetailRequest.getThirdSysFk()); - udiwmsBusTypeRequest.setPage(1); - udiwmsBusTypeRequest.setLimit(100); String response = HttpClient.uCloudPost(url, udiwmsBusTypeRequest, basicThirdSysEntity); log.info(response); try { @@ -99,11 +97,7 @@ public class ErpBasicClient { public BaseResponse> getWarehouse(UdiwmsWarehouseRequest udiwmsWarehouseRequest) { BasicThirdSysEntity basicThirdSysEntity = basicThirdSysService.selectByThirdId(udiwmsWarehouseRequest.getThirdSys()); String url = basicThirdSysEntity.getThridUrl() + "/udiwms/erp/getWarehouse"; - udiwmsWarehouseRequest.setPage(1); - udiwmsWarehouseRequest.setLimit(100); - log.info("查询第三方系统的仓库货位号url:{},参数:{}", url, udiwmsWarehouseRequest.toString()); String response = HttpClient.uCloudPost(url, udiwmsWarehouseRequest); - log.info(response); try { BaseResponse> listBaseResponse = diff --git a/api-admin/src/main/java/com/glxp/api/admin/httpclient/UdiwmsOrderResponse.java b/api-admin/src/main/java/com/glxp/api/admin/httpclient/UdiwmsOrderResponse.java new file mode 100644 index 00000000..eb919053 --- /dev/null +++ b/api-admin/src/main/java/com/glxp/api/admin/httpclient/UdiwmsOrderResponse.java @@ -0,0 +1,8 @@ +package com.glxp.api.admin.httpclient; + +import lombok.Data; + +@Data +public class UdiwmsOrderResponse { + private String thirdBillNo; +} diff --git a/api-admin/src/main/java/com/glxp/api/admin/httpclient/req/UdiwmsOrderRequest.java b/api-admin/src/main/java/com/glxp/api/admin/httpclient/req/UdiwmsOrderRequest.java index 17a22b24..7562fa9f 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/httpclient/req/UdiwmsOrderRequest.java +++ b/api-admin/src/main/java/com/glxp/api/admin/httpclient/req/UdiwmsOrderRequest.java @@ -16,7 +16,8 @@ public class UdiwmsOrderRequest { private String corpId; //第三方单据往来单位ID private String corpName; //往来单位 private String thirdSys; //第三方系统ID - - private List items; //单据详情数组 + private String locStorageCode; + private String locStorageName; + private List item; //单据详情数组 } diff --git a/api-admin/src/main/java/com/glxp/api/admin/req/auth/ConnectRequest.java b/api-admin/src/main/java/com/glxp/api/admin/req/auth/ConnectRequest.java new file mode 100644 index 00000000..1bce6942 --- /dev/null +++ b/api-admin/src/main/java/com/glxp/api/admin/req/auth/ConnectRequest.java @@ -0,0 +1,7 @@ +package com.glxp.api.admin.req.auth; + +import lombok.Data; + +@Data +public class ConnectRequest { +} diff --git a/api-admin/src/main/java/com/glxp/api/admin/req/auth/LoginRequest.java b/api-admin/src/main/java/com/glxp/api/admin/req/auth/LoginRequest.java index 476f6be8..a670530b 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/req/auth/LoginRequest.java +++ b/api-admin/src/main/java/com/glxp/api/admin/req/auth/LoginRequest.java @@ -16,4 +16,9 @@ public class LoginRequest { @NotEmpty(message = "密码不能为空") private String password; + + private Integer type; + + private String imei; + } diff --git a/api-admin/src/main/java/com/glxp/api/admin/req/info/FilterDeviceKeyRequest.java b/api-admin/src/main/java/com/glxp/api/admin/req/info/FilterDeviceKeyRequest.java new file mode 100644 index 00000000..2ae473be --- /dev/null +++ b/api-admin/src/main/java/com/glxp/api/admin/req/info/FilterDeviceKeyRequest.java @@ -0,0 +1,10 @@ +package com.glxp.api.admin.req.info; + +import com.glxp.api.admin.req.ListPageRequest; +import lombok.Data; + +@Data +public class FilterDeviceKeyRequest extends ListPageRequest { + private String imei; + private String isCheck; +} diff --git a/api-admin/src/main/java/com/glxp/api/admin/req/inout/OrderFilterRequest.java b/api-admin/src/main/java/com/glxp/api/admin/req/inout/OrderFilterRequest.java index 636dcb0f..91fd707d 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/req/inout/OrderFilterRequest.java +++ b/api-admin/src/main/java/com/glxp/api/admin/req/inout/OrderFilterRequest.java @@ -36,5 +36,6 @@ public class OrderFilterRequest extends ListPageRequest { private String locStorageCode; private String lastUpdateTime; private Integer unionUser; + private String thirdBillNo; } diff --git a/api-admin/src/main/java/com/glxp/api/admin/service/auth/DeviceKeyService.java b/api-admin/src/main/java/com/glxp/api/admin/service/auth/DeviceKeyService.java new file mode 100644 index 00000000..8489e8cd --- /dev/null +++ b/api-admin/src/main/java/com/glxp/api/admin/service/auth/DeviceKeyService.java @@ -0,0 +1,25 @@ +package com.glxp.api.admin.service.auth; + + +import com.glxp.api.admin.entity.info.DeviceKeyEntity; +import com.glxp.api.admin.req.info.FilterDeviceKeyRequest; +import com.glxp.api.admin.req.inout.DeleteRequest; + +import java.util.List; + +public interface DeviceKeyService { + List findDeviceKey(FilterDeviceKeyRequest filterDeviceKeyRequest); + + DeviceKeyEntity findDeviceByImei(FilterDeviceKeyRequest filterDeviceKeyRequest); + + DeviceKeyEntity findDeviceByImei(String imei); + + void insertDeviceKey(DeviceKeyEntity deviceKeyEntity); + + void updateDeviceKeyByImei(DeviceKeyEntity deviceKeyEntity); + + void updateDeviceKey(DeviceKeyEntity deviceKeyEntity); + + void deleteDeviceKey(DeleteRequest deleteRequest); + +} diff --git a/api-admin/src/main/java/com/glxp/api/admin/service/auth/impl/DeviceKeyServiceImpl.java b/api-admin/src/main/java/com/glxp/api/admin/service/auth/impl/DeviceKeyServiceImpl.java new file mode 100644 index 00000000..d61190b6 --- /dev/null +++ b/api-admin/src/main/java/com/glxp/api/admin/service/auth/impl/DeviceKeyServiceImpl.java @@ -0,0 +1,63 @@ +package com.glxp.api.admin.service.auth.impl; + +import com.github.pagehelper.PageHelper; +import com.glxp.api.admin.dao.auth.DeviceKeyDao; +import com.glxp.api.admin.entity.info.DeviceKeyEntity; +import com.glxp.api.admin.req.info.FilterDeviceKeyRequest; +import com.glxp.api.admin.req.inout.DeleteRequest; +import com.glxp.api.admin.service.auth.DeviceKeyService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.Collections; +import java.util.List; + +@Service +public class DeviceKeyServiceImpl implements DeviceKeyService { + + @Resource + DeviceKeyDao deviceKeyDao; + + @Override + public List findDeviceKey(FilterDeviceKeyRequest filterDeviceKeyRequest) { + if (filterDeviceKeyRequest == null) { + return Collections.emptyList(); + } + int offset = (filterDeviceKeyRequest.getPage() - 1) * filterDeviceKeyRequest.getLimit(); + PageHelper.offsetPage(offset, filterDeviceKeyRequest.getLimit()); + return deviceKeyDao.findDeviceKey(filterDeviceKeyRequest); + } + + @Override + public DeviceKeyEntity findDeviceByImei(FilterDeviceKeyRequest filterDeviceKeyRequest) { + return deviceKeyDao.findDeviceByImei(filterDeviceKeyRequest); + } + + @Override + public DeviceKeyEntity findDeviceByImei(String imei) { + FilterDeviceKeyRequest filterDeviceKeyRequest = new FilterDeviceKeyRequest(); + filterDeviceKeyRequest.setImei(imei); + DeviceKeyEntity deviceKeyEntity = deviceKeyDao.findDeviceByImei(filterDeviceKeyRequest); + return deviceKeyEntity; + } + + @Override + public void insertDeviceKey(DeviceKeyEntity deviceKeyEntity) { + deviceKeyDao.insertDeviceKey(deviceKeyEntity); + } + + @Override + public void updateDeviceKeyByImei(DeviceKeyEntity deviceKeyEntity) { + deviceKeyDao.updateDeviceKeyByImei(deviceKeyEntity); + } + + @Override + public void updateDeviceKey(DeviceKeyEntity deviceKeyEntity) { + deviceKeyDao.updateDeviceKey(deviceKeyEntity); + } + + @Override + public void deleteDeviceKey(DeleteRequest deleteRequest) { + deviceKeyDao.deleteDeviceKey(deleteRequest); + } +} diff --git a/api-admin/src/main/java/com/glxp/api/admin/service/basic/impl/BussinessOriginTypeServiceImpl.java b/api-admin/src/main/java/com/glxp/api/admin/service/basic/impl/BussinessOriginTypeServiceImpl.java index 4a3cc3b9..e6b009a9 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/service/basic/impl/BussinessOriginTypeServiceImpl.java +++ b/api-admin/src/main/java/com/glxp/api/admin/service/basic/impl/BussinessOriginTypeServiceImpl.java @@ -46,6 +46,11 @@ public class BussinessOriginTypeServiceImpl implements BussinessOriginTypeServic @Override public List filterEnableList(BussinessOriginTypeFilterRequest bussinessOriginTypeFilterRequest) { + + if (bussinessOriginTypeFilterRequest.getPage() != null) { + int offset = (bussinessOriginTypeFilterRequest.getPage() - 1) * bussinessOriginTypeFilterRequest.getLimit(); + PageHelper.offsetPage(offset, bussinessOriginTypeFilterRequest.getLimit()); + } return bussinessOriginTypeDao.filterEnableList(bussinessOriginTypeFilterRequest); } @@ -103,7 +108,7 @@ public class BussinessOriginTypeServiceImpl implements BussinessOriginTypeServic @Override public BussinessOriginTypeResponse finByLocalAction(String action) { BussinessOriginTypeFilterRequest bussinessOriginTypeFilterRequest = new BussinessOriginTypeFilterRequest(); - bussinessOriginTypeFilterRequest.setThirdAction(action); + bussinessOriginTypeFilterRequest.setLocalAction(action); List bussinessOriginTypeEntities = bussinessOriginTypeDao.filterJoinList(bussinessOriginTypeFilterRequest); if (bussinessOriginTypeEntities != null && bussinessOriginTypeEntities.size() > 0) { return bussinessOriginTypeEntities.get(0); diff --git a/api-admin/src/main/java/com/glxp/api/admin/service/business/impl/StockOrderServiceImpl.java b/api-admin/src/main/java/com/glxp/api/admin/service/business/impl/StockOrderServiceImpl.java index 7aed09dd..2fb80669 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/service/business/impl/StockOrderServiceImpl.java +++ b/api-admin/src/main/java/com/glxp/api/admin/service/business/impl/StockOrderServiceImpl.java @@ -4,7 +4,11 @@ import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.StrUtil; import cn.hutool.json.JSONUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson.TypeReference; import com.github.pagehelper.PageHelper; +import com.glxp.api.admin.constant.ConstantStatus; import com.glxp.api.admin.constant.ConstantType; import com.glxp.api.admin.dao.basic.BasicThirdSysBusApiDao; import com.glxp.api.admin.dao.basic.BasicThirdSysDao; @@ -13,20 +17,30 @@ import com.glxp.api.admin.dao.basic.UnitMaintainDao; import com.glxp.api.admin.dao.business.StockOrderDao; import com.glxp.api.admin.dao.business.StockOrderDetailDao; import com.glxp.api.admin.dao.inout.OrderDao; -import com.glxp.api.admin.entity.basic.BasicThirdSysBusApiEntity; -import com.glxp.api.admin.entity.basic.BasicThirdSysEntity; -import com.glxp.api.admin.entity.basic.UnitMaintainEntity; +import com.glxp.api.admin.entity.basic.*; import com.glxp.api.admin.entity.business.StockOrderDetailEntity; import com.glxp.api.admin.entity.business.StockOrderEntity; import com.glxp.api.admin.entity.business.StockOrderPrintEntity; +import com.glxp.api.admin.entity.inout.OrderEntity; +import com.glxp.api.admin.entity.inventory.InvWarehouseEntity; +import com.glxp.api.admin.entity.thrsys.ThrInvWarehouseEntity; +import com.glxp.api.admin.httpclient.UdiwmsOrderResponse; import com.glxp.api.admin.httpclient.req.UdiwmsOrderDetail; import com.glxp.api.admin.httpclient.req.UdiwmsOrderRequest; +import com.glxp.api.admin.req.basic.BussinessLocalTypeFilterRequest; import com.glxp.api.admin.req.business.StockOrderDetailFilterRequest; import com.glxp.api.admin.req.business.StockOrderFilterRequest; import com.glxp.api.admin.req.business.StockOrderQueryRequest; +import com.glxp.api.admin.res.basic.BussinessTypResponse; import com.glxp.api.admin.res.business.StockOrderDetailEntityVo; import com.glxp.api.admin.res.business.StockOrderExportResponse; +import com.glxp.api.admin.service.basic.BussinessLocalTypeService; +import com.glxp.api.admin.service.basic.BussinessTypeService; +import com.glxp.api.admin.service.basic.UdiRelevanceService; import com.glxp.api.admin.service.business.StockOrderService; +import com.glxp.api.admin.service.inout.OrderService; +import com.glxp.api.admin.service.inventory.InvWarehouseService; +import com.glxp.api.admin.service.thrsys.ThrInvWarehouseService; import com.glxp.api.admin.util.HttpClient; import com.glxp.api.common.res.BaseResponse; import com.glxp.api.common.util.ResultVOUtils; @@ -56,6 +70,16 @@ public class StockOrderServiceImpl implements StockOrderService { private BasicThirdSysDao basicThirdSysDao; @Resource private OrderDao orderDao; + @Resource + private OrderService orderService; + @Resource + BussinessLocalTypeService bussinessLocalTypeService; + @Resource + InvWarehouseService invWarehouseService; + @Resource + ThrInvWarehouseService thrInvWarehouseService; + @Resource + UdiRelevanceService udiRelevanceService; @Override public List listStockOrders(StockOrderQueryRequest stockOrderQueryRequest) { @@ -184,15 +208,37 @@ public class StockOrderServiceImpl implements StockOrderService { UdiwmsOrderRequest udiwmsOrderRequest = new UdiwmsOrderRequest(); udiwmsOrderRequest.setBillDate(stockOrderEntity.getBilldate()); //单据日期 udiwmsOrderRequest.setBillNo(stockOrderEntity.getBillNo()); //单号 - //查询往来单位第三方系统对照编码 - UnitMaintainEntity unitMaintainEntity = unitMaintainDao.selectThirdInfoByErpId(stockOrderEntity.getCorpId()); - udiwmsOrderRequest.setCorpId(unitMaintainEntity.getThirdId()); //往来单位编码,需转换为第三方系统的ID - udiwmsOrderRequest.setCorpName(unitMaintainEntity.getThirdName()); //往来单位名称,需转换为第三方系统的名称 - udiwmsOrderRequest.setBillFlag(stockOrderEntity.getBillFlag());//单据状态 + BussinessLocalTypeEntity bussinessLocalTypeEntity = bussinessLocalTypeService.findBTByAction(stockOrderEntity.getBillType()); + //查询第三方系统的单据ID,及第三方系统标识 BasicThirdSysBusApiEntity thirdSysBusApiEntity = thirdSysBusApiDao.selectByCode(stockOrderEntity.getBillType()); udiwmsOrderRequest.setThirdSys(thirdSysBusApiEntity.getThirdSys()); //第三方系统标识 - udiwmsOrderRequest.setBillType(thirdSysBusApiEntity.getThirdBuyName()); + udiwmsOrderRequest.setBillType(thirdSysBusApiEntity.getThirdBuyCode()); + if (bussinessLocalTypeEntity.getCorpType() == ConstantStatus.CORP_TYPE_INPUT) { + udiwmsOrderRequest.setCorpId(stockOrderEntity.getCorpName()); //往来单位编码,需转换为第三方系统的ID + udiwmsOrderRequest.setCorpName(stockOrderEntity.getCorpName()); //往来单位名称,需转换为第三方系统的名称 + } else if (bussinessLocalTypeEntity.getCorpType() == ConstantStatus.CORP_TYPE_INNOR) { + InvWarehouseEntity invWarehouseEntity = invWarehouseService.selectByCode(stockOrderEntity.getCorpId()); + ThrInvWarehouseEntity thrInvWarehouseEntity = thrInvWarehouseService.selectByCode(invWarehouseEntity.getThirdId()); + udiwmsOrderRequest.setCorpId(thrInvWarehouseEntity.getCode()); //往来单位编码,需转换为第三方系统的ID + udiwmsOrderRequest.setCorpName(thrInvWarehouseEntity.getName()); //往来单位名称,需转换为第三方系统的名称 + + } else if (bussinessLocalTypeEntity.getCorpType() == ConstantStatus.CORP_TYPE_OUT) { + //查询往来单位第三方系统对照编码 + UnitMaintainEntity + unitMaintainEntity = unitMaintainDao.selectThirdInfoByErpId(stockOrderEntity.getCorpId()); + udiwmsOrderRequest.setCorpId(unitMaintainEntity.getThirdId()); //往来单位编码,需转换为第三方系统的ID + udiwmsOrderRequest.setCorpName(unitMaintainEntity.getThirdName()); //往来单位名称,需转换为第三方系统的名称 + } + + InvWarehouseEntity invWarehouseEntity = invWarehouseService.selectByCode(stockOrderEntity.getLocStorageCode()); + ThrInvWarehouseEntity thrInvWarehouseEntity = thrInvWarehouseService.selectByCode(invWarehouseEntity.getThirdId()); + udiwmsOrderRequest.setLocStorageCode(thrInvWarehouseEntity.getCode()); + udiwmsOrderRequest.setLocStorageName(thrInvWarehouseEntity.getName()); + + + udiwmsOrderRequest.setBillFlag(stockOrderEntity.getBillFlag());//单据状态 + //查询单据出入库类型 String mainAction = bussinessTypeDao.selectInoutTypebByLocalAction(stockOrderEntity.getBillType()); if (ConstantType.TYPE_PUT.equals(mainAction)) { @@ -206,22 +252,36 @@ public class StockOrderServiceImpl implements StockOrderService { //组装明细数据 List items = new ArrayList<>(stockOrderDetailEntities.size()); for (StockOrderDetailEntity stockOrderDetailEntity : stockOrderDetailEntities) { + + UdiRelevanceEntity udiRelevanceEntity = udiRelevanceService.selectById(stockOrderDetailEntity.getRelId()); UdiwmsOrderDetail item = new UdiwmsOrderDetail(); BeanUtil.copyProperties(stockOrderDetailEntity, item); + item.setProductId(udiRelevanceEntity.getThirdId()); + item.setProductName(udiRelevanceEntity.getThirdName()); items.add(item); } - udiwmsOrderRequest.setItems(items); + udiwmsOrderRequest.setItem(items); //提交单据到第三方服务 BasicThirdSysEntity basicThirdSysEntity = basicThirdSysDao.selectByThirdId(thirdSysBusApiEntity.getThirdSys()); String response = HttpClient.uCloudPost(basicThirdSysEntity.getThridUrl() + "/udiwms/erp/submitOrders", udiwmsOrderRequest); if (StrUtil.isNotBlank(response)) { try { - BaseResponse baseResponse = JSONUtil.toBean(response, BaseResponse.class); + + BaseResponse baseResponse = JSONObject.parseObject(response, new TypeReference>() { + }); if (baseResponse.getCode().equals(20000)) { + UdiwmsOrderResponse udiwmsOrderResponse = baseResponse.getData(); + //提交成功,更新导出状态 - orderDao.updateExportStatus(stockOrderEntity.getOrderIdFk(), 1); + OrderEntity orderEntity = + orderService.findById(stockOrderEntity.getOrderIdFk()); + orderEntity.setExportStatus(1); + if (udiwmsOrderResponse != null) { + orderEntity.setThirdBillNo(udiwmsOrderResponse.getThirdBillNo()); + } + orderService.updateOrder(orderEntity); return ResultVOUtils.success("提交成功"); } return ResultVOUtils.error(500, "提交失败"); diff --git a/api-admin/src/main/java/com/glxp/api/admin/service/inventory/InvWarehouseService.java b/api-admin/src/main/java/com/glxp/api/admin/service/inventory/InvWarehouseService.java index d87a15a5..a397f5eb 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/service/inventory/InvWarehouseService.java +++ b/api-admin/src/main/java/com/glxp/api/admin/service/inventory/InvWarehouseService.java @@ -44,7 +44,7 @@ public interface InvWarehouseService { * @param id * @param thridWarehouseId */ - boolean bindThrWarehouse(Integer id, Integer thridWarehouseId, String sysId); + boolean bindThrWarehouse(Integer id, String thridWarehouseId, String sysId); /** * 解绑第三方仓库 diff --git a/api-admin/src/main/java/com/glxp/api/admin/service/inventory/impl/InvWarehouseServiceImpl.java b/api-admin/src/main/java/com/glxp/api/admin/service/inventory/impl/InvWarehouseServiceImpl.java index 95ea71ef..1d71d463 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/service/inventory/impl/InvWarehouseServiceImpl.java +++ b/api-admin/src/main/java/com/glxp/api/admin/service/inventory/impl/InvWarehouseServiceImpl.java @@ -125,7 +125,7 @@ public class InvWarehouseServiceImpl implements InvWarehouseService { } @Override - public boolean bindThrWarehouse(Integer id, Integer thridWarehouseId, String sysId) { + public boolean bindThrWarehouse(Integer id, String thridWarehouseId, String sysId) { return invWarehouseDao.updateThridId(id, thridWarehouseId, sysId); } diff --git a/api-admin/src/main/java/com/glxp/api/admin/service/thrsys/impl/ThrInvWarehouseServiceImpl.java b/api-admin/src/main/java/com/glxp/api/admin/service/thrsys/impl/ThrInvWarehouseServiceImpl.java index f7c7cade..03d190a4 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/service/thrsys/impl/ThrInvWarehouseServiceImpl.java +++ b/api-admin/src/main/java/com/glxp/api/admin/service/thrsys/impl/ThrInvWarehouseServiceImpl.java @@ -12,6 +12,7 @@ import com.glxp.api.admin.res.erp.UdiwmsWarehouseDetail; import com.glxp.api.admin.res.erp.UdiwmsWarehouseResponse; import com.glxp.api.admin.service.thrsys.ThrInvWarehouseService; import com.glxp.api.common.res.BaseResponse; +import com.glxp.api.common.util.ResultVOUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -107,28 +108,39 @@ public class ThrInvWarehouseServiceImpl implements ThrInvWarehouseService { @Transactional(rollbackFor = Exception.class) @Override public BaseResponse downloadThirdWarehouse(String thirdSysFk) { - UdiwmsWarehouseRequest udiwmsWarehouseRequest = new UdiwmsWarehouseRequest(); - udiwmsWarehouseRequest.setThirdSys(thirdSysFk); - BaseResponse> warehouse = erpBasicClient.getWarehouse(udiwmsWarehouseRequest); - if (warehouse.getCode().equals(20000)) { - List responseList = warehouse.getData().getList(); - List list = new ArrayList<>(); - for (UdiwmsWarehouseDetail response : responseList) { - ThrInvWarehouseEntity thrInvWarehouseEntity = new ThrInvWarehouseEntity(); - //TODO 暂不处理货位数据 - thrInvWarehouseEntity.setPid(0); - thrInvWarehouseEntity.setName(response.getName()); - thrInvWarehouseEntity.setCode(response.getCode()); - thrInvWarehouseEntity.setThirdSysFk(thirdSysFk); - thrInvWarehouseEntity.setAdvanceType(false); //默认是仓库 - thrInvWarehouseEntity.setStatus(1);//默认启用 - list.add(thrInvWarehouseEntity); + int page = 1; + int limit = 100; + while (true) { + UdiwmsWarehouseRequest udiwmsWarehouseRequest = new UdiwmsWarehouseRequest(); + udiwmsWarehouseRequest.setThirdSys(thirdSysFk); + udiwmsWarehouseRequest.setPage(page); + udiwmsWarehouseRequest.setLimit(limit); + BaseResponse> baseResponse = erpBasicClient.getWarehouse(udiwmsWarehouseRequest); + if (baseResponse.getCode() == 20000) { + List responseList = baseResponse.getData().getList(); + List list = new ArrayList<>(); + for (UdiwmsWarehouseDetail response : responseList) { + ThrInvWarehouseEntity thrInvWarehouseEntity = new ThrInvWarehouseEntity(); + thrInvWarehouseEntity.setPid(0); + thrInvWarehouseEntity.setName(response.getName()); + thrInvWarehouseEntity.setCode(response.getCode()); + thrInvWarehouseEntity.setThirdSysFk(thirdSysFk); + thrInvWarehouseEntity.setAdvanceType(false); //默认是仓库 + thrInvWarehouseEntity.setStatus(1);//默认启用 + list.add(thrInvWarehouseEntity); + } + //插入数据 + thrInvWarehouseDao.insertInvWarehouses(list); + if (list.size() >= limit) { + page++; + } else { + break; + } + } else { + return baseResponse; } - - //插入数据 - thrInvWarehouseDao.insertInvWarehouses(list); - warehouse.setData(null); } - return warehouse; + + return ResultVOUtils.success("下载结束!"); } } diff --git a/api-admin/src/main/resources/mybatis/mapper/info/DeviceKeyDao.xml b/api-admin/src/main/resources/mybatis/mapper/info/DeviceKeyDao.xml new file mode 100644 index 00000000..66dfc9e8 --- /dev/null +++ b/api-admin/src/main/resources/mybatis/mapper/info/DeviceKeyDao.xml @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + UPDATE device_check + + isCheck=#{isCheck}, + companyName=#{companyName}, + phone=#{phone}, + contact=#{contact}, + imeiKey=#{imeiKey}, + date=#{date}, + creditNum=#{creditNum}, + rgType=#{rgType}, + remark=#{remark}, + + + WHERE id=#{id} + + + + + + UPDATE device_check + + isCheck=#{isCheck}, + companyName=#{companyName}, + phone=#{phone}, + contact=#{contact}, + imeiKey=#{imeiKey}, + date=#{date}, + imei=#{imei}, + creditNum=#{creditNum}, + rgType=#{rgType}, + remark=#{remark}, + + WHERE imei=#{imei} + + + + replace INTO device_check( + imei, + isCheck, + companyName, + phone, + contact, + date, + imeiKey,creditNum,rgType,remark) values + ( + #{imei}, + #{isCheck}, + #{companyName}, + #{phone}, + #{contact}, + #{date}, + #{imeiKey},#{creditNum},#{rgType},#{remark} + + ) + + + DELETE FROM device_check WHERE id = #{id} + + + \ No newline at end of file diff --git a/api-admin/src/main/resources/mybatis/mapper/inout/OrderDao.xml b/api-admin/src/main/resources/mybatis/mapper/inout/OrderDao.xml index 55585341..418abd37 100644 --- a/api-admin/src/main/resources/mybatis/mapper/inout/OrderDao.xml +++ b/api-admin/src/main/resources/mybatis/mapper/inout/OrderDao.xml @@ -54,7 +54,7 @@ fromCorp, status, remark, exportStatus, fromType, contrastStatus, signStatus, receiveStatus, erpFk, stockCheckFk, supId, exportFilePath, locStorageCode, supplementNo, ullageSupNo, createUser, reviewUser, - outChangeEnable, originUllageSupNo,preCheck) + outChangeEnable, originUllageSupNo,preCheck,thirdBillNo) values (#{id}, #{action}, #{corpOrderId}, @@ -73,7 +73,7 @@ #{erpFk}, #{stockCheckFk}, #{supId}, #{exportFilePath}, #{locStorageCode}, #{supplementNo} - , #{ullageSupNo}, #{createUser}, #{reviewUser}, #{outChangeEnable}, #{originUllageSupNo},#{preCheck}) + , #{ullageSupNo}, #{createUser}, #{reviewUser}, #{outChangeEnable}, #{originUllageSupNo},#{preCheck},#{thirdBillNo}) @@ -82,7 +82,7 @@ fromCorp, status, remark, exportStatus, fromType, contrastStatus, signStatus, receiveStatus, erpFk, stockCheckFk, supId, exportFilePath, locStorageCode, supplementNo, ullageSupNo, createUser, reviewUser, - outChangeEnable, originUllageSupNo,preCheck) + outChangeEnable, originUllageSupNo,preCheck,thirdBillNo) values ( #{id}, #{action}, @@ -109,7 +109,7 @@ #{createUser}, #{reviewUser}, #{outChangeEnable}, - #{originUllageSupNo},#{preCheck} + #{originUllageSupNo},#{preCheck},#{thirdBillNo} ) @@ -146,6 +146,7 @@ outChangeEnable=#{outChangeEnable}, originUllageSupNo=#{originUllageSupNo}, preCheck=#{preCheck}, + thirdBillNo=#{thirdBillNo}, WHERE id = #{id} @@ -275,6 +276,10 @@ and locStorageCode =#{locStorageCode} + + and thirdBillNo =#{thirdBillNo} + + group by io_order.id ORDER BY actDate DESC @@ -346,6 +351,10 @@ and locStorageCode =#{locStorageCode} + + and thirdBillNo =#{thirdBillNo} + + group by io_order.id ORDER BY actDate DESC diff --git a/api-admin/src/main/resources/mybatis/mapper/inventory/InvWarehouseDao.xml b/api-admin/src/main/resources/mybatis/mapper/inventory/InvWarehouseDao.xml index a2e2a59f..fe8cac41 100644 --- a/api-admin/src/main/resources/mybatis/mapper/inventory/InvWarehouseDao.xml +++ b/api-admin/src/main/resources/mybatis/mapper/inventory/InvWarehouseDao.xml @@ -225,9 +225,9 @@ WHERE id = #{id} - + update inv_warehouse - set ${sysId} = ${thridWarehouseId} + set ${sysId} = ${thridWarehouseId,jdbcType=VARCHAR} where id = ${id}