diff --git a/src/main/java/com/glxp/api/controller/basic/BasicBusTypePreController.java b/src/main/java/com/glxp/api/controller/basic/BasicBusTypePreController.java index 8578cf1a..89584385 100644 --- a/src/main/java/com/glxp/api/controller/basic/BasicBusTypePreController.java +++ b/src/main/java/com/glxp/api/controller/basic/BasicBusTypePreController.java @@ -6,12 +6,13 @@ import com.glxp.api.common.enums.ResultEnum; import com.glxp.api.common.res.BaseResponse; import com.glxp.api.common.util.ResultVOUtils; import com.glxp.api.entity.basic.BasicBusTypePreEntity; +import com.glxp.api.entity.basic.BasicBussinessTypeEntity; import com.glxp.api.req.basic.FilterBusTypeChangeRequest; import com.glxp.api.req.basic.FilterBusTypePreRequest; import com.glxp.api.req.system.DeleteRequest; -import com.glxp.api.res.PageSimpleResponse; import com.glxp.api.service.auth.InvWarehouseService; import com.glxp.api.service.basic.IBasicBusTypePreService; +import com.glxp.api.service.basic.IBasicBussinessTypeService; import lombok.extern.slf4j.Slf4j; import org.springframework.validation.BindingResult; import org.springframework.web.bind.annotation.GetMapping; @@ -32,11 +33,20 @@ public class BasicBusTypePreController { @Resource private IBasicBusTypePreService basicBusTypePreService; @Resource + private IBasicBussinessTypeService basicBussinessTypeService; + @Resource private InvWarehouseService invWarehouseService; - + /** + * 补单单据类型差查询 + * + * @param filterBusTypePreRequest + * @return + */ @GetMapping("/spms/bussinessChangeType/filter") - public BaseResponse filterBussinessType(FilterBusTypePreRequest bussinessTypeFilterRequest) { + public BaseResponse filterBussinessType(FilterBusTypePreRequest filterBusTypePreRequest) { + //查询扫码单据类型 + BasicBussinessTypeEntity basicBussinessType = basicBussinessTypeService.findByAction(filterBusTypePreRequest.getAction()); return ResultVOUtils.success(null); } @@ -46,15 +56,18 @@ public class BasicBusTypePreController { if (bindingResult.hasErrors()) { return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); } - List bussinessTypeEntities = basicBusTypePreService.filterAll(busTypeChangeFilterRequest); - PageInfo pageInfo; - pageInfo = new PageInfo<>(bussinessTypeEntities); - PageSimpleResponse pageSimpleResponse = new PageSimpleResponse<>(); - pageSimpleResponse.setTotal(pageInfo.getTotal()); - pageSimpleResponse.setList(bussinessTypeEntities); - return ResultVOUtils.success(pageSimpleResponse); + List basicBusTypePreEntities = basicBusTypePreService.filterAll(busTypeChangeFilterRequest); + PageInfo pageInfo = new PageInfo<>(basicBusTypePreEntities); + return ResultVOUtils.page(pageInfo); } + /** + * 根据补单单据类型编码或ID删除补单单据类型 + * + * @param basicBusTypePreEntity + * @param bindingResult + * @return + */ @PostMapping("/spms/bussinessChangeType/remove") public BaseResponse removeBussinessType(@RequestBody BasicBusTypePreEntity basicBusTypePreEntity, BindingResult bindingResult) { @@ -70,6 +83,13 @@ public class BasicBusTypePreController { return ResultVOUtils.success("删除成功"); } + /** + * 根据补单单据类型ID删除数据 + * + * @param deleteRequest + * @param bindingResult + * @return + */ @PostMapping("/spms/bussinessChangeType/delete") public BaseResponse deleteBussinessType(@RequestBody DeleteRequest deleteRequest, BindingResult bindingResult) { if (bindingResult.hasErrors()) { @@ -80,40 +100,52 @@ public class BasicBusTypePreController { return ResultVOUtils.success("删除成功"); } + /** + * 更新补单单据类型 + * + * @param basicBusTypePreEntity + * @param bindingResult + * @return + */ @PostMapping("/spms/bussinessChangeType/update") public BaseResponse updateBussinessType(@RequestBody BasicBusTypePreEntity basicBusTypePreEntity, BindingResult bindingResult) { if (bindingResult.hasErrors()) { return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); } - /*if (basicBusTypePreEntity != null) { - bussinessChangeTypeService.updateBusChangeType(basicBusTypePreEntity); - BussinessLocalTypeEntity bussinessLocalTypeEntity = bussinessLocalTypeService.findByAction(basicBusTypePreEntity.getAction()); - bussinessLocalTypeEntity.setUpdateTime(new Date()); - bussinessLocalTypeService.updateBusLocalType(bussinessLocalTypeEntity); + if (basicBusTypePreEntity != null) { + basicBusTypePreService.updateBusChangeType(basicBusTypePreEntity); } else { ResultVOUtils.error(999, "参数错误"); - }*/ + } return ResultVOUtils.success("更新成功"); } + /** + * 新增补单单据类型 + * + * @param basicBusTypePreEntity + * @param bindingResult + * @return + */ @PostMapping("/spms/bussinessChangeType/insert") public BaseResponse insertBussinessType(@RequestBody BasicBusTypePreEntity basicBusTypePreEntity, BindingResult bindingResult) { if (bindingResult.hasErrors()) { return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); } - /*if (basicBusTypePreEntity != null) { - if (StrUtil.isNotEmpty(basicBusTypePreEntity.getDefaultSubInv())) { - InvWarehouseEntity byInvSubByCode = invWarehouseService.findByInvSubByCode(basicBusTypePreEntity.getDefaultSubInv()); - basicBusTypePreEntity.setDefaultInv(invSubWarehouseEntity.getParentId()); - } - if (StrUtil.isNotEmpty(basicBusTypePreEntity.getLocSubInv())) { - InvSubWarehouseEntity invSubWarehouseEntity = invSubWarehouseService.findByInvSubByCode(basicBusTypePreEntity.getLocSubInv()); - basicBusTypePreEntity.setLocInv(invSubWarehouseEntity.getParentId()); - } - basicBusTypePreService.insertBusChangeTypee(basicBusTypePreEntity); + if (basicBusTypePreEntity != null) { + //TODO 补充补单单据类型仓库信息 + //if (StrUtil.isNotEmpty(basicBusTypePreEntity.getDefaultSubInv())) { + // InvWarehouseEntity byInvSubByCode = invWarehouseService.findByInvSubByCode(basicBusTypePreEntity.getDefaultSubInv()); + // basicBusTypePreEntity.setDefaultInv(invSubWarehouseEntity.getParentId()); + //} + //if (StrUtil.isNotEmpty(basicBusTypePreEntity.getLocSubInv())) { + // InvSubWarehouseEntity invSubWarehouseEntity = invSubWarehouseService.findByInvSubByCode(basicBusTypePreEntity.getLocSubInv()); + // basicBusTypePreEntity.setLocInv(invSubWarehouseEntity.getParentId()); + //} + basicBusTypePreService.insertBusChangeType(basicBusTypePreEntity); } else { ResultVOUtils.error(999, "参数错误"); - }*/ + } return ResultVOUtils.success("添加成功"); } diff --git a/src/main/java/com/glxp/api/dao/basic/BasicBusTypePreDao.java b/src/main/java/com/glxp/api/dao/basic/BasicBusTypePreDao.java index 72ffc0cd..527b6f18 100644 --- a/src/main/java/com/glxp/api/dao/basic/BasicBusTypePreDao.java +++ b/src/main/java/com/glxp/api/dao/basic/BasicBusTypePreDao.java @@ -2,12 +2,16 @@ package com.glxp.api.dao.basic; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.glxp.api.entity.basic.BasicBusTypePreEntity; +import com.glxp.api.req.basic.FilterBusTypeChangeRequest; import org.apache.ibatis.annotations.Mapper; +import java.util.List; + /** * 补单单据类型查询接口 */ @Mapper public interface BasicBusTypePreDao extends BaseMapper { + List selectList(FilterBusTypeChangeRequest busTypeChangeFilterRequest); } \ No newline at end of file diff --git a/src/main/java/com/glxp/api/dao/basic/ThrProductsExportLogDao.java b/src/main/java/com/glxp/api/dao/basic/ThrProductsExportLogDao.java new file mode 100644 index 00000000..b6d87f56 --- /dev/null +++ b/src/main/java/com/glxp/api/dao/basic/ThrProductsExportLogDao.java @@ -0,0 +1,7 @@ +package com.glxp.api.dao.basic; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.glxp.api.entity.thrsys.ThrProductsExportLogEntity; + +public interface ThrProductsExportLogDao extends BaseMapper { +} \ No newline at end of file diff --git a/src/main/java/com/glxp/api/dao/basic/ThrProductsImportDetailDao.java b/src/main/java/com/glxp/api/dao/basic/ThrProductsImportDetailDao.java new file mode 100644 index 00000000..dddda527 --- /dev/null +++ b/src/main/java/com/glxp/api/dao/basic/ThrProductsImportDetailDao.java @@ -0,0 +1,7 @@ +package com.glxp.api.dao.basic; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.glxp.api.entity.thrsys.ThrProductsImportDetailEntity; + +public interface ThrProductsImportDetailDao extends BaseMapper { +} \ No newline at end of file diff --git a/src/main/java/com/glxp/api/dao/thrsys/ThrBusTypeOriginDao.java b/src/main/java/com/glxp/api/dao/thrsys/ThrBusTypeOriginDao.java index 3882a682..3664a350 100644 --- a/src/main/java/com/glxp/api/dao/thrsys/ThrBusTypeOriginDao.java +++ b/src/main/java/com/glxp/api/dao/thrsys/ThrBusTypeOriginDao.java @@ -5,6 +5,7 @@ import com.glxp.api.entity.thrsys.ThrBusTypeOriginEntity; import com.glxp.api.req.thrsys.FilterThrBusTypeOriginRequest; import com.glxp.api.res.thrsys.ThrBusTypeOriginResponse; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.List; @@ -37,4 +38,12 @@ public interface ThrBusTypeOriginDao extends BaseMapper * @return */ boolean insertBusOriginType(ThrBusTypeOriginEntity thrBusTypeOriginEntity); + + /** + * 查询第三方单据类型名称 + * + * @param originAction + * @return + */ + String selectNameByAction(@Param("originAction") String originAction); } \ No newline at end of file diff --git a/src/main/java/com/glxp/api/entity/thrsys/ThrProductsExportLogEntity.java b/src/main/java/com/glxp/api/entity/thrsys/ThrProductsExportLogEntity.java new file mode 100644 index 00000000..df05b3e4 --- /dev/null +++ b/src/main/java/com/glxp/api/entity/thrsys/ThrProductsExportLogEntity.java @@ -0,0 +1,99 @@ +package com.glxp.api.entity.thrsys; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.util.Date; + +@Data +@TableName(value = "thr_products_export_log") +public class ThrProductsExportLogEntity { + + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + /** + * 生成日志记录 + */ + @TableField(value = "genKey") + private String genKey; + + /** + * 生成状态0:失败;1:成功 + */ + @TableField(value = "`status`") + private Integer status; + + /** + * 下载次数 + */ + @TableField(value = "dlCount") + private Integer dlCount; + + /** + * 文件下载路径 + */ + @TableField(value = "filePath") + private String filePath; + + /** + * 导出类型:1.文件导出;2.上传供应商 + */ + @TableField(value = "`type`") + private Integer type; + + /** + * 创建人 + */ + @TableField(value = "`createUser`") + private String createUser; + + /** + * 创建时间 + */ + @TableField(value = "createTime") + private Date createTime; + + /** + * 更新人 + */ + @TableField(value = "updateUser") + private String updateUser; + + /** + * 更新时间 + */ + @TableField(value = "updateTime") + private Date updateTime; + + /** + * 备注 + */ + @TableField(value = "remark") + private String remark; + + public static final String COL_ID = "id"; + + public static final String COL_GENKEY = "genKey"; + + public static final String COL_STATUS = "status"; + + public static final String COL_DLCOUNT = "dlCount"; + + public static final String COL_FILEPATH = "filePath"; + + public static final String COL_TYPE = "type"; + + public static final String COL_CREATEUSER = "createUser"; + + public static final String COL_CREATETIME = "createTime"; + + public static final String COL_UPDATEUSER = "updateUser"; + + public static final String COL_UPDATETIME = "updateTime"; + + public static final String COL_REMARK = "remark"; +} \ No newline at end of file diff --git a/src/main/java/com/glxp/api/entity/thrsys/ThrProductsImportDetailEntity.java b/src/main/java/com/glxp/api/entity/thrsys/ThrProductsImportDetailEntity.java new file mode 100644 index 00000000..97806442 --- /dev/null +++ b/src/main/java/com/glxp/api/entity/thrsys/ThrProductsImportDetailEntity.java @@ -0,0 +1,157 @@ +package com.glxp.api.entity.thrsys; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import java.util.Date; +import lombok.Data; + +@Data +@TableName(value = "thr_products_import_detail") +public class ThrProductsImportDetailEntity { + @TableId(value = "id", type = IdType.INPUT) + private Integer id; + + @TableField(value = "code") + private String code; + + @TableField(value = "`name`") + private String name; + + @TableField(value = "measname") + private String measname; + + @TableField(value = "spec") + private String spec; + + @TableField(value = "registerNo") + private String registerNo; + + @TableField(value = "manufactory") + private String manufactory; + + @TableField(value = "thirdSysFk") + private String thirdSysFk; + + @TableField(value = "cplb") + private String cplb; + + @TableField(value = "flbm") + private String flbm; + + @TableField(value = "qxlb") + private String qxlb; + + @TableField(value = "ybbm") + private String ybbm; + + @TableField(value = "sptm") + private String sptm; + + @TableField(value = "tyshxydm") + private String tyshxydm; + + @TableField(value = "zczbhhzbapzbh") + private String zczbhhzbapzbh; + + @TableField(value = "ylqxzcrbarmc") + private String ylqxzcrbarmc; + + @TableField(value = "ylqxzcrbarywmc") + private String ylqxzcrbarywmc; + + @TableField(value = "cpms") + private String cpms; + + @TableField(value = "updateTime") + private Date updateTime; + + @TableField(value = "genKeyFk") + private String genKeyFk; + + @TableField(value = "supName") + private String supName; + + /** + * 价格 + */ + @TableField(value = "price") + private String price; + + /** + * 创建人 + */ + @TableField(value = "`createUser`") + private String createUser; + + /** + * 创建时间 + */ + @TableField(value = "createTime") + private Date createTime; + + /** + * 更新人 + */ + @TableField(value = "updateUser") + private String updateUser; + + /** + * 备注 + */ + @TableField(value = "remark") + private String remark; + + public static final String COL_ID = "id"; + + public static final String COL_CODE = "code"; + + public static final String COL_NAME = "name"; + + public static final String COL_MEASNAME = "measname"; + + public static final String COL_SPEC = "spec"; + + public static final String COL_REGISTERNO = "registerNo"; + + public static final String COL_MANUFACTORY = "manufactory"; + + public static final String COL_THIRDSYSFK = "thirdSysFk"; + + public static final String COL_CPLB = "cplb"; + + public static final String COL_FLBM = "flbm"; + + public static final String COL_QXLB = "qxlb"; + + public static final String COL_YBBM = "ybbm"; + + public static final String COL_SPTM = "sptm"; + + public static final String COL_TYSHXYDM = "tyshxydm"; + + public static final String COL_ZCZBHHZBAPZBH = "zczbhhzbapzbh"; + + public static final String COL_YLQXZCRBARMC = "ylqxzcrbarmc"; + + public static final String COL_YLQXZCRBARYWMC = "ylqxzcrbarywmc"; + + public static final String COL_CPMS = "cpms"; + + public static final String COL_UPDATETIME = "updateTime"; + + public static final String COL_GENKEYFK = "genKeyFk"; + + public static final String COL_SUPNAME = "supName"; + + public static final String COL_PRICE = "price"; + + public static final String COL_CREATEUSER = "createUser"; + + public static final String COL_CREATETIME = "createTime"; + + public static final String COL_UPDATEUSER = "updateUser"; + + public static final String COL_REMARK = "remark"; +} \ No newline at end of file diff --git a/src/main/java/com/glxp/api/http/ErpBasicClient.java b/src/main/java/com/glxp/api/http/ErpBasicClient.java index 4d0494c1..077096f6 100644 --- a/src/main/java/com/glxp/api/http/ErpBasicClient.java +++ b/src/main/java/com/glxp/api/http/ErpBasicClient.java @@ -2,18 +2,16 @@ package com.glxp.api.http; import cn.hutool.core.util.StrUtil; import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson.TypeReference; import com.glxp.api.common.res.BaseResponse; import com.glxp.api.common.util.ResultVOUtils; -import com.glxp.api.entity.basic.BasicThirdSysEntity; import com.glxp.api.entity.thrsys.ThrSystemBusApiEntity; import com.glxp.api.entity.thrsys.ThrSystemEntity; -import com.alibaba.fastjson.TypeReference; +import com.glxp.api.http.req.UdiwmsBusTypeRequest; +import com.glxp.api.req.thrsys.FilterBasicThirdSysDetailRequest; import com.glxp.api.req.thrsys.FilterThrProductsRequest; -import com.glxp.api.req.thrsys.ThrProductsRequest; import com.glxp.api.res.PageSimpleResponse; import com.glxp.api.res.thrsys.ThrProductsResponse; -import com.glxp.api.req.thrsys.FilterBasicThirdSysDetailRequest; -import com.glxp.api.res.PageSimpleResponse; import com.glxp.api.service.thrsys.ThrSystemService; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; @@ -138,6 +136,22 @@ public class ErpBasicClient { //下载第三方系统单据类型 public BaseResponse> getBusTypes(FilterBasicThirdSysDetailRequest filterBasicThirdSysDetailRequest) { - return null; + ThrSystemEntity thrSystemEntity = basicThirdSysService.selectByThirdId(filterBasicThirdSysDetailRequest.getThirdSysFk()); + String url = thrSystemEntity.getThridUrl() + "/udiwms/erp/getOrderType"; + UdiwmsBusTypeRequest udiwmsBusTypeRequest = new UdiwmsBusTypeRequest(); + udiwmsBusTypeRequest.setThirdSys(filterBasicThirdSysDetailRequest.getThirdSysFk()); + udiwmsBusTypeRequest.setPage(filterBasicThirdSysDetailRequest.getPage()); + udiwmsBusTypeRequest.setLimit(filterBasicThirdSysDetailRequest.getLimit()); + try { + String response = httpOkClient.uCloudPost(url, udiwmsBusTypeRequest, thrSystemEntity); + log.info(response); + BaseResponse> udiDlDeviceResponse = + JSONObject.parseObject(response, new TypeReference>>() { + }); + return udiDlDeviceResponse; + } catch (Exception e) { + log.error("获取单据类型异常", e); + return ResultVOUtils.error(500, "连接第三方系统接口服务出错!"); + } } } diff --git a/src/main/java/com/glxp/api/http/req/UdiwmsBusTypeRequest.java b/src/main/java/com/glxp/api/http/req/UdiwmsBusTypeRequest.java new file mode 100644 index 00000000..4b2b6efe --- /dev/null +++ b/src/main/java/com/glxp/api/http/req/UdiwmsBusTypeRequest.java @@ -0,0 +1,41 @@ +package com.glxp.api.http.req; + +import lombok.Data; + +/** + * 下载第三方单据单据类型请求参数 + */ +@Data +public class UdiwmsBusTypeRequest { + + /** + * 数据ID + */ + private String id; + + /** + * 编码 + */ + private String code; + + /** + * 名称 + */ + private String name; + + /** + * 页码 + */ + private Integer page; + + /** + * 数据条数 + */ + private Integer limit; + + /** + * 第三方系统标识 + */ + private String thirdSys; + +} diff --git a/src/main/java/com/glxp/api/service/basic/IBasicBusTypePreService.java b/src/main/java/com/glxp/api/service/basic/IBasicBusTypePreService.java index 411ebb96..4ed8a54b 100644 --- a/src/main/java/com/glxp/api/service/basic/IBasicBusTypePreService.java +++ b/src/main/java/com/glxp/api/service/basic/IBasicBusTypePreService.java @@ -9,9 +9,46 @@ import java.util.List; * 补单单据类型Service */ public interface IBasicBusTypePreService { + + /** + * 查询补单单据类型数据列表 + * + * @param busTypeChangeFilterRequest + * @return + */ List filterAll(FilterBusTypeChangeRequest busTypeChangeFilterRequest); + /** + * 根据ID删除补单单据类型 + * + * @param id + * @return + */ boolean deleteById(String id); + /** + * 根据单据类型编码删除补单单据类型 + * + * @param action + * @return + */ + boolean deleteByAction(String action); + + /** + * 更新补单单据类型 + * + * @param basicBusTypePreEntity + * @return + */ + + boolean updateBusChangeType(BasicBusTypePreEntity basicBusTypePreEntity); + + /** + * 新增补单单据类型 + * + * @param basicBusTypePreEntity + * @return + */ + boolean insertBusChangeType(BasicBusTypePreEntity basicBusTypePreEntity); } diff --git a/src/main/java/com/glxp/api/service/basic/impl/BasicBusTypePreServiceImpl.java b/src/main/java/com/glxp/api/service/basic/impl/BasicBusTypePreServiceImpl.java index 7ed0184b..c6e0319a 100644 --- a/src/main/java/com/glxp/api/service/basic/impl/BasicBusTypePreServiceImpl.java +++ b/src/main/java/com/glxp/api/service/basic/impl/BasicBusTypePreServiceImpl.java @@ -1,5 +1,7 @@ package com.glxp.api.service.basic.impl; +import com.github.pagehelper.PageHelper; +import com.glxp.api.dao.basic.BasicBusTypePreDao; import com.glxp.api.entity.basic.BasicBusTypePreEntity; import com.glxp.api.req.basic.FilterBusTypeChangeRequest; import com.glxp.api.service.basic.IBasicBusTypePreService; @@ -7,15 +9,23 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import javax.annotation.Resource; import java.util.List; @Slf4j @Service @Transactional(rollbackFor = Exception.class) public class BasicBusTypePreServiceImpl implements IBasicBusTypePreService { + + @Resource + private BasicBusTypePreDao basicBusTypePreDao; + @Override public List filterAll(FilterBusTypeChangeRequest busTypeChangeFilterRequest) { - return null; + if (null != busTypeChangeFilterRequest.getPage() && null != busTypeChangeFilterRequest.getLimit()) { + PageHelper.offsetPage((busTypeChangeFilterRequest.getPage() - 1) * busTypeChangeFilterRequest.getLimit(), busTypeChangeFilterRequest.getLimit()); + } + return basicBusTypePreDao.selectList(busTypeChangeFilterRequest); } @Override @@ -27,4 +37,14 @@ public class BasicBusTypePreServiceImpl implements IBasicBusTypePreService { public boolean deleteByAction(String action) { return false; } + + @Override + public boolean updateBusChangeType(BasicBusTypePreEntity basicBusTypePreEntity) { + return false; + } + + @Override + public boolean insertBusChangeType(BasicBusTypePreEntity basicBusTypePreEntity) { + return false; + } } diff --git a/src/main/java/com/glxp/api/service/thrsys/IThrBusTypeOriginService.java b/src/main/java/com/glxp/api/service/thrsys/IThrBusTypeOriginService.java index 6321c85f..e847dbcd 100644 --- a/src/main/java/com/glxp/api/service/thrsys/IThrBusTypeOriginService.java +++ b/src/main/java/com/glxp/api/service/thrsys/IThrBusTypeOriginService.java @@ -77,6 +77,28 @@ public interface IThrBusTypeOriginService { */ ThrSystemDetailEntity findSysByAction(String action, String key); - //ThrBusTypeOriginResponse findByThirdAction + /** + * 根据第三方单据类型编码查询第三方单据类型信息 + * + * @param action + * @return + */ + ThrBusTypeOriginResponse findByThirdAction(String action); + + /** + * 根据出入库类型查询第三方单据类型 + * + * @param mainAction + * @return + */ + ThrBusTypeOriginResponse findByMainAction(String mainAction); + + /** + * 查询第三方单据类型名称 + * + * @param originAction + * @return + */ + String findNameByAction(String originAction); } diff --git a/src/main/java/com/glxp/api/service/thrsys/impl/ThrBusTypeOriginServiceImpl.java b/src/main/java/com/glxp/api/service/thrsys/impl/ThrBusTypeOriginServiceImpl.java index 0894ab7a..c005d173 100644 --- a/src/main/java/com/glxp/api/service/thrsys/impl/ThrBusTypeOriginServiceImpl.java +++ b/src/main/java/com/glxp/api/service/thrsys/impl/ThrBusTypeOriginServiceImpl.java @@ -1,5 +1,6 @@ package com.glxp.api.service.thrsys.impl; +import cn.hutool.core.collection.CollUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.github.pagehelper.PageHelper; import com.glxp.api.dao.thrsys.ThrBusTypeOriginDao; @@ -9,7 +10,9 @@ import com.glxp.api.req.thrsys.FilterThrBusTypeOriginRequest; import com.glxp.api.res.thrsys.ThrBusTypeOriginResponse; import com.glxp.api.service.auth.CustomerService; import com.glxp.api.service.thrsys.IThrBusTypeOriginService; +import com.glxp.api.service.thrsys.ThrSystemDetailService; import lombok.extern.slf4j.Slf4j; +import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -27,6 +30,9 @@ public class ThrBusTypeOriginServiceImpl implements IThrBusTypeOriginService { private CustomerService customerService; @Resource private ThrBusTypeOriginDao thrBusTypeOriginDao; + @Lazy + @Resource + private ThrSystemDetailService thrSystemDetailService; @Override public List filterEnableList(FilterThrBusTypeOriginRequest filterThrBusTypeOriginRequest) { @@ -78,14 +84,52 @@ public class ThrBusTypeOriginServiceImpl implements IThrBusTypeOriginService { @Override public ThrBusTypeOriginEntity findByAction(String action) { + QueryWrapper query = new QueryWrapper<>(); + query.like("action", action); + List list = thrBusTypeOriginDao.selectList(query); + if (CollUtil.isNotEmpty(list)) { + return list.get(0); + } return null; } @Override public ThrSystemDetailEntity findSysByAction(String action, String key) { + ThrBusTypeOriginEntity thrBusTypeOrigin = findByAction(action); + if (null != thrBusTypeOrigin) { + ThrSystemDetailEntity thrSystemDetailEntity = thrSystemDetailService.selectByKey(key, thrBusTypeOrigin.getThirdSys()); + return thrSystemDetailEntity; + } + return null; + } + + @Override + public ThrBusTypeOriginResponse findByThirdAction(String action) { + FilterThrBusTypeOriginRequest request = new FilterThrBusTypeOriginRequest(); + request.setThirdAction(action); + List responseList = thrBusTypeOriginDao.filterJoinList(request); + if (CollUtil.isNotEmpty(responseList)) { + return responseList.get(0); + } return null; } + @Override + public ThrBusTypeOriginResponse findByMainAction(String mainAction) { + FilterThrBusTypeOriginRequest request = new FilterThrBusTypeOriginRequest(); + request.setMainAction(mainAction); + List responseList = thrBusTypeOriginDao.filterJoinList(request); + if (CollUtil.isNotEmpty(responseList)) { + return responseList.get(0); + } + return null; + } + + @Override + public String findNameByAction(String originAction) { + return thrBusTypeOriginDao.selectNameByAction(originAction); + } + /** * 设置创建/更新信息 * diff --git a/src/main/resources/mybatis/mapper/basic/BasicBusTypePreDao.xml b/src/main/resources/mybatis/mapper/basic/BasicBusTypePreDao.xml index f5b8e000..751597f9 100644 --- a/src/main/resources/mybatis/mapper/basic/BasicBusTypePreDao.xml +++ b/src/main/resources/mybatis/mapper/basic/BasicBusTypePreDao.xml @@ -2,4 +2,7 @@ + \ No newline at end of file diff --git a/src/main/resources/mybatis/mapper/thrsys/ThrBusTypeOriginDao.xml b/src/main/resources/mybatis/mapper/thrsys/ThrBusTypeOriginDao.xml index 988d80d8..a2a0cef6 100644 --- a/src/main/resources/mybatis/mapper/thrsys/ThrBusTypeOriginDao.xml +++ b/src/main/resources/mybatis/mapper/thrsys/ThrBusTypeOriginDao.xml @@ -74,4 +74,8 @@ #{updateUser}, #{createTime}) + + \ No newline at end of file diff --git a/src/main/resources/mybatis/mapper/thrsys/ThrProductsExportLogDao.xml b/src/main/resources/mybatis/mapper/thrsys/ThrProductsExportLogDao.xml new file mode 100644 index 00000000..54e78eef --- /dev/null +++ b/src/main/resources/mybatis/mapper/thrsys/ThrProductsExportLogDao.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + id, genKey, `status`, dlCount, filePath, `type`, `createUser`, createTime, updateUser, + updateTime, remark + + \ No newline at end of file diff --git a/src/main/resources/mybatis/mapper/thrsys/ThrProductsImportDetailDao.xml b/src/main/resources/mybatis/mapper/thrsys/ThrProductsImportDetailDao.xml new file mode 100644 index 00000000..aadb0397 --- /dev/null +++ b/src/main/resources/mybatis/mapper/thrsys/ThrProductsImportDetailDao.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id, code, `name`, measname, spec, registerNo, manufactory, thirdSysFk, cplb, flbm, + qxlb, ybbm, sptm, tyshxydm, zczbhhzbapzbh, ylqxzcrbarmc, ylqxzcrbarywmc, cpms, updateTime, + genKeyFk, supName, price, `createUser`, createTime, updateUser, remark + + \ No newline at end of file