Jelajahi Sumber

Merge remote-tracking branch 'origin/master'

ysm 11 bulan lalu
induk
melakukan
c5e7c3cb39

+ 2 - 0
fhKeeper/formulahousekeeper/customerBuler-crm/src/components/TaskModal/index.vue

@@ -24,6 +24,7 @@
             <el-option v-for="item in PRIORITY " :key="item.value" :value="item.value" :label="item.label" />
           </el-select>
         </el-form-item>
+        {{ form.taskType }}
         <el-form-item :label="form.taskType">
           <template #label>
             <el-select v-model="form.taskType" class="border resetSelect" style="width: 100px" @change="changeTaskType"
@@ -143,6 +144,7 @@ watch(() => props.saveLoading, (val) => {
     formRef.value?.resetFields();
     form.value = { ...defalutModalForm };
     generateFormRef.value?.reset();
+    taskTypeValueData.value = customeData.value
   }
 })
 watch(() => props.visible, (val) => {

+ 1 - 1
fhKeeper/formulahousekeeper/customerBuler-crm/src/main.ts

@@ -31,7 +31,7 @@ app.config.globalProperties.$echarts = echarts;
 app
   .use(ElementPlus, {
     locale: zhCn,
-    zIndex: 1900,
+    zIndex: 1800,
   })
   .use(createPinia())
   .use(router)

+ 8 - 2
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/contacts/component/relatedBusiness.vue

@@ -22,6 +22,7 @@
                 <el-table-column prop="stageValue" label="商机阶段" width="130" />
                 <el-table-column prop="creatorName" label="创建人" width="130" />
                 <el-table-column prop="createTime" label="创建时间" width="130" />
+                <el-table-column prop="editTime" label="修改时间" width="130" />
             </el-table>
         </div>
 
@@ -53,7 +54,7 @@ import { get, post } from '@/utils/request';
 import { useRouter, useRoute } from "vue-router";
 
 import RelatedProducts from '@/components/relatedProducts/relatedProducts.vue'
-import { formatDateTime } from '@/utils/times';
+import { formatDate, formatDateTime } from '@/utils/times';
 import { GETGENERATEFOEM, UPDATEINSET } from '@/pages/business/api';
 import { GETTABLELIST } from '@/pages/product/api';
 import { judgmentaAmounteEqual } from '@/utils/tools';
@@ -142,7 +143,12 @@ function closeVisible(type: keyof typeof allVisible) {
 watchEffect(() => {
     const { data } = props
     information.value = data
-    relatedTaskstable.value = data.businessOpportunityList
+    relatedTaskstable.value = data.businessOpportunityList.map((item: any) => {
+        return {
+            ...item,
+            expectedTransactionDate: item.expectedTransactionDate ? formatDate(new Date(item.expectedTransactionDate)) : ''
+        }
+    })
 });
 
 async function getSystemField() {

+ 4 - 4
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/order/api.ts

@@ -23,8 +23,8 @@ export const URL_EDITEBATE = `${MOD}/editPayment`
 export const URL_DETELEITEMS = `${MOD}/deletePayment`
 
 export const tableColumns: TableColumn[] = [
-    { prop: 'orderCode', label: '订单编号', event: 'toDetali', width: '150' },
-    { prop: 'orderName', label: '订单名称', width: '150' },
+    { prop: 'orderCode', label: '订单编号', width: '150' },
+    { prop: 'orderName', label: '订单名称', event: 'toDetali', width: '150' },
     { prop: 'customName', label: '客户名称', width: '200' },
     { prop: 'businessOpportunityName', label: '商机名称', width: '200' },
     { prop: 'price', label: '订单金额(¥)', width: '120' },
@@ -35,8 +35,8 @@ export const tableColumns: TableColumn[] = [
     { prop: 'placeTime', label: '下单时间', width: '200' },
     { prop: 'orderStartDate', label: '订单开始时间', width: '200' },
     { prop: 'orderEndDate', label: '订单结束时间', width: '140' },
-    { prop: 'customSignerName', label: '客户签人', width: '140' },
-    { prop: 'companySignerName', label: '公司签人', width: '200' },
+    { prop: 'customSignerName', label: '客户签人', width: '140' },
+    { prop: 'companySignerName', label: '公司签人', width: '200' },
     { prop: 'inchargerName', label: '负责人', width: '200' },
     { prop: 'creatorName', label: '创建人', width: '200' },
     { prop: 'createTime', label: '创建时间', width: '200' },

+ 1 - 1
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/order/index.vue

@@ -436,7 +436,7 @@ function setFilterItems() {
     { label: '订单名称', key: 'orderName', type: 'input' },
     { label: '客户名称', key: 'customId', type: 'select', options: selectData.Customer },
     { label: '商机名称', key: 'businessName', type: 'input' },
-    { label: '订单类型', key: 'ordertype', type: 'select', options: selectData.OrderType },
+    { label: '订单类型', key: 'orderType', type: 'select', options: selectData.OrderType },
     { label: '回款状态', key: 'receivedStatus', type: 'select', options: selectData.RemittanceStatus },
     { label: '负责人', key: 'inchargerId', type: 'select', options: selectData.Personnel },
     { label: '下单时间', key: '', type: 'date' },

+ 6 - 6
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/product/component/relatedSalesOrder.vue

@@ -5,12 +5,7 @@
         </div>
         <div class="flex-1 overflow-auto pt-3">
             <el-table :data="relatedTaskstable" border style="width: 100%;height: 300px;">
-                <el-table-column label="序号" width="80">
-                    <template #default="scope">
-                        {{ scope.$index + 1 }}
-                    </template>
-                </el-table-column>
-                <el-table-column v-for="(column, index) in tableColumns" :key="index" :prop="column.prop"
+                <el-table-column v-for="(column, index) in newTableColumns" :key="index" :prop="column.prop"
                     :label="column.label" :width="column.width">
                     <template #default="scope">
                         <template v-if="column.event === 'toDetali'">
@@ -30,6 +25,7 @@ import { tableColumns, MOD, paymentStatus } from '@/pages/order/api'
 import router from '@/router';
 
 const relatedTaskstable = ref([])
+const newTableColumns = ref<any>([])
 
 const props = defineProps<{
     data: any
@@ -59,6 +55,10 @@ watchEffect(() => {
 
 // 生命周期钩子
 onMounted(() => {
+    newTableColumns.value = tableColumns.filter((item: any) => {
+        const excludedProps = ['businessOpportunityName', 'orderStartDate', 'orderEndDate', 'companySignerName', 'inchargerName', 'customSignerName'];
+        return !excludedProps.includes(item.prop);
+    })
     receiveAssignment(props)
 });
 </script>

+ 8 - 8
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/tasks/index.vue

@@ -252,7 +252,7 @@ function search() {
       executorNames: item.taskExecutors?.join(',') ?? ''
     }));
   }).catch(err => {
-    globalPopup?.showError(err);
+    globalPopup?.showError(err.msg);
     loading.value = false;
   })
 }
@@ -290,7 +290,7 @@ function deleteTasks() {
       search();
       globalPopup?.showSuccess("删除成功")
     }).catch(err => {
-      globalPopup?.showError(err)
+      globalPopup?.showError(err.msg)
     })
   });
 }
@@ -313,7 +313,7 @@ function importExcel(data: any) {
     importLoading.value = "3";
     search();
   }).catch(err => {
-    globalPopup?.showError(err)
+    globalPopup?.showError(err.msg)
     importLoading.value = "4";
   })
 }
@@ -337,7 +337,7 @@ function exportTasks() {
     btnLoading.value = false;
   }).catch(err => {
     btnLoading.value = false;
-    globalPopup?.showError(err)
+    globalPopup?.showError(err.msg)
   })
 }
 function closeExportModal() {
@@ -350,7 +350,7 @@ function exportExcel(data: any) {
     exportLoading.value = "3";
     exportVisible.value = false;
   }).catch(err => {
-    globalPopup?.showError(err)
+    globalPopup?.showError(err.msg)
   })
   setTimeout(() => {
 
@@ -375,7 +375,7 @@ function finishRow(item: any) {
     search()
     globalPopup?.showSuccess("操作成功")
   }).catch(err => {
-    globalPopup?.showError(err)
+    globalPopup?.showError(err.msg)
   })
 }
 function restart(item: any) {
@@ -386,7 +386,7 @@ function restart(item: any) {
     search()
     globalPopup?.showSuccess("操作成功")
   }).catch(err => {
-    globalPopup?.showError(err)
+    globalPopup?.showError(err.msg)
   })
 }
 function deleteRow(item: any) {
@@ -398,7 +398,7 @@ function deleteRow(item: any) {
       globalPopup?.showSuccess("删除成功")
     }).catch(err => {
       console.log("err", err);
-      globalPopup?.showError(err)
+      globalPopup?.showError(err.msg)
     })
   })
 }

+ 18 - 1
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/ProductController.java

@@ -57,6 +57,8 @@ public class ProductController {
     private SysDictService sysDictService;
     @Resource
     private StageService stageService;
+    @Resource
+    private ContactsService contactsService;
 
 
     /**
@@ -268,6 +270,7 @@ public class ProductController {
         List<User> userList = userMapper.selectList(new LambdaQueryWrapper<User>().eq(User::getCompanyId, companyId));
 //        List<SysDict> businessStageList = sysDictService.list(new LambdaQueryWrapper<SysDict>().eq(SysDict::getCode, "BusinessStage"));
         List<Stage> businessStageList = stageService.list(new LambdaQueryWrapper<Stage>().eq(Stage::getCompanyId, companyId));
+        List<Contacts> contactsList = contactsService.list(new LambdaQueryWrapper<Contacts>().eq(Contacts::getCompanyId, companyId));
         opportunityList.forEach(c->{
             Optional<Custom> custom = customList.stream().filter(ct -> ct.getId().equals(c.getCustomerId())).findFirst();
             if(custom.isPresent()){
@@ -277,7 +280,7 @@ public class ProductController {
             if(user.isPresent()){
                 c.setCreatorName(user.get().getName());
             }
-            Optional<User> contacts = userList.stream().filter(u -> u.getId().equals(c.getContactsId())).findFirst();
+            Optional<Contacts> contacts = contactsList.stream().filter(u -> u.getId().equals(c.getContactsId())).findFirst();
             if(contacts.isPresent()){
                 c.setContactsName(contacts.get().getName());
             }
@@ -312,6 +315,8 @@ public class ProductController {
         orderIds.add(-1);
         List<SalesOrder> orderList = salesOrderService.list(new LambdaQueryWrapper<SalesOrder>().in(SalesOrder::getId, orderIds));
         List<SysDict> orderTypeList = sysDictService.list(new LambdaQueryWrapper<SysDict>().eq(SysDict::getCode, "OrderType"));
+        List<Integer> businessOpportunityIds = orderList.stream().map(SalesOrder::getBusinessOpportunityId).distinct().collect(Collectors.toList());
+        List<BusinessOpportunity> businessOpportunityList = businessOpportunityService.list(new LambdaQueryWrapper<BusinessOpportunity>().in(BusinessOpportunity::getId, businessOpportunityIds));
         orderList.forEach(o->{
             Optional<Custom> custom = customList.stream().filter(ct -> ct.getId().equals(o.getCustomId())).findFirst();
             if(custom.isPresent()){
@@ -321,10 +326,22 @@ public class ProductController {
             if(user.isPresent()){
                 o.setCreatorName(user.get().getName());
             }
+            Optional<User> customSigner = userList.stream().filter(u -> u.getId().equals(o.getCustomSigner())).findFirst();
+            if(customSigner.isPresent()){
+                o.setCustomSignerName(customSigner.get().getName());
+            }
+            Optional<User> companySigner = userList.stream().filter(u -> u.getId().equals(o.getCompanySigner())).findFirst();
+            if(companySigner.isPresent()){
+                o.setCompanySigner(companySigner.get().getName());
+            }
             Optional<User> incharger = userList.stream().filter(u -> u.getId().equals(o.getInchargerId())).findFirst();
             if(incharger.isPresent()){
                 o.setInchargerName(incharger.get().getName());
             }
+            Optional<BusinessOpportunity> businessOpportunity = businessOpportunityList.stream().filter(b -> o.getBusinessOpportunityId() != null && b.getId().equals(o.getBusinessOpportunityId())).findFirst();
+            if(businessOpportunity.isPresent()){
+                o.setBusinessOpportunityName(businessOpportunity.get().getName());
+            }
             Optional<SysDict> orderType = orderTypeList.stream().filter(ot -> ot.getId().equals(o.getType())).findFirst();
             if(orderType.isPresent()){
                 o.setTypeName(orderType.get().getName());

+ 10 - 3
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ReportLogController.java

@@ -293,10 +293,12 @@ public class ReportLogController {
                             msg.setError("第"+row+"行审核时间格式错误,请检查审核时间数据");
                             return msg;
                         }
-                        reportLog.setOperateDate(auditDateTime);
-                        needUpdateReportLogList.add(reportLog);
+                        String creatorId = reports.get(0).getCreatorId();
+                        if(!creatorId.equals(reportLog.getOperatorId())){
+                            reportLog.setOperateDate(auditDateTime);
+                            needUpdateReportLogList.add(reportLog);
+                        }
                         LocalDateTime finalAuditDateTime = auditDateTime;
-                        LocalDateTime finalCreateTimeTime = createTimeTime;
                         reports.forEach(r->{
                             r.setProjectAuditTime(finalAuditDateTime);
                         });
@@ -309,6 +311,11 @@ public class ReportLogController {
                             msg.setError("第"+row+"行填报时间格式错误,请检查审核时间数据");
                             return msg;
                         }
+                        String creatorId = reports.get(0).getCreatorId();
+                        if(creatorId.equals(reportLog.getOperatorId())){
+                            reportLog.setOperateDate(createTimeTime);
+                            needUpdateReportLogList.add(reportLog);
+                        }
                         LocalDateTime finalCreateTimeTime = createTimeTime;
                         reports.forEach(r->{
                             r.setCreateTime(finalCreateTimeTime);

+ 35 - 28
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java

@@ -1894,15 +1894,16 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                                     item.put("key","审核人");
                                     item.put("value",wxCorpInfo.getSaasSyncContact() == 1?("$userName="+user.getName()+"$"): user.getName());
                                     dataJson.add(item);
-                                    if(timeType.getNeedEvaluate()==1){
-                                        JSONObject item1=new JSONObject();
-                                        item1.put("key","评价");
-                                        item1.put("value",StringUtils.isEmpty(report.getEvaluate())?"":report.getEvaluate());
-                                        dataJson.add(item1);
-                                        json.put("template_id","tty9TkCAAAWoUyhGnXRCZuhkgCqw_Uow");
-                                    }else {
-                                        json.put("template_id","tty9TkCAAANpvEtLrkPUGeOEd1-U7W2w");
-                                    }
+//                                    if(timeType.getNeedEvaluate()==1){
+//                                        JSONObject item1=new JSONObject();
+//                                        item1.put("key","评价");
+//                                        item1.put("value",StringUtils.isEmpty(report.getEvaluate())?"":report.getEvaluate());
+//                                        dataJson.add(item1);
+//                                        json.put("template_id","tty9TkCAAAWoUyhGnXRCZuhkgCqw_Uow");
+//                                    }else {
+//                                        json.put("template_id","tty9TkCAAANpvEtLrkPUGeOEd1-U7W2w");
+//                                    }
+                                    json.put("template_id","tty9TkCAAANpvEtLrkPUGeOEd1-U7W2w");
                                     JSONObject item2=new JSONObject();
                                     item2.put("key","日期");
                                     item2.put("value",report.getCreateDate());
@@ -2447,15 +2448,16 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                                     item.put("key","审核人");
                                     item.put("value",user.getName());
                                     dataJson.add(item);
-                                    if(timeType.getNeedEvaluate()==1){
-                                        JSONObject item1=new JSONObject();
-                                        item1.put("key","评价");
-                                        item1.put("value",StringUtils.isEmpty(report.getEvaluate())?"":report.getEvaluate());
-                                        dataJson.add(item1);
-                                        json.put("template_id","tty9TkCAAAWoUyhGnXRCZuhkgCqw_Uow");
-                                    }else {
-                                        json.put("template_id","tty9TkCAAANpvEtLrkPUGeOEd1-U7W2w");
-                                    }
+//                                    if(timeType.getNeedEvaluate()==1){
+//                                        JSONObject item1=new JSONObject();
+//                                        item1.put("key","评价");
+//                                        item1.put("value",StringUtils.isEmpty(report.getEvaluate())?"":report.getEvaluate());
+//                                        dataJson.add(item1);
+//                                        json.put("template_id","tty9TkCAAAWoUyhGnXRCZuhkgCqw_Uow");
+//                                    }else {
+//                                        json.put("template_id","tty9TkCAAANpvEtLrkPUGeOEd1-U7W2w");
+//                                    }
+                                    json.put("template_id","tty9TkCAAANpvEtLrkPUGeOEd1-U7W2w");
                                     JSONObject item2=new JSONObject();
                                     item2.put("key","日期");
                                     item2.put("value",report.getCreateDate());
@@ -3777,15 +3779,16 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                                     item.put("key","审核人");
                                     item.put("value",user.getName());
                                     dataJson.add(item);
-                                    if(timeType.getNeedEvaluate()==1){
-                                        JSONObject item1=new JSONObject();
-                                        item1.put("key","评价");
-                                        item1.put("value",StringUtils.isEmpty(report.getEvaluate())?"":report.getEvaluate());
-                                        dataJson.add(item1);
-                                        json.put("template_id","tty9TkCAAAWoUyhGnXRCZuhkgCqw_Uow");
-                                    }else {
-                                        json.put("template_id","tty9TkCAAANpvEtLrkPUGeOEd1-U7W2w");
-                                    }
+//                                    if(timeType.getNeedEvaluate()==1){
+//                                        JSONObject item1=new JSONObject();
+//                                        item1.put("key","评价");
+//                                        item1.put("value",StringUtils.isEmpty(report.getEvaluate())?"":report.getEvaluate());
+//                                        dataJson.add(item1);
+//                                        json.put("template_id","tty9TkCAAAWoUyhGnXRCZuhkgCqw_Uow");
+//                                    }else {
+//
+//                                    }
+                                    json.put("template_id","tty9TkCAAANpvEtLrkPUGeOEd1-U7W2w");
                                     JSONObject item2=new JSONObject();
                                     item2.put("key","日期");
                                     item2.put("value",report.getCreateDate());
@@ -5298,7 +5301,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                             report.setWorkingTime(time);
                             report.setContent(workContent);
                             report.setMultiWorktime(timeType.getMultiWorktime());
-                            report.setFillUserid(user.getId());
+//                            report.setFillUserid(user.getId());  导入时,处理为自己填写的
                             if (timeType.getImportReportAuditNormal() == 0) {
                                 //老的导入日报审核模式
                                 if (timeType.getNeedDeptAudit() == 0) {
@@ -5380,7 +5383,11 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                     msg.setError(MessageUtils.message("finance.importErrorByAllAdopt"));
                     return msg;
                 } else {
+                    //如果开启了审批流的显示,需要插入日报提交记录表
                     reportService.saveBatch(reportList);
+                    if (timeType.getShowFillauditTime() == 1) {
+                        saveFillReportLog(reportList);
+                    }
                     msg.data = dataCount;
                     String originName = fileName;
                     //定义一个独立的文件夹

+ 104 - 72
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/task/TimingTask.java

@@ -954,39 +954,48 @@ public class TimingTask {
             //判断日报审核类型
             timeTypeList.stream().filter(timeType -> timeType.getCompanyId().equals(companyId)).findFirst().ifPresent(timeType -> {
                 if (timeType.getReportAuditType() == 7) {//并行审核模式
-                    List<User> userList = userMapper.selectList(new QueryWrapper<User>().select("id,dingding_userid", "corpwx_userid").eq("company_id", companyId));
-                    List<Report> reportList = reportMapper.selectList(new QueryWrapper<Report>().select("id, project_auditor_id, audit_dept_managerid,project_audit_state,department_audit_state").eq("company_id", companyId).eq("state", 0));
-                    HashMap<String, Long> auditorMap = new HashMap();
-                    for (Report report : reportList) {
-                        //按审核人汇总统计
-                        String pAuditorId = null;
-                        if (report.getProjectAuditState() == 0) {
-                            pAuditorId = report.getProjectAuditorId();
-                            if (auditorMap.get(pAuditorId) == null) {
-                                auditorMap.put(pAuditorId, 1L);
-                            } else {
-                                auditorMap.put(pAuditorId, auditorMap.get(pAuditorId) + 1);
-                            }
+                    boolean shouldAlert = true;
+                    if (timeType.getAlertType() == 4) {
+                        //每周提醒一次,校验日期是否正确
+                        if (LocalDate.now().getDayOfWeek().getValue() != timeType.getAlertCheckDay()) {
+                            shouldAlert = false;
                         }
-                        String deptAuditorId = null;
-                        if (report.getDepartmentAuditState() == 0) {
-                            deptAuditorId = report.getAuditDeptManagerid();
-                            if (deptAuditorId != null &&!deptAuditorId.equals(pAuditorId)) {
-                                //不是同一个人,需要单独统计
-                                if (auditorMap.get(deptAuditorId) == null) {
-                                    auditorMap.put(deptAuditorId, 1L);
+                    }
+                    if (shouldAlert) {
+                        List<User> userList = userMapper.selectList(new QueryWrapper<User>().select("id,dingding_userid", "corpwx_userid").eq("company_id", companyId));
+                        List<Report> reportList = reportMapper.selectList(new QueryWrapper<Report>().select("id, project_auditor_id, audit_dept_managerid,project_audit_state,department_audit_state").eq("company_id", companyId).eq("state", 0));
+                        HashMap<String, Long> auditorMap = new HashMap();
+                        for (Report report : reportList) {
+                            //按审核人汇总统计
+                            String pAuditorId = null;
+                            if (report.getProjectAuditState() == 0) {
+                                pAuditorId = report.getProjectAuditorId();
+                                if (auditorMap.get(pAuditorId) == null) {
+                                    auditorMap.put(pAuditorId, 1L);
                                 } else {
-                                    auditorMap.put(deptAuditorId, auditorMap.get(deptAuditorId) + 1);
+                                    auditorMap.put(pAuditorId, auditorMap.get(pAuditorId) + 1);
+                                }
+                            }
+                            String deptAuditorId = null;
+                            if (report.getDepartmentAuditState() == 0) {
+                                deptAuditorId = report.getAuditDeptManagerid();
+                                if (deptAuditorId != null &&!deptAuditorId.equals(pAuditorId)) {
+                                    //不是同一个人,需要单独统计
+                                    if (auditorMap.get(deptAuditorId) == null) {
+                                        auditorMap.put(deptAuditorId, 1L);
+                                    } else {
+                                        auditorMap.put(deptAuditorId, auditorMap.get(deptAuditorId) + 1);
+                                    }
                                 }
                             }
                         }
-                    }
-                    for (Map.Entry<String, Long> entry : auditorMap.entrySet()) {
-                        String auditorId = entry.getKey();
-                        Long num = entry.getValue();
-                        Optional<User> first = userList.stream().filter(ul -> ul.getId().equals(auditorId)).findFirst();
-                        if (first.isPresent()) {
-                            companyDingdingService.sendReportWaitingApplyMsg(companyId, companyDingding.getAgentId(), num, first.get().getDingdingUserid());
+                        for (Map.Entry<String, Long> entry : auditorMap.entrySet()) {
+                            String auditorId = entry.getKey();
+                            Long num = entry.getValue();
+                            Optional<User> first = userList.stream().filter(ul -> ul.getId().equals(auditorId)).findFirst();
+                            if (first.isPresent()) {
+                                companyDingdingService.sendReportWaitingApplyMsg(companyId, companyDingding.getAgentId(), num, first.get().getDingdingUserid());
+                            }
                         }
                     }
                 } else {
@@ -1026,60 +1035,83 @@ public class TimingTask {
                 }
                 //判断日报审核类型
                 timeTypeList.stream().filter(timeType -> timeType.getCompanyId().equals(companyId)).findFirst().ifPresent(timeType -> {
+                    //校验审核的日期,是否是每周提醒;目前仅景昱采用了这个模式审核,他们需要设置每周几审核
                     if (timeType.getReportAuditType() == 7) {//并行审核模式
-                        List<User> userList = userMapper.selectList(new QueryWrapper<User>().select("id,dingding_userid", "corpwx_userid").eq("company_id", companyId));
-                        List<Report> reportList = reportMapper.selectList(new QueryWrapper<Report>().select("id, project_auditor_id, audit_dept_managerid,project_audit_state,department_audit_state").eq("company_id", companyId).eq("state", 0));
-                        HashMap<String, Long> auditorMap = new HashMap();
-                        for (Report report : reportList) {
-                            //按审核人汇总统计
-                            String pAuditorId = null;
-                            if (report.getProjectAuditState() == 0) {
-                                pAuditorId = report.getProjectAuditorId();
-                                if (auditorMap.get(pAuditorId) == null) {
-                                    auditorMap.put(pAuditorId, 1L);
-                                } else {
-                                    auditorMap.put(pAuditorId, auditorMap.get(pAuditorId) + 1);
-                                }
+                        boolean shouldAlert = true;
+                        if (timeType.getAlertType() == 4) {
+                            //每周提醒一次,校验日期是否正确
+                            if (LocalDate.now().getDayOfWeek().getValue() != timeType.getAlertCheckDay()) {
+                                shouldAlert = false;
                             }
-                            String deptAuditorId = null;
-                            if (report.getDepartmentAuditState() == 0) {
-                                deptAuditorId = report.getAuditDeptManagerid();
-                                if (!deptAuditorId.equals(pAuditorId)) {
-                                    //不是同一个人,需要单独统计
-                                    if (auditorMap.get(deptAuditorId) == null) {
-                                        auditorMap.put(deptAuditorId, 1L);
+                        }
+                        if (shouldAlert) {
+                            List<User> userList = userMapper.selectList(new QueryWrapper<User>().select("id,dingding_userid", "corpwx_userid").eq("company_id", companyId));
+                            List<Report> reportList = reportMapper.selectList(new QueryWrapper<Report>().select("id, project_auditor_id, audit_dept_managerid,project_audit_state,department_audit_state").eq("company_id", companyId).eq("state", 0));
+                            HashMap<String, Long> auditorMap = new HashMap();
+                            for (Report report : reportList) {
+                                //按审核人汇总统计
+                                String pAuditorId = null;
+                                if (report.getProjectAuditState() == 0) {
+                                    pAuditorId = report.getProjectAuditorId();
+                                    if (auditorMap.get(pAuditorId) == null) {
+                                        auditorMap.put(pAuditorId, 1L);
                                     } else {
-                                        auditorMap.put(deptAuditorId, auditorMap.get(deptAuditorId) + 1);
+                                        auditorMap.put(pAuditorId, auditorMap.get(pAuditorId) + 1);
                                     }
                                 }
-                            }
-                        }
-                        for (Map.Entry<String, Long> entry : auditorMap.entrySet()) {
-                            String auditorId = entry.getKey();
-                            Long num = entry.getValue();
-                            Optional<User> first = userList.stream().filter(ul -> ul.getId().equals(auditorId)).findFirst();
-                            if (first.isPresent()) {
-                                if (first.get().getCorpwxUserid() != null) {
-                                    String corpwxUserid = first.get().getCorpwxUserid();
-                                    //推送到企业微信
-                                    JSONObject json=new JSONObject();
-                                    JSONArray dataJson=new JSONArray();
-                                    JSONObject jsonObj=new JSONObject();
-                                    jsonObj.put("key", "待审核数量");
-                                    jsonObj.put("value",num+"");
-                                    dataJson.add(jsonObj);
-                                    if(isPrivateDeploy){
-                                        json.put("content","待审核数量: "+num+"\\n<a href=\\\"https://open.weixin.qq.com/connect/oauth2/authorize?appid=ww4e237fd6abb635af&redirect_uri="+pcUrl+"/api/corpWXAuth&response_type=code&scope=snsapi_base&state=0#wechat_redirect\\\">去审核</a>");
-                                    }else {
-                                        json.put("template_id","tty9TkCAAAuPvPjabDdQXGocnG0K24EQ");
-                                        json.put("url","https://open.weixin.qq.com/connect/oauth2/authorize?appid=ww4e237fd6abb635af&redirect_uri=http://worktime.ttkuaiban.com/api/corpWXAuth&response_type=code&scope=snsapi_base&state=review#wechat_redirect");
-                                        json.put("content_item",dataJson);
+                                String deptAuditorId = null;
+                                if (report.getDepartmentAuditState() == 0) {
+                                    deptAuditorId = report.getAuditDeptManagerid();
+                                    if (!deptAuditorId.equals(pAuditorId)) {
+                                        //不是同一个人,需要单独统计
+                                        if (auditorMap.get(deptAuditorId) == null) {
+                                            auditorMap.put(deptAuditorId, 1L);
+                                        } else {
+                                            auditorMap.put(deptAuditorId, auditorMap.get(deptAuditorId) + 1);
+                                        }
                                     }
+                                }
+                            }
+                            for (Map.Entry<String, Long> entry : auditorMap.entrySet()) {
+                                String auditorId = entry.getKey();
+                                Long num = entry.getValue();
+                                Optional<User> first = userList.stream().filter(ul -> ul.getId().equals(auditorId)).findFirst();
+                                if (first.isPresent()) {
+                                    if (first.get().getCorpwxUserid() != null) {
+                                        String corpwxUserid = first.get().getCorpwxUserid();
+                                        //推送到企业微信
+                                        JSONObject json=new JSONObject();
+                                        JSONArray dataJson=new JSONArray();
+                                        JSONObject jsonObj=new JSONObject();
+                                        if (timeType.getAlertType() == 4) {
+                                            jsonObj.put("key", "提示");
+                                            String msgContent = timeType.getAlertCheckMsg();
+                                            if (StringUtils.isEmpty(msgContent)) {
+                                                msgContent = "待审核数量:"+num;
+                                            } else {
+                                                msgContent = msgContent.replace("{0}", ""+num);
+                                            }
+                                            jsonObj.put("value",msgContent);
+                                        } else {
+                                            jsonObj.put("key", "待审核数量");
+                                            jsonObj.put("value",num+"");
+                                        }
+                                        dataJson.add(jsonObj);
+                                        if(isPrivateDeploy){
+                                            json.put("content","待审核数量: "+num+"\\n<a href=\\\"https://open.weixin.qq.com/connect/oauth2/authorize?appid=ww4e237fd6abb635af&redirect_uri="+pcUrl+"/api/corpWXAuth&response_type=code&scope=snsapi_base&state=0#wechat_redirect\\\">去审核</a>");
+                                        }else {
+                                            String templateId = timeType.getAlertType() == 4 ? "tty9TkCAAAtDDCqY796mGulF9c5Jmwng":"tty9TkCAAAuPvPjabDdQXGocnG0K24EQ";
+                                            json.put("template_id",templateId);
+                                            json.put("url","https://open.weixin.qq.com/connect/oauth2/authorize?appid=ww4e237fd6abb635af&redirect_uri=http://worktime.ttkuaiban.com/api/corpWXAuth&response_type=code&scope=snsapi_base&state=review#wechat_redirect");
+                                            json.put("content_item",dataJson);
+                                        }
 //                                    System.out.println("发送企业微信消息==用户:"+first.get().getId()+", name="+first.get().getName()+", "+json.toJSONString());
-                                    wxCorpInfoService.sendWXCorpTemplateMsg(wxCorpInfo, corpwxUserid, json);
+                                        wxCorpInfoService.sendWXCorpTemplateMsg(wxCorpInfo, corpwxUserid, json);
+                                    }
                                 }
                             }
                         }
+
                     } else {
                         List<Map<String, Object>> result = reportMapper.getProWaitingApproveCnt(wxCorpInfo.getCompanyId());
                         List<Map<String, Object>> result1 = reportMapper.getDeptWaitingApproveCnt(wxCorpInfo.getCompanyId());

+ 6 - 2
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/impl/ProductServiceImpl.java

@@ -517,8 +517,12 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
                     }
                 }
             }
-            prodProcedureService.saveBatch(prodProcedureList);
-            planService.updateBatchById(needUpdatePlanList);
+            if(prodProcedureList.size()>0){
+                prodProcedureService.saveBatch(prodProcedureList);
+            }
+            if(needUpdatePlanList.size()>0) {
+                planService.updateBatchById(needUpdatePlanList);
+            }
         } catch (IOException e) {
             e.printStackTrace();
         } catch (NullPointerException e) {