Prechádzať zdrojové kódy

Merge remote-tracking branch 'origin/master'

user5 2 rokov pred
rodič
commit
9fd17f2563

+ 12 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/reimbursementApproval/approvalType/controller/CwReimbursementTypeController.java

@@ -114,4 +114,16 @@ public class CwReimbursementTypeController {
         return ResponseEntity.ok(infos);
     }
 
+    /**
+     * 查询树形
+     * @param extId 排除的ID
+     * @return
+     */
+    @ApiOperation(value = "查询树形")
+    @GetMapping("/treeData2")
+    public ResponseEntity<List<CwReimbursementTypeInfo>> treeData2(@RequestParam(required = false) String extId, @RequestParam(required = false) String type) throws Exception{
+        List<CwReimbursementTypeInfo> infos = treeService.treeDataForType2(extId, type);
+        return ResponseEntity.ok(infos);
+    }
+
 }

+ 7 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/reimbursementApproval/approvalType/mapper/CwReimbursementTypeMapper.java

@@ -33,4 +33,11 @@ public interface CwReimbursementTypeMapper extends BaseMapper<CwReimbursementTyp
     void updateChildBusType(@Param("id") String id, @Param("businessType") String businessType);
 
     List<String> getChildId(String id);
+
+    /**
+     * 获取所有业务类型的数据
+     * @param type
+     * @return
+     */
+    List<CwReimbursementTypeInfo> getAllList(String type);
 }

+ 4 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/reimbursementApproval/approvalType/mapper/xml/CwReimbursementTypeMapper.xml

@@ -35,4 +35,8 @@
 	<select id="getChildId" resultType="java.lang.String">
 		select id from cw_reimbursement_type_info where parent_id = #{id}
 	</select>
+	<select id="getAllList"
+			resultType="com.jeeplus.test.cw.reimbursementApproval.approvalType.domain.CwReimbursementTypeInfo">
+		select * from cw_reimbursement_type_info where business_type = #{type} and del_flag = '0' order by sort asc
+	</select>
 </mapper>

+ 20 - 1
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/reimbursementApproval/approvalType/service/CwReimbursementTypeForTreeDataService.java

@@ -33,7 +33,26 @@ public class CwReimbursementTypeForTreeDataService extends TreeService<CwReimbur
      * @return
      */
     public List<CwReimbursementTypeInfo> treeDataForType(String extId, String type) throws Exception{
-        List<CwReimbursementTypeInfo> allList = super.list (new LambdaQueryWrapper<>( (Class <CwReimbursementTypeInfo>) entityClass ).orderByAsc ( CwReimbursementTypeInfo::getSort ));
+        //获取所有的业务类型为1的数据
+        List<CwReimbursementTypeInfo> allList = typeMapper.getAllList("1");
+//        List<CwReimbursementTypeInfo> allList = super.list (new LambdaQueryWrapper<>( (Class <CwReimbursementTypeInfo>) entityClass ).orderByAsc ( CwReimbursementTypeInfo::getSort ));
+        CwReimbursementTypeInfo root = entityClass.getConstructor ( ).newInstance ( );
+        root.setId ( TreeDTO.getRootId () );
+        List <CwReimbursementTypeInfo> rootTree = this.formatListToTreeForType ( root, allList, extId, type );
+        return rootTree;
+    }
+
+    /**
+     * 获取JSON树形数据。
+     *
+     * @param extId 排除的ID
+     * @param type 禁选类型
+     * @return
+     */
+    public List<CwReimbursementTypeInfo> treeDataForType2(String extId, String type) throws Exception{
+        //获取所有的业务类型为1的数据
+        List<CwReimbursementTypeInfo> allList = typeMapper.getAllList("2");
+//        List<CwReimbursementTypeInfo> allList = super.list (new LambdaQueryWrapper<>( (Class <CwReimbursementTypeInfo>) entityClass ).orderByAsc ( CwReimbursementTypeInfo::getSort ));
         CwReimbursementTypeInfo root = entityClass.getConstructor ( ).newInstance ( );
         root.setId ( TreeDTO.getRootId () );
         List <CwReimbursementTypeInfo> rootTree = this.formatListToTreeForType ( root, allList, extId, type );

+ 9 - 3
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/materialManagement/mapper/xml/MaterialBasicMapper.xml

@@ -15,18 +15,22 @@
 			a.handled_by,
 			a.handled_by_office,
 			a.purchase_date,
-			a.purchase_mode,
+			(case a.purchase_mode
+				when 1 then '办公室采购'
+				when 2 then '自行采购'
+				end
+			) as purchase_mode,
 			a.status,
 			a.proc_ins_id,
 			a.process_definition_id,
 			b.procurement_type,
-			b.trade_total_price
+			b.trade_total_price,
+			so.name as handledByOfficeName
 		FROM
 			material_management_pruchase_request_basics a
+			left join sys_office so on a.handled_by_office = so.id
 			left join material_management_pruchase_request_detailed b
-			on a.id = b.basic_id and b.del_flag = 0
+			on a.id = b.basic_id and b.del_flag = '0'
 			${ew.customSqlSegment}
 		ORDER BY a.update_date DESC
     </select>

+ 5 - 1
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/materialManagement/service/MaterialService.java

@@ -58,7 +58,7 @@ public class MaterialService {
     public IPage<MaterialInfoDto> list(Page<MaterialInfoDto> page , MaterialInfoDto dto) throws Exception{
         QueryWrapper<MaterialInfoDto> queryWrapper = QueryWrapperGenerator.buildQueryCondition(dto, MaterialInfoDto.class);
 
-        queryWrapper.eq("a.del_flag", 0);
+        queryWrapper.eq("a.del_flag", "0");
         if (StringUtils.isNotEmpty(dto.getPurchaseSketch())) {
             queryWrapper.like("a.purchase_sketch", dto.getPurchaseSketch());
         }
@@ -79,6 +79,9 @@ public class MaterialService {
             queryWrapper.like("a.status", dto.getStatus());
         }
         //采购类别
+        if (StringUtils.isNotEmpty(dto.getProcurementType())) {
+            queryWrapper.like("b.procurement_type", dto.getProcurementType());
+        }
         //合同金额
         //3、合同金额(区间)
         String[] contractAmounts = dto.getContractAmounts();
@@ -178,6 +181,7 @@ public class MaterialService {
                 detailInfo.setDelFlag(0);
                 // 保存基础表信息主键值
                 detailInfo.setBasicId(dto.getId());
+                detailInfo.setTradeTotalPrice(dto.getTradeTotalPrice());
                 detailedMapper.insert(detailInfo);
                 // 修改附件信息列表
                 if (CollectionUtils.isNotEmpty(detailInfo.getFileInfoLost())) {