Forráskód Böngészése

物资管理采购、领用、库存修改

wangqiang 2 éve
szülő
commit
cb6b1e8be8

+ 6 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/materialManagement/contract/domain/Contract.java

@@ -16,6 +16,9 @@ import java.util.Date;
 @TableName("material_management_contract")
 public class Contract extends BaseEntity {
 
+    //入库编号(字典值)
+    public static final String BIZ_CODE = "30";
+
     //备注1
     private String remarks1;
     //备注2
@@ -51,6 +54,9 @@ public class Contract extends BaseEntity {
     //合同名称
     private String contractName;
 
+    //合同编号
+    private String contractNo;
+
     //签订日期
     @JsonFormat(pattern = "yyyy-MM-dd")
     private Date signingDate;

+ 6 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/materialManagement/contract/service/ContractService.java

@@ -17,6 +17,7 @@ import com.jeeplus.test.materialManagement.contract.mapper.ContractMapper;
 import com.jeeplus.test.materialManagement.contract.mapper.ContractUserMapper;
 import com.jeeplus.test.materialManagement.contract.service.dto.ContractInfoDto;
 import com.jeeplus.test.materialManagement.purchase.mapper.MaterialDetailedMapper;
+import com.jeeplus.test.mould.service.SerialnumTplService;
 import com.jeeplus.test.oss.domain.WorkAttachment;
 import com.jeeplus.test.oss.mapper.OssServiceMapper;
 import com.jeeplus.test.program.configuration.projectList.service.dto.ContractDto;
@@ -52,6 +53,8 @@ public class ContractService {
     @Resource
     private OssServiceMapper ossServiceMapper;
 
+    @Resource
+    private SerialnumTplService serialnumTplService;
 
     @Resource
     private ContractInfoService infoService;
@@ -190,10 +193,13 @@ public class ContractService {
     public String add(ContractInfoDto dto, UserDTO userDTO) throws Exception{
         // 生成id
         String id = UUID.randomUUID().toString().replace("-", "");
+        // 生成编号
+        String no = serialnumTplService.genSerialNum(userDTO.getCompanyDTO().getId(), dto.BIZ_CODE);
         // 保存基础信息表信息
         Contract info = new Contract();
         BeanUtils.copyProperties(dto, info);
         info.setId(id);
+        info.setContractNo(no);
         info.setCreateBy(userDTO.getId());
         info.setCreateDate(new Date());
         info.setUpdateBy(userDTO.getId());

+ 6 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/materialManagement/contract/service/dto/ContractInfoDto.java

@@ -15,6 +15,9 @@ import java.util.List;
 @Data
 public class ContractInfoDto {
 
+    //入库编号(字典值)
+    public static final String BIZ_CODE = "30";
+
     @JsonFormat(pattern = "yyyy-MM-dd")
     private String[] effectiveDates;
 
@@ -60,6 +63,9 @@ public class ContractInfoDto {
     //合同名称
     private String contractName;
 
+    //合同编号
+    private String contractNo;
+
     //签订日期
     @JsonFormat(pattern = "yyyy-MM-dd")
     private Date signingDate;

+ 12 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/materialManagement/wareHouse/controller/WareHouseController.java

@@ -79,6 +79,18 @@ public class WareHouseController {
     }
 
     /**
+     * 入库列表查询
+     * @param dto
+     * @return
+     */
+    @ApiOperation(value = "入库记录和领用记录查询")
+    @GetMapping("/wareHouseHistoryList")
+    public ResponseEntity<IPage<WareHouseDto>> wareHouseHistoryList(Page<WareHouseDto> page, WareHouseDto dto) throws Exception{
+        IPage<WareHouseDto> iPage = basicService.wareHouseHistoryList(page, dto);
+        return ResponseEntity.ok(iPage);
+    }
+
+    /**
      * 入库汇总列表查询
      * @param dto
      * @return

+ 2 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/materialManagement/wareHouse/mapper/WareHouseBasicMapper.java

@@ -21,5 +21,7 @@ public interface WareHouseBasicMapper extends BaseMapper<WareHouseBasic> {
 
     IPage<WareHouseDto> summaryList(Page<WareHouseDto> page,@Param(Constants.WRAPPER) QueryWrapper<WareHouseDto> queryWrapper);
 
+    IPage<WareHouseDto> wareHouseHistoryList(Page<WareHouseDto> page,@Param(Constants.WRAPPER) QueryWrapper<WareHouseDto> queryWrapper);
+
     String findRequestId(String purchaseNo);
 }

+ 49 - 1
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/materialManagement/wareHouse/mapper/xml/WareHouseBasicMapper.xml

@@ -3,6 +3,7 @@
 <mapper namespace="com.jeeplus.test.materialManagement.wareHouse.mapper.WareHouseBasicMapper">
     <select id="findList" resultType="com.jeeplus.test.materialManagement.wareHouse.service.dto.WareHouseDto">
 		SELECT
+			b.id as purchaseId,
 			a.id,
 			a.create_by,
 			a.create_date,
@@ -18,6 +19,8 @@
 			ifnull(a.status,'0') as status
 		FROM
 			material_management_warehouse_basics a
+			left join material_management_pruchase_request_basics b on a.purchase_no = b.purchase_no and b.del_flag = 0
+			left join material_management_collect_basics c on a.
 			left join sys_office so on a.handled_by_office = so.id
 			left join sys_user sy on sy.id = a.handled_by
 			${ew.customSqlSegment}
@@ -40,13 +43,21 @@
 			c.ware_house_date,
 			so.name as wareHouseManOfficeName,
 			sy.name as wareHouseManName,
-			d.name as wareHouseTypeName
+			d.name as wareHouseTypeName,
+			b.trade_number as allNumber,
+			g.collect_number as borrowNumber
 		FROM
 			material_management_warehouse_summary a
 			left join material_management_warehouse_detailed b on a.detailed_id = b.id and b.del_flag = 0
 			left join sys_user sy on sy.id = b.ware_house_man
 			left join sys_office so on sy.office_id = so.id
 			left join material_management_warehouse_basics c on b.basic_id = c.id and c.del_flag = 0
+
+			left join
+			(select collect_number,goods_name,status from material_management_collect_detailed e
+			left join material_management_collect_basics f on e.basic_id = f.id and f.del_flag = 0) g
+			on a.trade_name = g.goods_name and g.status = 5
+
 			left join cw_reimbursement_type_info d on a.ware_house_type = d.id
 			${ew.customSqlSegment}
 		ORDER BY a.update_date DESC
@@ -54,4 +65,41 @@
     <select id="findRequestId" resultType="java.lang.String">
 		select id from material_management_pruchase_request_basics where purchase_no = #{purchaseNo} and del_flag = 0
 	</select>
+	<select id="wareHouseHistoryList"
+			resultType="com.jeeplus.test.materialManagement.wareHouse.service.dto.WareHouseDto">
+		SELECT
+			d.id as wareHouseId,
+			d.ware_house_number,
+			d.ware_house_name,
+			d.ware_house_date,
+			sy.name as wareHouseHandledBy,
+			so.name as wareHouseHandledByOff,
+			g.id as collectId,
+			g.collect_no,
+			g.goods_name,
+			sy2.name as collectHandleBy,
+			so2.name as collectHandleByOff,
+			g.collect_date
+		FROM
+			material_management_warehouse_summary a
+			left join
+			(SELECT b.id,trade_name,ware_house_number,ware_house_name,ware_house_date,handled_by,handled_by_office FROM
+			material_management_warehouse_basics b LEFT JOIN
+			material_management_warehouse_detailed c on b.id = c.basic_id and c.del_flag = 0) d
+			on a.trade_name = d.trade_name
+			left join
+			(select f.id,collect_no,goods_name,handled_by,handled_by_office,collect_date
+			from material_management_collect_detailed e
+			left join material_management_collect_basics f on e.basic_id = f.id and f.del_flag = 0) g
+			on a.trade_name = g.goods_name
+
+			left join sys_user sy on sy.id = d.handled_by
+			left join sys_office so on sy.office_id = so.id
+
+			left join sys_user sy2 on sy2.id = g.handled_by
+			left join sys_office so2 on sy2.office_id = so2.id
+
+			${ew.customSqlSegment}
+		ORDER BY a.update_date DESC
+	</select>
 </mapper>

+ 17 - 1
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/materialManagement/wareHouse/service/WareHouseBasicService.java

@@ -68,6 +68,20 @@ public class WareHouseBasicService {
     @Resource
     private ContractInfoService infoService;
 
+    /**
+     * 列表查询
+     */
+    public IPage<WareHouseDto> wareHouseHistoryList(Page<WareHouseDto> page , WareHouseDto dto) throws Exception{
+        QueryWrapper<WareHouseDto> queryWrapper = QueryWrapperGenerator.buildQueryCondition(dto, WareHouseDto.class);
+
+        queryWrapper.eq("a.del_flag", "0");
+        if (StringUtils.isNotEmpty(dto.getTradeName())) {
+            queryWrapper.like("a.trade_name", dto.getTradeName());
+        }
+
+        return basicMapper.wareHouseHistoryList(page, queryWrapper);
+    }
+
     public String remove(String id) {
         // 删除基础信息表
         basicMapper.deleteById(id);
@@ -400,6 +414,9 @@ public class WareHouseBasicService {
         if (StringUtils.isNotEmpty(dto.getStatus())) {
             queryWrapper.like("a.status", dto.getStatus());
         }
+        if (StringUtils.isNotEmpty(dto.getPurchaseId())) {
+            queryWrapper.eq("b.id", dto.getPurchaseId());
+        }
         // 入库时间
         String[] contractDates = dto.getWareHouseDates();
         if (contractDates != null) {
@@ -418,7 +435,6 @@ public class WareHouseBasicService {
 
         queryWrapper.eq("a.del_flag", "0");
         queryWrapper.gt("a.trade_number", "0");
-
         if (StringUtils.isNotEmpty(dto.getWareHouseNumber())) {
             queryWrapper.like("c.ware_house_number", dto.getWareHouseNumber());
         }

+ 59 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/materialManagement/wareHouse/service/dto/WareHouseDto.java

@@ -175,9 +175,68 @@ public class WareHouseDto {
      */
     private String wareHouseManOfficeName;
 
+    /**
+     * 采购申请id
+     */
+    private String purchaseId;
 
     /**
      * 备注
      */
     private String remarks;
+
+    /**
+     * 总量
+     */
+    private String allNumber;
+
+    /**
+     * 领用量
+     */
+    private String borrowNumber;
+
+    /**
+     * 入库id
+     */
+    private String wareHouseId;
+
+    /**
+     * 入库经办人
+     */
+    private String wareHouseHandledBy;
+
+    /**
+     * 入库经办人部门
+     */
+    private String wareHouseHandledByOff;
+
+    /**
+     * 领用id
+     */
+    private String collectId;
+
+    /**
+     * 领用经办人
+     */
+    private String collectHandleBy;
+
+    /**
+     * 领用经办人部门
+     */
+    private String collectHandleByOff;
+
+    /**
+     * 领用物品名称
+     */
+    private String goodsName;
+
+    /**
+     * 领用编号
+     */
+    private String collectNo;
+
+    /**
+     * 领用时间
+     */
+    private String collectDate;
 }