diff --git a/src/main/java/com/glxp/api/controller/inout/IoCodeTempController.java b/src/main/java/com/glxp/api/controller/inout/IoCodeTempController.java index e5007e26..9f48c3fa 100644 --- a/src/main/java/com/glxp/api/controller/inout/IoCodeTempController.java +++ b/src/main/java/com/glxp/api/controller/inout/IoCodeTempController.java @@ -598,9 +598,9 @@ public class IoCodeTempController extends BaseController { if (IntUtil.value(priceFifo) > 0) { if (bussinessTypeEntity.getMainAction().equals(ConstantType.TYPE_OUT)) { //1.获取当前批次已出库数量 - Integer outCount = invProductDetailService.selectCountByInBatch(exitLocalEntity.getRelId() + "", exitLocalEntity.getBatchNo(), bussinessTypeEntity, exitLocalEntity.getInBatchNo(), exitLocalEntity.getInvCode(),ConstantType.TYPE_OUT); + Integer outCount = invProductDetailService.selectCountByInBatch(exitLocalEntity.getRelId() + "", exitLocalEntity.getBatchNo(), bussinessTypeEntity, exitLocalEntity.getInBatchNo(), exitLocalEntity.getInvCode(), ConstantType.TYPE_OUT); //2.获取当前批次入库数量 - Integer inCount = invProductDetailService.selectCountByInBatch(exitLocalEntity.getRelId() + "", exitLocalEntity.getBatchNo(), bussinessTypeEntity, exitLocalEntity.getInBatchNo(),exitLocalEntity.getInvCode(), ConstantType.TYPE_PUT); + Integer inCount = invProductDetailService.selectCountByInBatch(exitLocalEntity.getRelId() + "", exitLocalEntity.getBatchNo(), bussinessTypeEntity, exitLocalEntity.getInBatchNo(), exitLocalEntity.getInvCode(), ConstantType.TYPE_PUT); if ((IntUtil.value(inCount) - IntUtil.value(outCount) - IntUtil.value(exitLocalEntity.getReCount())) < 0) { InvProductDetailEntity nextInvProduct = invProductDetailService.selectNextInBatch(bussinessTypeEntity, exitLocalEntity.getRelId() + "", exitLocalEntity.getBatchNo(), exitLocalEntity.getInvCode(), ConstantType.TYPE_PUT, exitLocalEntity.getInBatchNo()); if (nextInvProduct != null) { diff --git a/src/main/java/com/glxp/api/controller/thrsys/ThrHslbController.java b/src/main/java/com/glxp/api/controller/thrsys/ThrHslbController.java new file mode 100644 index 00000000..ad155d3d --- /dev/null +++ b/src/main/java/com/glxp/api/controller/thrsys/ThrHslbController.java @@ -0,0 +1,46 @@ +package com.glxp.api.controller.thrsys; + +import com.github.pagehelper.PageInfo; +import com.glxp.api.annotation.AuthRuleAnnotation; +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.thrsys.ThrHslbEntity; +import com.glxp.api.req.thrsys.FilterThrHslbRequest; +import com.glxp.api.res.PageSimpleResponse; +import com.glxp.api.service.thrsys.ThrHslbService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.validation.BindingResult; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; +import java.util.List; + +@Slf4j +@RestController +public class ThrHslbController { + + @Resource + ThrHslbService thrHslbService; + + @AuthRuleAnnotation("") + @GetMapping("/udiwms/thrsys/getHslbs") + public BaseResponse getHslbs(FilterThrHslbRequest filterThrHslbRequest, + BindingResult bindingResult) { + + if (bindingResult.hasErrors()) { + return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); + } + List thrHslbEntities + = thrHslbService.getHslbs(filterThrHslbRequest); + PageInfo pageInfo; + pageInfo = new PageInfo<>(thrHslbEntities); + PageSimpleResponse pageSimpleResponse = new PageSimpleResponse<>(); + pageSimpleResponse.setTotal(pageInfo.getTotal()); + pageSimpleResponse.setList(thrHslbEntities); + return ResultVOUtils.success(pageSimpleResponse); + } + + +} diff --git a/src/main/java/com/glxp/api/dao/thrsys/ThrHslbMapper.java b/src/main/java/com/glxp/api/dao/thrsys/ThrHslbMapper.java new file mode 100644 index 00000000..563caf9d --- /dev/null +++ b/src/main/java/com/glxp/api/dao/thrsys/ThrHslbMapper.java @@ -0,0 +1,15 @@ +package com.glxp.api.dao.thrsys; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.glxp.api.entity.thrsys.ThrHslbEntity; +import com.glxp.api.req.thrsys.FilterThrHslbRequest; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +@Mapper +public interface ThrHslbMapper extends BaseMapper { + + List getHslbs(FilterThrHslbRequest filterThrHslbRequest); + +} diff --git a/src/main/java/com/glxp/api/entity/thrsys/ThrHslbEntity.java b/src/main/java/com/glxp/api/entity/thrsys/ThrHslbEntity.java new file mode 100644 index 00000000..74c64d60 --- /dev/null +++ b/src/main/java/com/glxp/api/entity/thrsys/ThrHslbEntity.java @@ -0,0 +1,46 @@ +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 io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import java.io.Serializable; +import java.util.Date; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +@TableName(value = "thr_hslb") +public class ThrHslbEntity implements Serializable { + @TableId(value = "id", type = IdType.INPUT) + private Integer id; + + @TableField(value = "hslb") + private String hslb; + + @TableField(value = "hsmc") + private String hsmc; + + @TableField(value = "hsbm") + private String hsbm; + + @TableField(value = "remark") + private String remark; + + @TableField(value = "updateTime") + private Date updateTime; + + @TableField(value = "createTime") + private Date createTime; + + private static final long serialVersionUID = 1L; +} diff --git a/src/main/java/com/glxp/api/req/thrsys/FilterThrHslbRequest.java b/src/main/java/com/glxp/api/req/thrsys/FilterThrHslbRequest.java new file mode 100644 index 00000000..0a1f640b --- /dev/null +++ b/src/main/java/com/glxp/api/req/thrsys/FilterThrHslbRequest.java @@ -0,0 +1,12 @@ +package com.glxp.api.req.thrsys; + +import com.glxp.api.util.page.ListPageRequest; +import lombok.Data; + +@Data +public class FilterThrHslbRequest extends ListPageRequest { + + private String key; + private String code; + +} diff --git a/src/main/java/com/glxp/api/res/basic/UdiRelevanceResponse.java b/src/main/java/com/glxp/api/res/basic/UdiRelevanceResponse.java index c8072e51..9dc56988 100644 --- a/src/main/java/com/glxp/api/res/basic/UdiRelevanceResponse.java +++ b/src/main/java/com/glxp/api/res/basic/UdiRelevanceResponse.java @@ -130,6 +130,8 @@ public class UdiRelevanceResponse { private Integer bpcrid; + private String hslbName; + public int getBhzxxsbzsl() { if (bhzxxsbzsl == null || bhzxxsbzsl == 0) { return 1; diff --git a/src/main/java/com/glxp/api/service/thrsys/ThrHslbService.java b/src/main/java/com/glxp/api/service/thrsys/ThrHslbService.java new file mode 100644 index 00000000..b412d2b9 --- /dev/null +++ b/src/main/java/com/glxp/api/service/thrsys/ThrHslbService.java @@ -0,0 +1,34 @@ +package com.glxp.api.service.thrsys; + +import com.github.pagehelper.PageHelper; +import com.glxp.api.req.thrsys.FilterThrCorpRequest; +import com.glxp.api.req.thrsys.FilterThrHslbRequest; +import com.glxp.api.res.thrsys.ThrCorpsResponse; +import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.glxp.api.dao.thrsys.ThrHslbMapper; +import com.glxp.api.entity.thrsys.ThrHslbEntity; + +import javax.annotation.Resource; +import java.util.Collections; +import java.util.List; + +@Service +public class ThrHslbService extends ServiceImpl { + + @Resource + ThrHslbMapper thrHslbMapper; + + public List getHslbs(FilterThrHslbRequest filterThrHslbRequest) { + if (filterThrHslbRequest == null) { + return Collections.emptyList(); + } + if (filterThrHslbRequest.getPage() != null) { + int offset = (filterThrHslbRequest.getPage() - 1) * filterThrHslbRequest.getLimit(); + PageHelper.offsetPage(offset, filterThrHslbRequest.getLimit()); + } + List data = thrHslbMapper.getHslbs(filterThrHslbRequest); + return data; + } + +} diff --git a/src/main/resources/mybatis/mapper/basic/UdiRelevanceDao.xml b/src/main/resources/mybatis/mapper/basic/UdiRelevanceDao.xml index e024f123..ae46a4eb 100644 --- a/src/main/resources/mybatis/mapper/basic/UdiRelevanceDao.xml +++ b/src/main/resources/mybatis/mapper/basic/UdiRelevanceDao.xml @@ -538,11 +538,13 @@ basic_products.sfwwjbz, basic_products.syqsfxyjxmj, basic_products.mjfs, - basic_products.categoryName + basic_products.categoryName, + th.hsmc hslbName FROM basic_products inner JOIN basic_udirel ON basic_products.uuid = basic_udirel.uuid left join basic_hosp_type bht on basic_udirel.relCode = bht.code + left join thr_hslb th on basic_products.basicPrductRemak8 = th.hsbm AND ylqxzcrbarmc LIKE concat('%', #{ylqxzcrbarmc}, '%') @@ -1711,7 +1713,7 @@ select basic_udirel.*, - basic_products.originUuid, - basic_products.nameCode, - basic_products.deviceRecordKey, - basic_products.packRatio, - basic_products.packUnit, - basic_products.packLevel, - basic_products.bhxjsl, - basic_products.bhzxxsbzsl, - basic_products.zxxsbzbhsydysl, - basic_products.bhxjcpbm, - basic_products.bzcj, - basic_products.cpmctymc, - basic_products.cplb, - basic_products.flbm, - basic_products.ggxh, - basic_products.qxlb, - basic_products.tyshxydm, - basic_products.ylqxzcrbarmc, - basic_products.zczbhhzbapzbh, - basic_products.ylqxzcrbarywmc, - basic_products.sydycpbs, - basic_products.sjcpbm, - basic_products.versionNumber, - basic_products.diType, - basic_products.ybbm, - basic_products.sptm, - basic_products.manufactory, - basic_products.measname, - basic_products.productType, - basic_products.scbssfbhph, - basic_products.scbssfbhxlh, - basic_products.scbssfbhscrq, - basic_products.scbssfbhsxrq, - basic_products.cpms, - basic_products.allowNoBatch, - basic_products.allowNoExpire, - basic_products.allowNoProduct, - basic_products.allowNoSerial, - basic_products.spmc, - basic_products.cplx, - basic_products.hchzsb, - basic_products.cpdls, - basic_products.basicPrductRemak1, - basic_products.basicPrductRemak2, - basic_products.basicPrductRemak3, - basic_products.basicPrductRemak4, - basic_products.basicPrductRemak5, - basic_products.basicPrductRemak6, - basic_products.basicPrductRemak7, - basic_products.basicPrductRemak8, - basic_products.sfwblztlcp, - basic_products.cgzmraqxgxx, - basic_products.sfbjwycxsy, - basic_products.zdcfsycs, - basic_products.sfwwjbz, - basic_products.syqsfxyjxmj, - basic_products.mjfs, - basic_products.categoryName + basic_products.originUuid, + basic_products.nameCode, + basic_products.deviceRecordKey, + basic_products.packRatio, + basic_products.packUnit, + basic_products.packLevel, + basic_products.bhxjsl, + basic_products.bhzxxsbzsl, + basic_products.zxxsbzbhsydysl, + basic_products.bhxjcpbm, + basic_products.bzcj, + basic_products.cpmctymc, + basic_products.cplb, + basic_products.flbm, + basic_products.ggxh, + basic_products.qxlb, + basic_products.tyshxydm, + basic_products.ylqxzcrbarmc, + basic_products.zczbhhzbapzbh, + basic_products.ylqxzcrbarywmc, + basic_products.sydycpbs, + basic_products.sjcpbm, + basic_products.versionNumber, + basic_products.diType, + basic_products.ybbm, + basic_products.sptm, + basic_products.manufactory, + basic_products.measname, + basic_products.productType, + basic_products.scbssfbhph, + basic_products.scbssfbhxlh, + basic_products.scbssfbhscrq, + basic_products.scbssfbhsxrq, + basic_products.cpms, + basic_products.allowNoBatch, + basic_products.allowNoExpire, + basic_products.allowNoProduct, + basic_products.allowNoSerial, + basic_products.spmc, + basic_products.cplx, + basic_products.hchzsb, + basic_products.cpdls, + basic_products.basicPrductRemak1, + basic_products.basicPrductRemak2, + basic_products.basicPrductRemak3, + basic_products.basicPrductRemak4, + basic_products.basicPrductRemak5, + basic_products.basicPrductRemak6, + basic_products.basicPrductRemak7, + basic_products.basicPrductRemak8, + basic_products.sfwblztlcp, + basic_products.cgzmraqxgxx, + basic_products.sfbjwycxsy, + basic_products.zdcfsycs, + basic_products.sfwwjbz, + basic_products.syqsfxyjxmj, + basic_products.mjfs, + basic_products.categoryName FROM basic_udirel - inner JOIN basic_products - ON basic_products.uuid = basic_udirel.uuid + inner JOIN basic_products + ON basic_products.uuid = basic_udirel.uuid AND basic_udirel.id = #{id} diff --git a/src/main/resources/mybatis/mapper/thrsys/ThrHslbMapper.xml b/src/main/resources/mybatis/mapper/thrsys/ThrHslbMapper.xml new file mode 100644 index 00000000..9cdc00b4 --- /dev/null +++ b/src/main/resources/mybatis/mapper/thrsys/ThrHslbMapper.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + id, hslb, hsmc, hsbm, remark, updateTime, createTime + + + + +