Bladeren bron

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/sys/controller/OfficeController.java
#	jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/sys/service/OfficeService.java
lizhenhao 2 jaren geleden
bovenliggende
commit
99e19cc9a8
23 gewijzigde bestanden met toevoegingen van 570 en 228 verwijderingen
  1. 1 1
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/controller/ContractInfoController.java
  2. 1 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/domain/ContractInfo.java
  3. 1 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/mapper/xml/ContractInfoMapper.xml
  4. 4 4
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/service/ContractFilePaperService.java
  5. 51 9
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/service/ContractInfoService.java
  6. 2 2
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/reimbursementApproval/approvalType/controller/CwReimbursementTypeController.java
  7. 16 4
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/reimbursementApproval/approvalType/domain/CwReimbursementTypeInfo.java
  8. 38 9
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/reimbursementApproval/approvalType/mapper/CwReimbursementTypeMapper.java
  9. 192 4
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/reimbursementApproval/approvalType/mapper/xml/CwReimbursementTypeMapper.xml
  10. 4 4
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/reimbursementApproval/approvalType/service/CwReimbursementTypeForTreeDataService.java
  11. 56 14
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/reimbursementApproval/approvalType/service/CwReimbursementTypeService.java
  12. 14 2
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/materialManagement/wareHouse/controller/WareHouseController.java
  13. 2 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/materialManagement/wareHouse/mapper/WareHouseBasicMapper.java
  14. 40 44
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/materialManagement/wareHouse/mapper/xml/WareHouseBasicMapper.xml
  15. 116 102
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/materialManagement/wareHouse/service/WareHouseBasicService.java
  16. 0 5
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/zs/zsReimbursement/approvalType/domain/ZsReimbursementTypeInfo.java
  17. 0 7
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/zs/zsReimbursement/approvalType/mapper/ZsReimbursementTypeMapper.java
  18. 1 4
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/zs/zsReimbursement/approvalType/mapper/xml/ZsReimbursementTypeMapper.xml
  19. 0 13
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/zs/zsReimbursement/approvalType/service/ZsReimbursementTypeService.java
  20. 8 0
      jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/sys/controller/OfficeController.java
  21. 6 0
      jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/sys/mapper/OfficeMapper.java
  22. 9 0
      jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/sys/mapper/xml/OfficeMapper.xml
  23. 8 0
      jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/sys/service/OfficeService.java

+ 1 - 1
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/controller/ContractInfoController.java

@@ -46,7 +46,7 @@ public class ContractInfoController {
      * 合同登记新增/修改    cw:workContract:add
      */
     @ApiOperation(value = "合同登记新增/修改")
-    @PreAuthorize("hasAnyAuthority('cw:workContract:add')")
+    @PreAuthorize("hasAnyAuthority('cw:workContract:add','cw:workContract:edit')")
     @PostMapping(value = "save")
     public ResponseEntity<String> save(@RequestBody ContractInfo info) throws Exception{
         String id = service.saveInfo(info);

+ 1 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/domain/ContractInfo.java

@@ -50,6 +50,7 @@ public class ContractInfo extends BaseEntity {
     private Date signingDate;             //签约日期
     @Query(tableColumn = "a.contract_amount")
     private Double contractAmount;          //合同金额(元)
+    private Double predictAmount;          //预计金额(元)
     private Double actualContractAmount;    //合同实际金额
     private String contractNum;             //合同份数
     private String paymentAgreement;        //付款约定

+ 1 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/mapper/xml/ContractInfoMapper.xml

@@ -119,6 +119,7 @@
             a.contract_approval_type as contractApprovalType,
             a.proc_ins_id as procInsId,
             a.status,
+            a.predict_amount as "predictAmount",
             b.filed_type as filedType,
             d.filed_paper_type as filedPaperType,
             d.filed_no as filedNo,

+ 4 - 4
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/service/ContractFilePaperService.java

@@ -83,13 +83,13 @@ public class ContractFilePaperService {
         file.setUpdateBy(userDTO.getId());
         file.setUpdateDate(new Date());
         mapper.updateById(file);
-        List<WorkAttachmentDto> list = filePaper.getContractInfoList();
+        /*List<WorkAttachmentDto> list = filePaper.getContractInfoList();
         if (CollectionUtils.isNotEmpty(list)) {
             updateFiles(list, userDTO, file.getId());
         }else {
             //删除文件信息
             mapper.deleteFileInfo(file.getId());
-        }
+        }*/
         return file.getId();
     }
 
@@ -109,10 +109,10 @@ public class ContractFilePaperService {
         file.setUpdateBy(userDTO.getId());
         file.setUpdateDate(new Date());
         mapper.insert(file);
-        List<WorkAttachmentDto> list = filePaper.getContractInfoList();
+        /*List<WorkAttachmentDto> list = filePaper.getContractInfoList();
         if (CollectionUtils.isNotEmpty(list)) {
             saveFiles(list, userDTO, id);
-        }
+        }*/
         return id;
     }
 

+ 51 - 9
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/service/ContractInfoService.java

@@ -87,6 +87,11 @@ public class ContractInfoService {
      */
     public void updatePaperInfo(ContractInfo info) {
         mapper.updatePaperInfo(info.getId(), info.getActualContractAmount(),info.getContractApprovalType(), info.getFiledPaperType());
+        List<WorkAttachmentDto> list = info.getContractInfoList();
+        UserDTO userDTO = UserUtils.getCurrentUserDTO();
+        if (CollectionUtils.isNotEmpty(list)) {
+            updateFiles(list, userDTO, info.getId());
+        }
     }
 
     public IPage<ContractInfo> list(Page<ContractInfo> page, ContractInfo info, QueryWrapper<ContractInfo> wrapper) {
@@ -133,8 +138,15 @@ public class ContractInfoService {
             }
         }
         //7、状态
-        if (StringUtils.isNotEmpty(info.getStatus())) {
-            wrapper.like("a.status", info.getStatus());
+        //判断 状态是否包含 逗号
+        if(StringUtils.isNotBlank(info.getStatus())){
+            if (info.getStatus().contains(",")) {
+                List<String> statusList = Lists.newLinkedList();
+                statusList = Arrays.asList(info.getStatus().split(","));
+                wrapper.in("a.status", statusList);
+            }else{
+                wrapper.like("a.status", info.getStatus());
+            }
         }
         //8、归档状态
         if (StringUtils.isNotEmpty(info.getFiledType())) {
@@ -144,6 +156,10 @@ public class ContractInfoService {
         if (StringUtils.isNotEmpty(info.getFiledPaperType())) {
             wrapper.like("a.filed_paper_type", info.getFiledPaperType());
         }
+        //委托方名称
+        if (StringUtils.isNotBlank(info.getClientContactsName())) {
+            wrapper.like("cw_wcb.name", info.getClientContactsName());
+        }
         wrapper.eq("a.del_flag","0");
 
 
@@ -206,6 +222,7 @@ public class ContractInfoService {
     public ContractInfo findById(String id) {
 
         ContractInfo dto = mapper.findById(id);
+        List<WorkAttachmentDto> fileList = Lists.newArrayList();
 
         if (dto != null){
             List<ContractParticipant> participant = participantMapper.findByInfoId(dto.getId());
@@ -217,6 +234,7 @@ public class ContractInfoService {
                     i.setCreateBy(UserUtils.get(i.getBy()));
                 }
             }
+            fileList.addAll(dtos);
             List<CwWorkClientBaseDTO> list = new ArrayList<>();
             if (participant.size()>0){
                 participant.forEach(cw->{
@@ -248,12 +266,13 @@ public class ContractInfoService {
                     for (WorkAttachmentDto i : fileDtos) {
                         i.setCreateBy(UserUtils.get(i.getBy()));
                     }
-                    dto.setContractInfoList(fileDtos);
+                    fileList.addAll(fileDtos);
+                    //dto.setContractInfoList(fileDtos);
                 }
             }
 
             dto.setCwWorkClientContactDTOList(list);
-            dto.setContractProperList(dtos);
+            dto.setContractProperList(fileList);
         } else {
             //穿来的是归档的id
             ContractFile infoByConId = fileMapper.getById(id);
@@ -269,6 +288,7 @@ public class ContractInfoService {
                             i.setCreateBy(UserUtils.get(i.getBy()));
                         }
                     }
+                    fileList.addAll(dtos);
                     List<CwWorkClientBaseDTO> list = new ArrayList<>();
                     if (participant.size()>0){
                         participant.forEach(cw->{
@@ -286,12 +306,13 @@ public class ContractInfoService {
                             for (WorkAttachmentDto i : fileDtos) {
                                 i.setCreateBy(UserUtils.get(i.getBy()));
                             }
-                            dto.setContractInfoList(fileDtos);
+                            fileList.addAll(fileDtos);
+                            //dto.setContractInfoList(fileDtos);
                         }
                     }
 
                     dto.setCwWorkClientContactDTOList(list);
-                    dto.setContractProperList(dtos);
+                    dto.setContractProperList(fileList);
                 }
             } else {
                 //传过来的是纸质归档的id
@@ -309,6 +330,7 @@ public class ContractInfoService {
                                 i.setCreateBy(UserUtils.get(i.getBy()));
                             }
                         }
+                        fileList.addAll(dtos);
                         List<CwWorkClientBaseDTO> list = new ArrayList<>();
                         if (participant.size()>0){
                             participant.forEach(cw->{
@@ -325,7 +347,8 @@ public class ContractInfoService {
                             for (WorkAttachmentDto i : fileDtos) {
                                 i.setCreateBy(UserUtils.get(i.getBy()));
                             }
-                            dto.setContractInfoList(fileDtos);
+                            fileList.addAll(fileDtos);
+                            //dto.setContractInfoList(fileDtos);
                         }
 //                        //估计合同登记id查出归档信息
 //                        ContractFile contractFile = fileMapper.getInfoByConId(dto.getId());
@@ -341,7 +364,7 @@ public class ContractInfoService {
 //                        }
 
                         dto.setCwWorkClientContactDTOList(list);
-                        dto.setContractProperList(dtos);
+                        dto.setContractProperList(fileList);
                     }
                 }
             }
@@ -426,12 +449,31 @@ public class ContractInfoService {
     public String update(ContractInfo info) throws Exception{
         //获取当前登录人信息
         UserDTO userDTO = UserUtils.getCurrentUserDTO();
-        //合同编号生成
+
         ContractInfo contractInfo = new ContractInfo();
         BeanUtils.copyProperties(info, contractInfo);
         contractInfo.setUpdateBy(userDTO.getId());
         contractInfo.setUpdateDate(new Date());
 
+        //合同编号生成
+        String serialNum = "";
+        if (StringUtils.isNotBlank(contractInfo.getContractType()) && StringUtils.isBlank(contractInfo.getContractNo())){
+            if (contractInfo.getContractType().equals("1")){
+                serialNum = serialnumTplService.genSerialNum(userDTO.getCompanyDTO().getId(), ContractInfo.SERIAL_NUMBER1);
+            } else if (contractInfo.getContractType().equals("2")) {
+                serialNum = serialnumTplService.genSerialNum(userDTO.getCompanyDTO().getId(), ContractInfo.SERIAL_NUMBER2);
+            } else if (contractInfo.getContractType().equals("3")) {
+                serialNum = serialnumTplService.genSerialNum(userDTO.getCompanyDTO().getId(), ContractInfo.SERIAL_NUMBER3);
+            } else if (contractInfo.getContractType().equals("4")) {
+                serialNum = serialnumTplService.genSerialNum(userDTO.getCompanyDTO().getId(), ContractInfo.SERIAL_NUMBER4);
+            } else if (contractInfo.getContractType().equals("5")) {
+                serialNum = serialnumTplService.genSerialNum(userDTO.getCompanyDTO().getId(), ContractInfo.SERIAL_NUMBER5);
+            } else if (contractInfo.getContractType().equals("6")) {
+                serialNum = serialnumTplService.genSerialNum(userDTO.getCompanyDTO().getId(), ContractInfo.SERIAL_NUMBER6);
+            }
+            contractInfo.setContractNo(serialNum);
+        }
+
         if (StringUtils.isNotEmpty(contractInfo.getStatus()) &&!contractInfo.getStatus().equals("5")){
             int num = Integer.parseInt(contractInfo.getChangeNum()) + 1;
             contractInfo.setChangeNum(num + "");

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

@@ -50,7 +50,7 @@ public class CwReimbursementTypeController {
     @ApiOperation(value = "列表查询")
     @GetMapping("/bxList")
     public ResponseEntity<List<CwReimbursementTypeInfo>> bxList(CwReimbursementTypeInfo info) {
-        List<CwReimbursementTypeInfo> list = service.bxList(info);
+        List<CwReimbursementTypeInfo> list = service.bxList2(info);
         return ResponseEntity.ok(list);
     }
 
@@ -86,7 +86,7 @@ public class CwReimbursementTypeController {
     @ApiOperation(value = "根据id查询")
     @GetMapping("/findById")
     public ResponseEntity<CwReimbursementTypeInfo> findById(String id) {
-        CwReimbursementTypeInfo info = mapper.selectById(id);
+        CwReimbursementTypeInfo info = service.getById(id);
         return ResponseEntity.ok(info);
     }
 

+ 16 - 4
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/reimbursementApproval/approvalType/domain/CwReimbursementTypeInfo.java

@@ -3,9 +3,11 @@ package com.jeeplus.test.cw.reimbursementApproval.approvalType.domain;
 import com.baomidou.mybatisplus.annotation.*;
 import com.jeeplus.core.domain.TreeEntity;
 import com.jeeplus.core.query.Query;
+import com.jeeplus.sys.service.dto.OfficeDTO;
 import lombok.Data;
 
 import java.util.Date;
+import java.util.List;
 
 /**
  * 报销类型信息列表
@@ -83,11 +85,21 @@ public class CwReimbursementTypeInfo extends TreeEntity<CwReimbursementTypeInfo>
     @TableField(exist = false)
     private Boolean disabled = false;
 
+    @TableField(exist = false)
+    private String like;
+
+    //关联部门
+    @TableField(exist = false)
+    private String relateDepartment;
+
+    //报销部门id
+    @TableField(exist = false)
+    private String officeId;
+
     /**
-     * 业务类型
+     * 关联的officeIdList
      */
-    private String businessType;
+    private List<String> officeIdList;
 
-    @TableField(exist = false)
-    private String like;
+    private List<OfficeDTO> officeDTOList;
 }

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

@@ -1,7 +1,14 @@
 package com.jeeplus.test.cw.reimbursementApproval.approvalType.mapper;
 
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.Constants;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.jeeplus.core.domain.TreeMapper;
+import com.jeeplus.test.cw.projectRecords.domain.CwProjectRecords;
+import com.jeeplus.test.cw.projectRecords.service.dto.CwProjectRecordsDTO;
 import com.jeeplus.test.cw.reimbursementApproval.approvalType.domain.CwReimbursementTypeInfo;
 import org.apache.ibatis.annotations.Param;
 
@@ -14,6 +21,23 @@ import java.util.List;
 public interface CwReimbursementTypeMapper extends BaseMapper<CwReimbursementTypeInfo>, TreeMapper<CwReimbursementTypeInfo> {
 
     /**
+     * 查询数据集合
+     * @param queryWrapper
+     * @return
+     */
+    List<CwReimbursementTypeInfo> findList(@Param(Constants.WRAPPER) Wrapper<CwReimbursementTypeInfo> queryWrapper);
+
+
+    List<CwReimbursementTypeInfo> bxList2(@Param(Constants.WRAPPER) Wrapper<CwReimbursementTypeInfo> queryWrapper,
+                                          @Param("officeId") String officeId);
+
+    /**
+     * 根据id查询详情信息
+     * @param id
+     * @return
+     */
+    CwReimbursementTypeInfo getById(String id);
+    /**
      * 根据name和parentId查询名称是否重复
      * @param name
      * @param parentId
@@ -25,19 +49,24 @@ public interface CwReimbursementTypeMapper extends BaseMapper<CwReimbursementTyp
 
     Integer getLevel(@Param("parentId") String parentId);
 
-    /**
-     * 修改子级业务类型
-     * @param id
-     * @param businessType
-     */
-    void updateChildBusType(@Param("id") String id, @Param("businessType") String businessType);
-
     List<String> getChildId(String id);
 
     /**
      * 获取所有业务类型的数据
-     * @param type
      * @return
      */
-    List<CwReimbursementTypeInfo> getAllList(String type);
+    List<CwReimbursementTypeInfo> getAllList();
+
+    /**
+     * 删除报销类型关联表对应信息
+     * @param id
+     */
+    void deleteReimbursementTypeOfficeInfo(String id);
+
+    /**
+     * 新增报销类型和部门关联信息
+     * @param id
+     * @param OfficeIdList
+     */
+    void saveReimbursementTypeOfficeInfo(@Param("id") String id , @Param("officeIdList") List<String> OfficeIdList);
 }

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

@@ -1,9 +1,100 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.jeeplus.test.cw.reimbursementApproval.approvalType.mapper.CwReimbursementTypeMapper">
-	<update id="updateChildBusType">
-		update cw_reimbursement_type_info set business_type = #{businessType} where parent_id = #{id}
-	</update>
+	<resultMap id="BaseResultMap" type="com.jeeplus.test.cw.reimbursementApproval.approvalType.domain.CwReimbursementTypeInfo">
+		<id property="id" column="id" jdbcType="VARCHAR"/>
+		<result property="createBy" column="create_by" jdbcType="VARCHAR"/>
+		<result property="createDate" column="create_date" jdbcType="TIMESTAMP"/>
+		<result property="updateBy" column="update_by" jdbcType="VARCHAR"/>
+		<result property="updateDate" column="update_date" jdbcType="TIMESTAMP"/>
+		<result property="delFlag" column="del_flag" jdbcType="INTEGER"/>
+
+		<result property="level" column="level" jdbcType="VARCHAR"/>
+		<result property="name" column="name" jdbcType="VARCHAR"/>
+		<result property="sort" column="sort" jdbcType="VARCHAR"/>
+		<result property="parentId" column="parent_id" jdbcType="VARCHAR"/>
+		<result property="parentIds" column="parent_ids" jdbcType="VARCHAR"/>
+		<collection property="officeDTOList" ofType="com.jeeplus.sys.service.dto.OfficeDTO" column="id" select="getOfficeClient"></collection>
+
+	</resultMap>
+
+
+	<sql id="Base_Column_List">
+        a.id,
+        a.create_by,
+        a.create_date,
+        a.update_by,
+        a.update_date,
+        a.del_flag,
+        a.level,
+		a.name,
+		a.sort,
+		a.parent_id,
+		a.parent_ids
+    </sql>
+
+	<sql id="officeColumns">
+    	so.id as "id",
+        so.parent_id as "parent.id",
+        so.parent_ids as "parentIds",
+        so.name as "name",
+        so.sort as "sort",
+        so.area_id as "areaId",
+        so.code as "code",
+        so.type as "type",
+        so.grade as "grade",
+        so.address as "address",
+        so.zip_code as "zipCode",
+        so.master as "master",
+        so.phone as "phone",
+        so.fax as "fax",
+        so.email as "email",
+        so.useable as "useable",
+        so.primary_person as "primaryPerson",
+        so.deputy_person as "deputyPerson",
+		so.create_by as "createBy.id",
+		so.create_date as "createDate",
+		so.update_by as "updateBy.id",
+		so.update_date as "updateDate",
+        so.remarks as "remarks",
+        so.del_flag as "delFlag",
+        so.is_public as "isPublic",
+        so.administrator as "administrator"
+    </sql>
+
+	<select id="getOfficeClient" resultType="com.jeeplus.sys.service.dto.OfficeDTO">
+		select
+		<include refid="officeColumns"></include>
+		from sys_office so
+		left join cw_reimbursement_type_office_info rtoi on rtoi.office_id = so.id and so.del_flag = '0'
+		where rtoi.reimbursement_type_id = #{id}
+	</select>
+
+
+	<select id="findList" resultMap="BaseResultMap">
+		select
+		<include refid="Base_Column_List"></include>
+		,d.`name` as relateDepartment
+		from cw_reimbursement_type_info a
+		LEFT JOIN
+		(SELECT GROUP_CONCAT(c.name) as name,c.office_id,c.reimbursement_type_id FROM
+		(SELECT name,cw.office_id,cw.reimbursement_type_id
+		FROM cw_reimbursement_type_office_info cw
+		LEFT JOIN sys_office so on cw.office_id = so.id) c GROUP BY c.reimbursement_type_id) d
+		on a.id = d.reimbursement_type_id
+		${ew.customSqlSegment}
+	</select>
+
+
+	<select id="getById" resultMap="BaseResultMap">
+		select
+		<include refid="Base_Column_List"></include>
+		from cw_reimbursement_type_info a
+		<where>
+			a.del_flag = 0 and a.id = #{id}
+		</where>
+	</select>
+
 	<select id="checkNameIsExist" resultType="java.lang.Integer">
         SELECT
 			COUNT( 0 )
@@ -37,6 +128,103 @@
 	</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 * from cw_reimbursement_type_info where  del_flag = '0' order by sort asc
+	</select>
+	<select id="bxList2"
+			resultType="com.jeeplus.test.cw.reimbursementApproval.approvalType.domain.CwReimbursementTypeInfo">
+		SELECT
+			t.id,
+			t.create_date,
+			t.create_by,
+			t.update_date,
+			t.update_by,
+			t.del_flag,
+			t.LEVEL,
+			t.NAME,
+			t.sort,
+			t.parent_id,
+			t.parent_ids,
+			t.office_id_list,
+			t.office_d_t_o_list
+			FROM
+				(SELECT
+					id,
+					create_date,
+					a.create_by,
+					a.update_date,
+					a.update_by,
+					a.del_flag,
+					a.LEVEL,
+					a.NAME,
+					a.sort,
+					a.parent_id,
+					a.parent_ids,
+					a.office_id_list,
+					a.office_d_t_o_list
+					FROM
+					cw_reimbursement_type_info a
+					WHERE
+					del_flag = 0
+					and a.parent_id in (SELECT b.reimbursement_type_id FROM cw_reimbursement_type_office_info b WHERE b.office_id = #{officeId})
+				union
+				SELECT
+					id,
+					create_date,
+					a.create_by,
+					a.update_date,
+					a.update_by,
+					a.del_flag,
+					a.LEVEL,
+					a.NAME,
+					a.sort,
+					a.parent_id,
+					a.parent_ids,
+					a.office_id_list,
+					a.office_d_t_o_list
+					FROM
+					cw_reimbursement_type_info a
+					WHERE
+					del_flag = 0
+					and a.parent_id in
+						(SELECT
+							id
+						FROM
+							cw_reimbursement_type_info a
+						WHERE
+							del_flag = 0
+							and a.parent_id in (SELECT b.reimbursement_type_id FROM cw_reimbursement_type_office_info b WHERE b.office_id = #{officeId})
+						)
+				UNION
+				SELECT
+			id,
+			create_date,
+			a.create_by,
+			a.update_date,
+			a.update_by,
+			a.del_flag,
+			a.LEVEL,
+			a.NAME,
+			a.sort,
+			a.parent_id,
+			a.parent_ids,
+			a.office_id_list,
+			a.office_d_t_o_list
+			FROM
+			cw_reimbursement_type_info a
+			WHERE
+			del_flag = 0
+			and a.id in (SELECT b.reimbursement_type_id FROM cw_reimbursement_type_office_info b WHERE b.office_id = #{officeId})
+						) t
+			${ew.customSqlSegment}
 	</select>
+
+	<delete id="deleteReimbursementTypeOfficeInfo">
+		delete from cw_reimbursement_type_office_info where reimbursement_type_id = #{id}
+	</delete>
+
+	<insert id="saveReimbursementTypeOfficeInfo">
+		<foreach collection="officeIdList" item="officeId" separator=";">
+			insert into cw_reimbursement_type_office_info(reimbursement_type_id,office_id) values(#{id},#{officeId})
+		</foreach>
+	</insert>
 </mapper>

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

@@ -35,7 +35,7 @@ public class CwReimbursementTypeForTreeDataService extends TreeService<CwReimbur
     public List<CwReimbursementTypeInfo> treeDataForType(String extId, String type) throws Exception{
         //获取所有的业务类型为1的数据
 //        List<CwReimbursementTypeInfo> allList = typeMapper.getAllList("1");
-        List<CwReimbursementTypeInfo> allList = super.list (new LambdaQueryWrapper<>( (Class <CwReimbursementTypeInfo>) entityClass ).orderByAsc ( CwReimbursementTypeInfo::getSort ));
+        List<CwReimbursementTypeInfo> allList = typeMapper.findList (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 );
@@ -51,7 +51,7 @@ public class CwReimbursementTypeForTreeDataService extends TreeService<CwReimbur
      */
     public List<CwReimbursementTypeInfo> treeDataForType1(String extId, String type) throws Exception{
         //获取所有的业务类型为1的数据
-        List<CwReimbursementTypeInfo> allList = typeMapper.getAllList("1");
+        List<CwReimbursementTypeInfo> allList = typeMapper.getAllList();
 //        List<CwReimbursementTypeInfo> allList = super.list (new LambdaQueryWrapper<>( (Class <CwReimbursementTypeInfo>) entityClass ).orderByAsc ( CwReimbursementTypeInfo::getSort ));
         CwReimbursementTypeInfo root = entityClass.getConstructor ( ).newInstance ( );
         root.setId ( TreeDTO.getRootId () );
@@ -68,7 +68,7 @@ public class CwReimbursementTypeForTreeDataService extends TreeService<CwReimbur
      */
     public List<CwReimbursementTypeInfo> summaryTreeData(String extId, String type) throws Exception{
         //获取所有的业务类型为1的数据
-        List<CwReimbursementTypeInfo> allList = typeMapper.getAllList("2");
+        List<CwReimbursementTypeInfo> allList = typeMapper.getAllList();
         CwReimbursementTypeInfo root = entityClass.getConstructor ( ).newInstance ( );
         root.setId ( TreeDTO.getRootId () );
         List <CwReimbursementTypeInfo> rootTree = this.formatListToTreeForType ( root, allList, extId, type );
@@ -84,7 +84,7 @@ public class CwReimbursementTypeForTreeDataService extends TreeService<CwReimbur
      */
     public List<CwReimbursementTypeInfo> treeDataForType2(String extId, String type) throws Exception{
         //获取所有的业务类型为1的数据
-        List<CwReimbursementTypeInfo> allList = typeMapper.getAllList("2");
+        List<CwReimbursementTypeInfo> allList = typeMapper.getAllList();
 //        List<CwReimbursementTypeInfo> allList = super.list (new LambdaQueryWrapper<>( (Class <CwReimbursementTypeInfo>) entityClass ).orderByAsc ( CwReimbursementTypeInfo::getSort ));
         CwReimbursementTypeInfo root = entityClass.getConstructor ( ).newInstance ( );
         root.setId ( TreeDTO.getRootId () );

+ 56 - 14
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/reimbursementApproval/approvalType/service/CwReimbursementTypeService.java

@@ -3,14 +3,21 @@ package com.jeeplus.test.cw.reimbursementApproval.approvalType.service;
 import cn.hutool.core.util.ObjectUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.jeeplus.core.domain.BaseEntity;
+import com.jeeplus.flowable.common.handler.CollectionUtils;
+import com.jeeplus.sys.service.dto.OfficeDTO;
 import com.jeeplus.sys.service.dto.UserDTO;
 import com.jeeplus.sys.utils.StringUtils;
 import com.jeeplus.sys.utils.UserUtils;
+import com.jeeplus.test.cw.projectRecords.service.dto.CwProjectClientContactDTO;
+import com.jeeplus.test.cw.projectRecords.service.dto.CwProjectRecordsDTO;
 import com.jeeplus.test.cw.reimbursementApproval.approvalType.domain.CwReimbursementTypeInfo;
 import com.jeeplus.test.cw.reimbursementApproval.approvalType.mapper.CwReimbursementTypeMapper;
+import com.jeeplus.test.cw.workClientInfo.domain.CwWorkClientContact;
+import org.apache.commons.compress.utils.Lists;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
+import java.util.Collections;
 import java.util.Date;
 import java.util.List;
 import java.util.UUID;
@@ -25,6 +32,25 @@ public class CwReimbursementTypeService {
     @Resource
     private CwReimbursementTypeMapper mapper;
 
+    public List<CwReimbursementTypeInfo> bxList2(CwReimbursementTypeInfo info) {
+        LambdaQueryWrapper<CwReimbursementTypeInfo> wrapper = new LambdaQueryWrapper<>();
+        if (StringUtils.isNotEmpty(info.getName())) {
+            wrapper.like(CwReimbursementTypeInfo::getName, info.getName());
+        }
+        if (ObjectUtil.isNotEmpty(info)) {
+            if (StringUtils.isNotBlank(info.getLike())){
+                wrapper.likeRight(CwReimbursementTypeInfo::getSort,info.getLike());
+            }
+        }
+        if (info.getSort() != null) {
+            wrapper.like(CwReimbursementTypeInfo::getSort, info.getSort());
+        }
+
+        wrapper.eq(BaseEntity::getDelFlag, 0);
+        wrapper.orderByAsc(CwReimbursementTypeInfo::getSort);
+        return mapper.bxList2(wrapper,info.getOfficeId());
+    }
+
     public List<CwReimbursementTypeInfo> list(CwReimbursementTypeInfo info) {
         LambdaQueryWrapper<CwReimbursementTypeInfo> wrapper = new LambdaQueryWrapper<>();
         if (StringUtils.isNotEmpty(info.getName())) {
@@ -37,7 +63,25 @@ public class CwReimbursementTypeService {
 
         wrapper.eq(BaseEntity::getDelFlag, 0);
         wrapper.orderByAsc(CwReimbursementTypeInfo::getSort);
-        return mapper.selectList(wrapper);
+        return mapper.findList(wrapper);
+    }
+
+
+    /**
+     * 根据id查询项目详情
+     * @param id
+     * @return
+     */
+    public CwReimbursementTypeInfo getById(String id) {
+        CwReimbursementTypeInfo info = mapper.getById(id);
+        if(null != info.getOfficeDTOList() && info.getOfficeDTOList().size()>0){
+            List<String> officeIdList = Lists.newArrayList();
+            for (OfficeDTO office : info.getOfficeDTOList()) {
+                officeIdList.add(office.getId());
+            }
+            info.setOfficeIdList(officeIdList);
+        }
+        return info;
     }
 
     public List<CwReimbursementTypeInfo> bxList(CwReimbursementTypeInfo info) {
@@ -53,7 +97,6 @@ public class CwReimbursementTypeService {
         if (info.getSort() != null) {
             wrapper.like(CwReimbursementTypeInfo::getSort, info.getSort());
         }
-        wrapper.eq(CwReimbursementTypeInfo::getBusinessType, "1");
 
         wrapper.eq(BaseEntity::getDelFlag, 0);
         wrapper.orderByAsc(CwReimbursementTypeInfo::getSort);
@@ -68,7 +111,6 @@ public class CwReimbursementTypeService {
         if (info.getSort() != null) {
             wrapper.like(CwReimbursementTypeInfo::getSort, info.getSort());
         }
-        wrapper.eq(CwReimbursementTypeInfo::getBusinessType, "2");
 
         wrapper.eq(BaseEntity::getDelFlag, 0);
         wrapper.orderByAsc(CwReimbursementTypeInfo::getSort);
@@ -124,18 +166,18 @@ public class CwReimbursementTypeService {
         UserDTO userDto = UserUtils.getCurrentUserDTO();
         info.setUpdateBy(userDto.getId());
         info.setUpdateDate(new Date());
-        //父级
-        if (info.getParentId().equals("0")){
-            //修改所有子集的业务类型
-            List<String> childId = mapper.getChildId(info.getId());
-            childId.forEach(chidId->{
-                //修改子级的子级
-                mapper.updateChildBusType(chidId,info.getBusinessType());
-            });
-            //修改子级
-            mapper.updateChildBusType(info.getId(),info.getBusinessType());
+        //对关联的公司id进行处理
+        if (null != info.getOfficeIdList() && info.getOfficeIdList().size()>0) {
+            //首先删除原有关联信息
+            mapper.deleteReimbursementTypeOfficeInfo(info.getId());
+            //将新的关联信息进行保存
+            mapper.saveReimbursementTypeOfficeInfo(info.getId(),info.getOfficeIdList());
+//            info.setOfficeIdList(null);
+        } else if (null != info.getOfficeIdList() && info.getOfficeIdList().isEmpty()){
+            //首先删除原有关联信息
+            mapper.deleteReimbursementTypeOfficeInfo(info.getId());
         }
-
+        info.setOfficeIdList(null);
         mapper.updateById(info);
         return "操作完成";
     }

+ 14 - 2
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/materialManagement/wareHouse/controller/WareHouseController.java

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

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

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

@@ -34,32 +34,24 @@
 			a.id,
 			a.create_by,
 			a.create_date,
-			c.ware_house_number,
 			a.ware_house_type,
 			a.trade_name,
-			a.trade_number,
-			b.company,
-			c.ware_house_date,
-			so.name as wareHouseManOfficeName,
-			sy.name as wareHouseManName,
-			d.name as wareHouseTypeName,
-			b.trade_number as allNumber,
-			g.collect_number as borrowNumber
+			a.company,
+			c.name as wareHouseTypeName,
+			sum(trade_number) as allNumber,
+			b.collect_number as borrowNumber,
+			IFNULL((sum(trade_number) - collect_number),sum(trade_number)) as tradeNumber
 		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
-
+			material_management_warehouse_detailed a
 			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
+			(select sum(collect_number) as 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 GROUP BY e.goods_name) b
+			on a.trade_name = b.goods_name and b.status = 5
 
-			left join cw_reimbursement_type_info d on a.ware_house_type = d.id
+			left join cw_reimbursement_type_info c on a.ware_house_type = c.id
 			${ew.customSqlSegment}
-		ORDER BY a.update_date DESC
+			GROUP BY a.trade_name
+			ORDER BY a.update_date DESC
 	</select>
     <select id="findRequestId" resultType="java.lang.String">
 		select id from material_management_pruchase_request_basics where purchase_no = #{purchaseNo} and del_flag = 0
@@ -67,36 +59,40 @@
 	<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,
+			a.id as wareHouseId,
+			a.ware_house_number,
+			a.ware_house_name,
+			a.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
+			b.trade_name
 		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,status,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 and g.status = 5
+			material_management_warehouse_basics a
+			LEFT JOIN
+			material_management_warehouse_detailed b on a.id = b.basic_id and b.del_flag = 0
 
-			left join sys_user sy on sy.id = d.handled_by
+			left join sys_user sy on sy.id = a.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>
+	<select id="collectHistoryList"
+			resultType="com.jeeplus.test.materialManagement.wareHouse.service.dto.WareHouseDto">
+		SELECT
+			a.id as collectId,
+			a.collect_no,
+			sy.name as collectHandleBy,
+			so.name as collectHandleByOff,
+			a.collect_date,
+			b.goods_name
+		FROM
+			material_management_collect_basics a
+			LEFT JOIN
+			material_management_collect_detailed b on a.id = b.basic_id and b.del_flag = 0
+
+			left join sys_user sy on sy.id = a.handled_by
+			left join sys_office so on sy.office_id = so.id
 
 			${ew.customSqlSegment}
 		ORDER BY a.update_date DESC

+ 116 - 102
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/materialManagement/wareHouse/service/WareHouseBasicService.java

@@ -76,12 +76,26 @@ public class WareHouseBasicService {
 
         queryWrapper.eq("a.del_flag", "0");
         if (StringUtils.isNotEmpty(dto.getTradeName())) {
-            queryWrapper.like("a.trade_name", dto.getTradeName());
+            queryWrapper.like("b.trade_name", dto.getTradeName());
         }
 
         return basicMapper.wareHouseHistoryList(page, queryWrapper);
     }
 
+    /**
+     * 列表查询
+     */
+    public IPage<WareHouseDto> collectHistoryList(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("b.goods_name", dto.getTradeName());
+        }
+
+        return basicMapper.collectHistoryList(page, queryWrapper);
+    }
+
     public String remove(String id) {
         // 删除基础信息表
         basicMapper.deleteById(id);
@@ -104,10 +118,10 @@ public class WareHouseBasicService {
         wrapper.eq(WorkAttachment::getAttachmentId, id);
         ossServiceMapper.delete(wrapper);
         //删除入库汇总表信息
-        List<WareHouseSummary> summaryList = summaryMapper.getInfoByBasicId(id);
-        summaryList.forEach(sum->{
-            summaryMapper.deleteById(sum.getId());
-        });
+//        List<WareHouseSummary> summaryList = summaryMapper.getInfoByBasicId(id);
+//        summaryList.forEach(sum->{
+//            summaryMapper.deleteById(sum.getId());
+//        });
         return "操作成功";
     }
 
@@ -207,7 +221,7 @@ public class WareHouseBasicService {
                 idList.forEach(id->{
                     detailedMapper.deleteById(id);
                     //汇总表中的数据也删除掉
-                    summaryMapper.deleteByDetailedId(id);
+//                    summaryMapper.deleteByDetailedId(id);
                 });
             }
 
@@ -235,35 +249,35 @@ public class WareHouseBasicService {
                     }
                     //将入库详情商品信息汇总处理
                     //根据商品名称及入库类型查是否有相关数据
-                    WareHouseSummary summary = summaryMapper.getInfoByTradeName(detailInfo.getTradeName(),detailInfo.getWareHouseType());;
-                    if (null != summary) {
-                        if (summary.getTradeName().equals(detailInfo.getTradeName()) &&
-                                summary.getWareHouseType().equals(detailInfo.getWareHouseType())) {
-                            String num = Double.valueOf(detailInfo.getTradeNumber())
-                                    + Double.valueOf(summary.getTradeNumber()) + "";
-                            summary.setTradeNumber(num);
-                            summary.setWareHouseType(detailInfo.getWareHouseType());
-                            summary.setUpdateBy(userDTO.getId());
-                            summary.setUpdateDate(new Date());
-                            summary.setDetailedId(detailInfo.getId());
-                            summaryMapper.updateById(summary);
-                        }
-                    } else {
-                        summary = new WareHouseSummary();
-                        // 生成id
-                        String summaryId = UUID.randomUUID().toString().replace("-", "");
-                        summary.setDetailedId(detailInfo.getId());
-                        summary.setId(summaryId);
-                        summary.setCreateBy(userDTO.getId());
-                        summary.setCreateDate(new Date());
-                        summary.setUpdateBy(userDTO.getId());
-                        summary.setUpdateDate(new Date());
-                        summary.setDelFlag(0);
-                        summary.setWareHouseType(detailInfo.getWareHouseType());
-                        summary.setTradeName(detailInfo.getTradeName());
-                        summary.setTradeNumber(detailInfo.getTradeNumber());
-                        summaryMapper.insert(summary);
-                    }
+//                    WareHouseSummary summary = summaryMapper.getInfoByTradeName(detailInfo.getTradeName(),detailInfo.getWareHouseType());;
+//                    if (null != summary) {
+//                        if (summary.getTradeName().equals(detailInfo.getTradeName()) &&
+//                                summary.getWareHouseType().equals(detailInfo.getWareHouseType())) {
+//                            String num = Double.valueOf(detailInfo.getTradeNumber())
+//                                    + Double.valueOf(summary.getTradeNumber()) + "";
+//                            summary.setTradeNumber(num);
+//                            summary.setWareHouseType(detailInfo.getWareHouseType());
+//                            summary.setUpdateBy(userDTO.getId());
+//                            summary.setUpdateDate(new Date());
+//                            summary.setDetailedId(detailInfo.getId());
+//                            summaryMapper.updateById(summary);
+//                        }
+//                    } else {
+//                        summary = new WareHouseSummary();
+//                        // 生成id
+//                        String summaryId = UUID.randomUUID().toString().replace("-", "");
+//                        summary.setDetailedId(detailInfo.getId());
+//                        summary.setId(summaryId);
+//                        summary.setCreateBy(userDTO.getId());
+//                        summary.setCreateDate(new Date());
+//                        summary.setUpdateBy(userDTO.getId());
+//                        summary.setUpdateDate(new Date());
+//                        summary.setDelFlag(0);
+//                        summary.setWareHouseType(detailInfo.getWareHouseType());
+//                        summary.setTradeName(detailInfo.getTradeName());
+//                        summary.setTradeNumber(detailInfo.getTradeNumber());
+//                        summaryMapper.insert(summary);
+//                    }
                 } else {
                     detailInfo.setWareHouseMan(detailInfo.getWareHouseManId());
                     detailInfo.setUpdateBy(userDTO.getId());
@@ -280,35 +294,35 @@ public class WareHouseBasicService {
                     }
                     //将入库详情商品信息汇总处理
                     //根据商品名称及入库类型查是否有相关数据
-                    WareHouseSummary summary = summaryMapper.getInfoByTradeName(detailInfo.getTradeName(),detailInfo.getWareHouseType());;
-                    if (null != summary) {
-                        if (wareHouseDetailed.getTradeNumber().equals(detailInfo.getTradeNumber()) &&
-                                !wareHouseDetailed.getTradeName().equals(detailInfo.getTradeName())) {
-                            String num = Double.valueOf(detailInfo.getTradeNumber())
-                                    + Double.valueOf(summary.getTradeNumber()) + "";
-                            summary.setTradeNumber(num);
-                            summary.setUpdateBy(userDTO.getId());
-                            summary.setWareHouseType(detailInfo.getWareHouseType());
-                            summary.setUpdateDate(new Date());
-                            summary.setDetailedId(detailInfo.getId());
-                            summaryMapper.updateById(summary);
-                        }
-                    } else {
-                        summary = new WareHouseSummary();
-                        // 生成id
-                        String summaryId = UUID.randomUUID().toString().replace("-", "");
-                        summary.setDetailedId(detailInfo.getId());
-                        summary.setId(summaryId);
-                        summary.setCreateBy(userDTO.getId());
-                        summary.setCreateDate(new Date());
-                        summary.setUpdateBy(userDTO.getId());
-                        summary.setUpdateDate(new Date());
-                        summary.setDelFlag(0);
-                        summary.setWareHouseType(detailInfo.getWareHouseType());
-                        summary.setTradeName(detailInfo.getTradeName());
-                        summary.setTradeNumber(detailInfo.getTradeNumber());
-                        summaryMapper.insert(summary);
-                    }
+//                    WareHouseSummary summary = summaryMapper.getInfoByTradeName(detailInfo.getTradeName(),detailInfo.getWareHouseType());;
+//                    if (null != summary) {
+//                        if (wareHouseDetailed.getTradeNumber().equals(detailInfo.getTradeNumber()) &&
+//                                !wareHouseDetailed.getTradeName().equals(detailInfo.getTradeName())) {
+//                            String num = Double.valueOf(detailInfo.getTradeNumber())
+//                                    + Double.valueOf(summary.getTradeNumber()) + "";
+//                            summary.setTradeNumber(num);
+//                            summary.setUpdateBy(userDTO.getId());
+//                            summary.setWareHouseType(detailInfo.getWareHouseType());
+//                            summary.setUpdateDate(new Date());
+//                            summary.setDetailedId(detailInfo.getId());
+//                            summaryMapper.updateById(summary);
+//                        }
+//                    } else {
+//                        summary = new WareHouseSummary();
+//                        // 生成id
+//                        String summaryId = UUID.randomUUID().toString().replace("-", "");
+//                        summary.setDetailedId(detailInfo.getId());
+//                        summary.setId(summaryId);
+//                        summary.setCreateBy(userDTO.getId());
+//                        summary.setCreateDate(new Date());
+//                        summary.setUpdateBy(userDTO.getId());
+//                        summary.setUpdateDate(new Date());
+//                        summary.setDelFlag(0);
+//                        summary.setWareHouseType(detailInfo.getWareHouseType());
+//                        summary.setTradeName(detailInfo.getTradeName());
+//                        summary.setTradeNumber(detailInfo.getTradeNumber());
+//                        summaryMapper.insert(summary);
+//                    }
                 }
             }
         }
@@ -361,28 +375,28 @@ public class WareHouseBasicService {
                 }
                 //将入库详情商品信息汇总处理
                 //根据商品名称及入库类型查是否有相关数据
-                WareHouseSummary summary = summaryMapper.getInfoByTradeName(detailed.getTradeName(),detailed.getWareHouseType());;
-                if (null != summary) {
-                    String num = Double.valueOf(detailed.getTradeNumber())
-                            + Double.valueOf(summary.getTradeNumber()) + "";
-                    summary.setTradeNumber(num);
-                    summaryMapper.updateById(summary);
-                } else {
-                    summary = new WareHouseSummary();
-                    // 生成id
-                    String summaryId = UUID.randomUUID().toString().replace("-", "");
-                    summary.setDetailedId(detailed.getId());
-                    summary.setId(summaryId);
-                    summary.setCreateBy(userDTO.getId());
-                    summary.setCreateDate(new Date());
-                    summary.setUpdateBy(userDTO.getId());
-                    summary.setUpdateDate(new Date());
-                    summary.setDelFlag(0);
-                    summary.setWareHouseType(detailed.getWareHouseType());
-                    summary.setTradeName(detailed.getTradeName());
-                    summary.setTradeNumber(detailed.getTradeNumber());
-                    summaryMapper.insert(summary);
-                }
+//                WareHouseSummary summary = summaryMapper.getInfoByTradeName(detailed.getTradeName(),detailed.getWareHouseType());;
+//                if (null != summary) {
+//                    String num = Double.valueOf(detailed.getTradeNumber())
+//                            + Double.valueOf(summary.getTradeNumber()) + "";
+//                    summary.setTradeNumber(num);
+//                    summaryMapper.updateById(summary);
+//                } else {
+//                    summary = new WareHouseSummary();
+//                    // 生成id
+//                    String summaryId = UUID.randomUUID().toString().replace("-", "");
+//                    summary.setDetailedId(detailed.getId());
+//                    summary.setId(summaryId);
+//                    summary.setCreateBy(userDTO.getId());
+//                    summary.setCreateDate(new Date());
+//                    summary.setUpdateBy(userDTO.getId());
+//                    summary.setUpdateDate(new Date());
+//                    summary.setDelFlag(0);
+//                    summary.setWareHouseType(detailed.getWareHouseType());
+//                    summary.setTradeName(detailed.getTradeName());
+//                    summary.setTradeNumber(detailed.getTradeNumber());
+//                    summaryMapper.insert(summary);
+//                }
             }
         }
         // 保存附件列表信息
@@ -435,30 +449,30 @@ 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());
-        }
+//        if (StringUtils.isNotEmpty(dto.getWareHouseNumber())) {
+//            queryWrapper.like("c.ware_house_number", dto.getWareHouseNumber());
+//        }
         if (StringUtils.isNotEmpty(dto.getTradeName())) {
-            queryWrapper.like("b.trade_name", dto.getTradeName());
-        }
-        if (StringUtils.isNotEmpty(dto.getWareHouseMan())) {
-            queryWrapper.like("b.ware_house_man", dto.getWareHouseMan());
-        }
-        if (StringUtils.isNotEmpty(dto.getWareHouseManOffice())) {
-            queryWrapper.like("so.id", dto.getWareHouseManOffice());
+            queryWrapper.like("a.trade_name", dto.getTradeName());
         }
+//        if (StringUtils.isNotEmpty(dto.getWareHouseMan())) {
+//            queryWrapper.like("a.ware_house_man", dto.getWareHouseMan());
+//        }
+//        if (StringUtils.isNotEmpty(dto.getWareHouseManOffice())) {
+//            queryWrapper.like("so.id", dto.getWareHouseManOffice());
+//        }
 
         //入库类型
         if (StringUtils.isNotEmpty(dto.getWareHouseType())) {
-            queryWrapper.eq("d.name", dto.getWareHouseType());
+            queryWrapper.eq("c.name", dto.getWareHouseType());
         }
 
         // 入库时间
-        String[] contractDates = dto.getWareHouseDates();
-        if (contractDates != null) {
-
-            queryWrapper.between("c.ware_house_date", contractDates[0], contractDates[1]);
-        }
+//        String[] contractDates = dto.getWareHouseDates();
+//        if (contractDates != null) {
+//
+//            queryWrapper.between("c.ware_house_date", contractDates[0], contractDates[1]);
+//        }
 
         return basicMapper.summaryList(page, queryWrapper);
     }

+ 0 - 5
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/zs/zsReimbursement/approvalType/domain/ZsReimbursementTypeInfo.java

@@ -83,11 +83,6 @@ public class ZsReimbursementTypeInfo extends TreeEntity<ZsReimbursementTypeInfo>
     @TableField(exist = false)
     private Boolean disabled = false;
 
-    /**
-     * 业务类型
-     */
-    private String businessType;
-
     @TableField(exist = false)
     private String like;
 }

+ 0 - 7
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/zs/zsReimbursement/approvalType/mapper/ZsReimbursementTypeMapper.java

@@ -26,13 +26,6 @@ public interface ZsReimbursementTypeMapper extends BaseMapper<ZsReimbursementTyp
 
     Integer getLevel(@Param("parentId") String parentId);
 
-    /**
-     * 修改子级业务类型
-     * @param id
-     * @param businessType
-     */
-    void updateChildBusType(@Param("id") String id, @Param("businessType") String businessType);
-
     List<String> getChildId(String id);
 
     /**

+ 1 - 4
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/zs/zsReimbursement/approvalType/mapper/xml/ZsReimbursementTypeMapper.xml

@@ -1,9 +1,6 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.jeeplus.test.zs.zsReimbursement.approvalType.mapper.ZsReimbursementTypeMapper">
-	<update id="updateChildBusType">
-		update cw_reimbursement_type_info set business_type = #{businessType} where parent_id = #{id}
-	</update>
 	<select id="checkNameIsExist" resultType="java.lang.Integer">
         SELECT
 			COUNT( 0 )
@@ -37,6 +34,6 @@
 	</select>
 	<select id="getAllList"
 			resultType="com.jeeplus.test.zs.zsReimbursement.approvalType.domain.ZsReimbursementTypeInfo">
-		select * from cw_reimbursement_type_info where business_type = #{type} and del_flag = '0' order by sort asc
+		select * from cw_reimbursement_type_info where del_flag = '0' order by sort asc
 	</select>
 </mapper>

+ 0 - 13
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/zs/zsReimbursement/approvalType/service/ZsReimbursementTypeService.java

@@ -53,7 +53,6 @@ public class ZsReimbursementTypeService {
         if (info.getSort() != null) {
             wrapper.like(ZsReimbursementTypeInfo::getSort, info.getSort());
         }
-        wrapper.eq(ZsReimbursementTypeInfo::getBusinessType, "1");
 
         wrapper.eq(BaseEntity::getDelFlag, 0);
         wrapper.orderByAsc(ZsReimbursementTypeInfo::getSort);
@@ -68,7 +67,6 @@ public class ZsReimbursementTypeService {
         if (info.getSort() != null) {
             wrapper.like(ZsReimbursementTypeInfo::getSort, info.getSort());
         }
-        wrapper.eq(ZsReimbursementTypeInfo::getBusinessType, "2");
 
         wrapper.eq(BaseEntity::getDelFlag, 0);
         wrapper.orderByAsc(ZsReimbursementTypeInfo::getSort);
@@ -124,17 +122,6 @@ public class ZsReimbursementTypeService {
         UserDTO userDto = UserUtils.getCurrentUserDTO();
         info.setUpdateBy(userDto.getId());
         info.setUpdateDate(new Date());
-        //父级
-        if (info.getParentId().equals("0")){
-            //修改所有子集的业务类型
-            List<String> childId = mapper.getChildId(info.getId());
-            childId.forEach(chidId->{
-                //修改子级的子级
-                mapper.updateChildBusType(chidId,info.getBusinessType());
-            });
-            //修改子级
-            mapper.updateChildBusType(info.getId(),info.getBusinessType());
-        }
 
         mapper.updateById(info);
         return "操作完成";

+ 8 - 0
jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/sys/controller/OfficeController.java

@@ -132,6 +132,14 @@ public class OfficeController {
         return ResponseEntity.ok (result);
     }
 
+    @ApiLog("获取二级节点数据信息")
+
+    @GetMapping("getSecondLevelData")
+    public ResponseEntity getSecondLevelData() {
+        List<OfficeDTO> list = officeService.getSecondLevelData ();
+        return ResponseEntity.ok (list);
+    }
+
     @ApiLog("查询全部集团")
     @GetMapping("get_all_company")
     public ResponseEntity<List<OfficeDTO>> getAllCompany() {

+ 6 - 0
jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/sys/mapper/OfficeMapper.java

@@ -51,4 +51,10 @@ public interface OfficeMapper extends TreeMapper<Office> {
 
     List<String> getOfficeIdByNames(List<String> nameList);
 
+    /**
+     * 获取二级节点数据信息
+     * @return
+     */
+    List<OfficeDTO> getSecondLevelData();
+
 }

+ 9 - 0
jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/sys/mapper/xml/OfficeMapper.xml

@@ -130,4 +130,13 @@
             </foreach>
         </where>
     </select>
+
+    <select id="getSecondLevelData" resultType="com.jeeplus.sys.service.dto.OfficeDTO">
+        select
+        <include refid="officeColumns"/>
+        from sys_office a
+        <where>
+            a.parent_id in (select id from sys_office where parent_id = 0)
+        </where>
+    </select>
 </mapper>

+ 8 - 0
jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/sys/service/OfficeService.java

@@ -375,6 +375,14 @@ public class OfficeService extends TreeService<OfficeMapper, Office> {
        return officeMapper.getOfficeIdByNames(nameList);
     }
 
+    /**
+     * 获取二级节点数据信息
+     * @return
+     */
+    public List<OfficeDTO> getSecondLevelData(){
+        return officeMapper.getSecondLevelData();
+    }
+
     public List<OfficeDTO> getAllCompany() {
         Page<OfficeDTO> page = new Page<>();
         page.setSize(-1);