yusm 7 月之前
父节点
当前提交
58e66d64c0

+ 27 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/BusinessOpportunityController.java

@@ -28,6 +28,7 @@ import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.text.SimpleDateFormat;
 import java.util.*;
+import java.util.stream.Collectors;
 
 /**
  * <p>
@@ -318,6 +319,32 @@ public class BusinessOpportunityController {
         msg.setData(r);
         return msg;
 
+    }
+
+    @RequestMapping("getAllByStage")
+    public Object getAllByStage(HttpServletRequest request) {
+        User user = userMapper.selectById(request.getHeader("Token"));
+        List<BusinessOpportunity> list = new ArrayList<>();
+        boolean isAll = sysFunctionService.hasPriviledge(user.getRoleId(), "查看全部商机");
+        boolean isNotAll = sysFunctionService.hasPriviledge(user.getRoleId(), "查看负责部门商机");
+        if (isAll) {
+            list = boMapper.getAllList(user.getCompanyId());
+        } else if (isNotAll) {
+            list = boMapper.getAllList1(user);
+        } else {
+            list = boMapper.getAllList2(user);
+        }
+        HttpRespMsg msg = new HttpRespMsg();
+        List<Stage> stageList = stageService.list(new QueryWrapper<Stage>().eq("company_id", user.getCompanyId()));
+        HashMap<String, Object> map = new HashMap<>();
+        for (Stage stage : stageList) {
+            List<BusinessOpportunity> collect = list.stream().filter(l -> l.getStageId() != null && l.getStageId().equals(stage.getId())).collect(Collectors.toList());
+            HashMap<String, Object> hashMap = new HashMap<>();
+            map.put(stage.getName(),collect);
+        }
+        msg.setData(map);
+        return msg;
+
     }
     @RequestMapping("deleterList")
     public HttpRespMsg deleterList(BusinessOpportunity bo, HttpServletRequest request) {

文件差异内容过多而无法显示
+ 3 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/WeiXinCorpController.java


+ 3 - 1
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/SysDict.java

@@ -59,7 +59,7 @@ public class SysDict extends Model<SysDict> {
         return this.id;
     }
 
-    public static final String[] TYPE_LIST=new String[]{"ClueSources","CustomLevel","CustomIndustry","CustomSources","BusinessStage","ProductType","ProductUnit","OrderType"};
+    public static final String[] TYPE_LIST=new String[]{"ClueSources","CustomLevel","CustomIndustry","CustomSources","BusinessStage","ProductType","ProductUnit","OrderType","ContractType"};
 
     public static List<Map<String,Object>> getSysDictList(){
         List<Map<String,Object>> itemList=new ArrayList<>();
@@ -83,6 +83,8 @@ public class SysDict extends Model<SysDict> {
                     break;
                 case "OrderType":map.put("name","订单类型");
                     break;
+                case "ContractType":map.put("name","合同类型");
+                    break;
             }
             itemList.add(map);
         }

+ 2 - 2
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/ContractDocumentServiceImpl.java

@@ -63,7 +63,7 @@ public class ContractDocumentServiceImpl extends ServiceImpl<ContractDocumentMap
     public HttpRespMsg fileUpload(HttpServletRequest request, @RequestParam Integer ContractId, @RequestParam(required=false) Integer folderId, @RequestParam("file") MultipartFile[] files) {
         HttpRespMsg msg = new HttpRespMsg();
         User user = userMapper.selectById(request.getHeader("token"));
-        List<SysRichFunction> functionContractList = sysFunctionMapper.getRoleFunctions(user.getRoleId(), "管理全部合同");
+        List<SysRichFunction> functionContractList = sysFunctionMapper.getRoleFunctions(user.getRoleId(), "查看全部合同");
         if(functionContractList.size() <= 0){
             msg.setError(MessageUtils.message("access.operationError"));
             return msg;
@@ -205,7 +205,7 @@ public class ContractDocumentServiceImpl extends ServiceImpl<ContractDocumentMap
     public HttpRespMsg fileDelete(HttpServletRequest request, ContractFileDelVO contractFileDelVo) {
         HttpRespMsg msg = new HttpRespMsg();
         User user = userMapper.selectById(request.getHeader("Token"));
-        List<SysRichFunction> functionContractList = sysFunctionMapper.getRoleFunctions(user.getRoleId(), "管理全部合同");
+        List<SysRichFunction> functionContractList = sysFunctionMapper.getRoleFunctions(user.getRoleId(), "查看全部合同");
         if(functionContractList.size() <= 0){
             msg.setError(MessageUtils.message("access.deleteError"));
             return msg;

+ 7 - 10
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/ContractServiceImpl.java

@@ -80,8 +80,6 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract> i
     private ContractLogMapper contractLogMapper;
     @Resource
     private InformationMapper informationMapper;
-    @Resource
-    private CompanyDingdingMapper companyDingdingMapper;
     @Value(value = "${upload.path}")
     private String path;
     @Autowired
@@ -111,7 +109,6 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract> i
             String token = request.getHeader("token");
             User user = userMapper.selectById(token);
             WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", user.getCompanyId()));
-            CompanyDingding dingding = companyDingdingMapper.selectOne(new LambdaQueryWrapper<CompanyDingding>().eq(CompanyDingding::getCompanyId, user.getCompanyId()));
             List<SysRichFunction> functionContractList = sysFunctionMapper.getRoleFunctions(user.getRoleId(), "查看全部合同");
             if(functionContractList.size() <= 0){
                 httpRespMsg.setError(MessageUtils.message("access.viewError"));
@@ -193,14 +190,17 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract> i
                 contractPageVO.setPayment(contract.getPayment());
                 contractPageVO.setNextPaymentDate(contract.getNextPaymentDate());
                 contractPageVO.setNextPaymentAmount(contract.getNextPaymentAmount());
+                contractPageVO.setPlate1(contract.getPlate1());
+                contractPageVO.setPlate2(contract.getPlate2());
+                contractPageVO.setPlate3(contract.getPlate3());
+                contractPageVO.setPlate4(contract.getPlate4());
+                contractPageVO.setPlate5(contract.getPlate5());
                 if (contract.getStatus().equals(2)){
                     for (Map<String, Object> contractLog : contractLogs) {
                         if (contractLog.get("contractId").toString().equals(contract.getId().toString())){
                             String msg = "";
                             if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
                                 msg = "$userName=" + contractLog.get("operateCorpWxId") + "$" + contractLog.get("msg");
-                            }else if(dingding!=null&&dingding.getContactNeedTranslate()==1){
-                                msg = "$userName=" + contractLog.get("operateName") + "$" + contractLog.get("msg");
                             }else {
                                 msg = contractLog.get("operateName") + "" + contractLog.get("msg");
                             }
@@ -256,7 +256,6 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract> i
             return httpRespMsg;
         }
         WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", user.getCompanyId()));
-        CompanyDingding dingding = companyDingdingMapper.selectOne(new QueryWrapper<CompanyDingding>().eq("company_id", user.getCompanyId()));
         HttpRespMsg contractPage = getContractPage(request, null, null, number, name, typeName, status, startDate, endDate, paymentStartDate, paymentEndDate, secTypeId,customerOrg,finishStatus);
         HashMap<String, Object> resultDate = (HashMap<String, Object>) contractPage.data;
         List<ContractPageVO> data = (List<ContractPageVO>)resultDate.get("data");
@@ -291,8 +290,6 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract> i
             item.add(contract.getEndDate()==null?"":contract.getEndDate()+"");
             if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
                 contract.setCreatorName("$userName=" + contract.getCreatorWxCorpId() + "$");
-            }else if(dingding!=null&&dingding.getContactNeedTranslate()==1){
-                contract.setCreatorName("$userName=" + contract.getCreatorName() + "$");
             }else {
                 contract.setCreatorName(contract.getCreatorName());
             }
@@ -426,7 +423,7 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract> i
     public HttpRespMsg editContract(HttpServletRequest request, Contract contract, ContractCustom custom, String paymentListStr) {
         HttpRespMsg httpRespMsg = new HttpRespMsg();
         User user = userMapper.selectById(request.getHeader("token"));
-        List<SysRichFunction> functionContractList = sysFunctionMapper.getRoleFunctions(user.getRoleId(), "管理全部合同");
+        List<SysRichFunction> functionContractList = sysFunctionMapper.getRoleFunctions(user.getRoleId(), "查看全部合同");
         if(functionContractList.size() <= 0){
             httpRespMsg.setError(MessageUtils.message("access.operationError"));
             return httpRespMsg;
@@ -1149,7 +1146,7 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract> i
         HttpRespMsg msg = new HttpRespMsg();
         String token = request.getHeader("TOKEN");
         User user = userMapper.selectById(token);
-        List<SysRichFunction> functionContractList = sysFunctionMapper.getRoleFunctions(user.getRoleId(), "管理全部合同");
+        List<SysRichFunction> functionContractList = sysFunctionMapper.getRoleFunctions(user.getRoleId(), "查看全部合同");
         if(functionContractList.size() <= 0){
             msg.setError(MessageUtils.message("access.deleteError"));
             return msg;

+ 2 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/SysFormServiceImpl.java

@@ -105,6 +105,8 @@ public class SysFormServiceImpl extends ServiceImpl<SysFormMapper, SysForm> impl
                 break;
             case "Business":title = company.getCompanyName()+"_商机导入模板";
                 break;
+            case "Contract":title = company.getCompanyName()+"_合同导入模板";
+                break;
             default:title="";
         }
         String result=MessageUtils.message("file.excelScu");

+ 2 - 1
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/SysRoleServiceImpl.java

@@ -82,7 +82,8 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
             "负责部门线索数据","全部线索数据","负责部门商机数据","全部商机数据",
             "负责部门销售数据","全部销售数据","负责部门任务数据","全部任务数据",
             "查看全部产品数据","查看负责部门产品数据",
-            "查看负责部门订单","查看全部订单"
+            "查看负责部门订单","查看全部订单",
+            "查看全部合同","审核合同","新增合同","合同类型管理","导入合同","导出合同"
             };
     public static final HashMap<String, String[]> functionMaps = new HashMap();
     static {

文件差异内容过多而无法显示
+ 3 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/UserServiceImpl.java


+ 3 - 8
fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/BusinessOpportunityMapper.xml

@@ -279,18 +279,14 @@
         GROUP BY s.id
     </select>
     <select id="getAllList" resultType="com.management.platform.entity.BusinessOpportunity">
-        select
-        id,
-        name
+        select *
         from business_opportunity
         where company_id = #{companyId}
         and is_delete = 0
     </select>
 
     <select id="getAllList1" resultType="com.management.platform.entity.BusinessOpportunity">
-        select
-        id,
-        name
+        select *
         from business_opportunity
         where company_id = #{companyId}
         and is_delete = 0
@@ -300,8 +296,7 @@
     </select>
 
     <select id="getAllList2" resultType="com.management.platform.entity.BusinessOpportunity">
-        select id,
-               name
+        select *
         from business_opportunity
         where company_id = #{companyId}
           and is_delete = 0

+ 83 - 6
fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/ContractMapper.xml

@@ -20,16 +20,93 @@
         <result column="remarks" property="remarks" />
         <result column="payment" property="payment" />
         <result column="sec_type_id" property="secTypeId" />
-        <result column="plate1" property="plate1" />
-        <result column="plate2" property="plate2" />
-        <result column="plate3" property="plate3" />
-        <result column="plate4" property="plate4" />
-        <result column="plate5" property="plate5" />
     </resultMap>
 
     <!-- 通用查询结果列 -->
     <sql id="Base_Column_List">
-        id, company_id, creator_id, start_date, end_date, number, project_id, name, amounts, type_id, checkerId, status, indate, remarks, payment, sec_type_id, plate1, plate2, plate3, plate4, plate5
+        id, company_id, creator_id, start_date, end_date, number, project_id, name, amounts, type_id, checkerId, status, indate, remarks, payment, sec_type_id
     </sql>
+    <select id="selectContract" resultType="com.management.platform.entity.Contract">
+        select contract.id,contract.company_id,contract.creator_id,contract.number,contract.name,contract.amounts,contract.type_id,sys_dict.name typeName,contract.status,contract.indate,contract.remarks,
+        contract.start_date as startDate,contract.end_date as endDate,contract_type_sec.sec_type_name,contract.sec_type_id,
+        user.name as creatorName,user.corpwx_userid as creatorWxCorpId, contract.project_id, contract.payment, cp.pay_date AS next_payment_date, cp.amount AS next_payment_amount,
+        contract.plate1,contract.plate2,contract.plate3,contract.plate4,contract.plate5
+        from contract
+        left join sys_dict on contract.type_id = sys_dict.id
+        left join contract_type_sec on contract.sec_type_id = contract_type_sec.id
+        LEFT JOIN (SELECT contract_id, pay_date, amount FROM contract_payment WHERE is_payed = 0 GROUP BY contract_id) cp ON cp.contract_id=contract.id
+        left join user
+        on contract.creator_id = user.id
+        left join contract_custom cc on cc.contract_id=contract.id
+        where contract.company_id = #{companyId}
+        <if test="number!=null">
+            and number like CONCAT('%', #{number}, '%')
+        </if>
+        <if test="name!=null">
+            and contract.name like CONCAT('%', #{name}, '%')
+        </if>
+        <if test="typeName!=null">
+            and sys_dict.name = #{typeName}
+        </if>
+        <if test="secTypeId!=null">
+            and contract.sec_type_id = #{secTypeId}
+        </if>
+        <if test="status!=null">
+            and status = #{status}
+        </if>
+        <if test="startDate!=null and endDate !=null">
+            and indate between #{startDate} and #{endDate}
+        </if>
+        <if test="paymentStartDate != null and paymentEndDate != null">
+            and cp.pay_date between #{paymentStartDate} and #{paymentEndDate}
+        </if>
+        <if test="finishStatus!=null">
+            and cc.finish_status = #{finishStatus}
+        </if>
+        <if test="customerOrg!=null">
+            and cc.customer_org like  CONCAT('%', #{customerOrg}, '%')
+        </if>
+        order by contract.number desc
+        <if test="pageStart!=null and pageSize!=null">
+            limit #{pageStart},#{pageSize}
+        </if>
+    </select>
 
+    <select id="selectContractCnt" resultType="java.lang.Long">
+        select count(1) from contract
+        left join contract_type
+        on contract.type_id = contract_type.id
+        LEFT JOIN (SELECT contract_id, pay_date, amount FROM contract_payment WHERE is_payed = 0 GROUP BY contract_id) cp ON cp.contract_id=contract.id
+        left join user
+        on contract.creator_id = user.id
+        left join contract_custom cc on cc.contract_id=contract.id
+        where contract.company_id = #{companyId}
+        <if test="number!=null">
+            and number like CONCAT('%', #{number}, '%')
+        </if>
+        <if test="name!=null">
+            and contract.name like CONCAT('%', #{name}, '%')
+        </if>
+        <if test="typeName!=null">
+            and contract_type.id = #{typeName}
+        </if>
+        <if test="secTypeId!=null">
+            and contract.sec_type_id = #{secTypeId}
+        </if>
+        <if test="status!=null">
+            and status = #{status}
+        </if>
+        <if test="startDate!=null and endDate !=null">
+            and indate between #{startDate} and #{endDate}
+        </if>
+        <if test="paymentStartDate != null and paymentEndDate != null">
+            and cp.pay_date between #{paymentStartDate} and #{paymentEndDate}
+        </if>
+        <if test="finishStatus!=null">
+            and cc.finish_status = #{finishStatus}
+        </if>
+        <if test="customerOrg!=null">
+            and cc.customer_org like  CONCAT('%', #{customerOrg}, '%')
+        </if>
+    </select>
 </mapper>