Sfoglia il codice sorgente

Merge remote-tracking branch 'origin/master'

Guo1B0 10 mesi fa
parent
commit
fe26f581a3
19 ha cambiato i file con 439 aggiunte e 100 eliminazioni
  1. 14 27
      fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/analysis/index.vue
  2. 3 3
      fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/business/index.vue
  3. 2 1
      fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/customer/component/relatedOrders.vue
  4. 32 27
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/ProductController.java
  5. 40 27
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/SalesOrderController.java
  6. 133 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/TaskController.java
  7. 21 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/TaskInformationController.java
  8. 2 2
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/AuditLogCenter.java
  9. 2 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/Product.java
  10. 57 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/TaskInformation.java
  11. 16 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/mapper/TaskInformationMapper.java
  12. 16 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/TaskInformationService.java
  13. 3 3
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/ProductServiceImpl.java
  14. 33 3
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/SalesOrderServiceImpl.java
  15. 20 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/TaskInformationServiceImpl.java
  16. 24 4
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/TaskServiceImpl.java
  17. 18 0
      fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/TaskInformationMapper.xml
  18. 1 1
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/TaskController.java
  19. 2 2
      fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/ProjectMapper.xml

+ 14 - 27
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/analysis/index.vue

@@ -4,7 +4,7 @@ import TrendCard from './components/TrendCard.vue';
 import SimpleCard from './components/SimpleCard.vue';
 import Divider from './components/Divider.vue';
 import Echarts from '@/components/ReEcharts/index.vue';
-import { EChartsOption } from 'echarts';
+import { EChartsOption, use } from 'echarts';
 import { dayjs } from 'element-plus';
 import {
   getSummaryData,
@@ -55,6 +55,10 @@ type PromptType = {
   sliceDate: [Date, Date];
 };
 
+const select1 = ref<HTMLDivElement>();
+const select2 = ref<HTMLDivElement>();
+const select3 = ref<HTMLDivElement>();
+
 const bulletinPrompt = reactive<PromptType>({
   permission: 0,
   date: 0,
@@ -178,12 +182,13 @@ watchEffect(() => {
         </div>
         <div class="w-40">
           <el-select
+            ref="select1"
             size="small"
             :model-value="bulletinPrompt.date"
             @change="(value) => (bulletinPrompt.date = value)"
           >
             <el-option v-for="date in dateOptions" :label="date.label" :value="date.value" />
-            <el-option label="自定义" value="ignore">
+            <el-option label="自定义" value="ignore" disabled>
               <div class="flex gap-2 w-80">
                 <el-date-picker
                   size="small"
@@ -194,7 +199,7 @@ watchEffect(() => {
                   start-placeholder="开始日期"
                   end-placeholder="结束日期"
                 />
-                <el-button size="small" type="primary">确认</el-button>
+                <el-button size="small" type="primary" @click="select1?.blur">确认</el-button>
               </div>
             </el-option>
           </el-select>
@@ -271,13 +276,14 @@ watchEffect(() => {
             </div>
             <div class="w-40">
               <el-select
+                ref="select2"
                 clearable
                 size="small"
                 :model-value="summaryPrompt.date"
                 @change="(value) => (summaryPrompt.date = value)"
               >
                 <el-option v-for="date in dateOptions" :label="date.label" :value="date.value" />
-                <el-option label="自定义" value="ignore">
+                <el-option label="自定义" value="ignore" disabled>
                   <div class="flex gap-2 w-80">
                     <el-date-picker
                       size="small"
@@ -288,7 +294,7 @@ watchEffect(() => {
                       start-placeholder="开始日期"
                       end-placeholder="结束日期"
                     />
-                    <el-button size="small" type="primary">确认</el-button>
+                    <el-button size="small" type="primary" @click="select2?.blur">确认</el-button>
                   </div>
                 </el-option>
               </el-select>
@@ -363,13 +369,14 @@ watchEffect(() => {
             </div>
             <div class="w-40">
               <el-select
+                ref="select3"
                 clearable
                 size="small"
                 :model-value="stagePrompt.date"
                 @change="(value) => (stagePrompt.date = value)"
               >
                 <el-option v-for="date in dateOptions" :label="date.label" :value="date.value" />
-                <el-option label="自定义" value="ignore">
+                <el-option label="自定义" value="ignore" disabled>
                   <div class="flex gap-2 w-80">
                     <el-date-picker
                       size="small"
@@ -380,7 +387,7 @@ watchEffect(() => {
                       start-placeholder="开始日期"
                       end-placeholder="结束日期"
                     />
-                    <el-button size="small" type="primary">确认</el-button>
+                    <el-button size="small" type="primary" @click="select3?.blur">确认</el-button>
                   </div>
                 </el-option>
               </el-select>
@@ -392,25 +399,5 @@ watchEffect(() => {
         </div>
       </div>
     </section>
-    <!-- <nav class="flex-1 min-w-60 sticky right-0 top-9 max-lg:hidden">
-      <div class="border border-gray-200 rounded w-3/4 text-sm text-gray-500">
-        <div class="p-2" v-for="primission in permissionOptions">
-          {{ primission.label }}
-        </div>
-      </div>
-      <div class="border border-gray-200 rounded text-sm text-gray-500 mt-4">
-        <div class="p-2" v-for="date in dateOptions">{{ date.label }}</div>
-        <div class="p-2">
-          <div>自定义</div>
-          <el-date-picker
-            type="daterange"
-            class="max-w-full mt-2"
-            v-model="defineDate"
-            start-placeholder="开始日期"
-            end-placeholder="结束日期"
-          />
-        </div>
-      </div>
-    </nav> -->
   </div>
 </template>

+ 3 - 3
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/business/index.vue

@@ -405,10 +405,10 @@ function changeBatch(flag: boolean = true) {
 function editProduct(row: any) {
   post(BUSIESS_INFO, { id: row.id }).then(({ data }) => {
     const list = (data.businessItemProducts || []).map((item: any) => {
-      const { id, productName, productId, productCode, unit, unitName, typeName, type, price, inventory, orderProductDetail, num, discount, sealPrice, totalPrice, quantity } = item
+      const { id, productName, productId, productCode, unit, unitName, typeName, productType, type, price, inventory, orderProductDetail, num, discount, sellingPrice, sealPrice, totalPrice, quantity } = item
       return {
-        id, productId: productId, productName, productCode, unit, unitName, typeName, type, price, inventory,
-        num, discount, sealPrice, totalPrice, quantity
+        id, productId: productId, productName, productCode, unitName: unit, typeName: productType, type, price, inventory,
+        num, discount, sealPrice, totalPrice, quantity, sellingPrice
       }
     })
     productTableListValue.value = list

+ 2 - 1
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/customer/component/relatedOrders.vue

@@ -57,8 +57,9 @@ import { GenerateForm } from '@zmjs/form-design';
 import { get, post } from '@/utils/request';
 import router from '@/router';
 import RelatedProducts from '@/components/relatedProducts/relatedProducts.vue'
-import { GETGENERATEFOEM, GETTABLELIST, URL_OEDERUPDATE } from '@/pages/order/api';
+import { GETGENERATEFOEM, URL_OEDERUPDATE } from '@/pages/order/api';
 import { formatDate } from '@/utils/times';
+import { GETTABLELIST } from '@/pages/product/api';
 
 const emits = defineEmits(['refreshData']);
 const globalPopup = inject<GlobalPopup>('globalPopup')

+ 32 - 27
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/ProductController.java

@@ -16,6 +16,7 @@ import org.springframework.web.multipart.MultipartFile;
 
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
+import java.time.LocalDateTime;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
@@ -99,13 +100,18 @@ public class ProductController {
             msg.setError("产品编码为["+product.getProductCode()+"]的产品已存在");
             return msg;
         }
+        Integer id = product.getId();
+        if(!productService.saveOrUpdate(product)){
+            msg.setError("验证失败");
+            return msg;
+        }
         //todo:生成操作记录
         AuditLogCenter auditLogCenter =new AuditLogCenter();
         auditLogCenter.setAuditorId(user.getId());
         auditLogCenter.setAuditorName(user.getName());
         auditLogCenter.setModuleId(product.getId());
         auditLogCenter.setModuleCode("Product");
-        if(product.getId()==null){
+        if(id==null){
             auditLogCenter.setAuditorContent("创建了产品");
             auditLogCenterService.save(auditLogCenter);
         }else {
@@ -119,10 +125,6 @@ public class ProductController {
             }
 
         }
-        if(!productService.saveOrUpdate(product)){
-            msg.setError("验证失败");
-            return msg;
-        }
         return msg;
     }
 
@@ -155,6 +157,7 @@ public class ProductController {
                 List<Product> productList = productService.list(new LambdaQueryWrapper<Product>().in(Product::getId, idList));
                 productList.forEach(p->{
                     p.setIsDelete(1);
+                    p.setUpdateTime(LocalDateTime.now());
                 });
                 if(!productService.updateBatchById(productList)){
                     msg.setError("验证失败");
@@ -316,6 +319,7 @@ public class ProductController {
         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());
+        businessOpportunityIds.add(-1);
         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();
@@ -379,29 +383,30 @@ public class ProductController {
             String[] idsSplit = ids.split(",");
             List<String> splitList = Arrays.asList(idsSplit);
             List<Integer> idList = splitList.stream().map(i -> Integer.valueOf(i)).collect(Collectors.toList());
-            idList.add(-1);
-            List<Product> productList = productService.list(new LambdaQueryWrapper<Product>().in(Product::getId, idList));
-            if(productList.size()>0){
-                productList.forEach(p->{
-                    p.setIsDelete(0);
-                });
-                productService.updateBatchById(productList);
-            }
-            List<AuditLogCenter> auditLogCenters =new ArrayList<>();
             if(idList.size()>0){
-                idList.forEach(i->{
-                    //todo: 生成操作记录
-                    AuditLogCenter auditLogCenter =new AuditLogCenter();
-                    auditLogCenter.setAuditorContent("恢复了产品");
-                    auditLogCenter.setAuditorId(user.getId());
-                    auditLogCenter.setAuditorName(user.getName());
-                    auditLogCenter.setModuleId(Integer.valueOf(i));
-                    auditLogCenter.setModuleCode("Product");
-                    auditLogCenters.add(auditLogCenter);
-                });
-            }
-            if(auditLogCenters.size()>0){
-                auditLogCenterService.saveBatch(auditLogCenters);
+                List<Product> productList = productService.list(new LambdaQueryWrapper<Product>().in(Product::getId, idList));
+                if(productList.size()>0){
+                    productList.forEach(p->{
+                        p.setIsDelete(0);
+                    });
+                    productService.updateBatchById(productList);
+                }
+                List<AuditLogCenter> auditLogCenters =new ArrayList<>();
+                if(idList.size()>0){
+                    idList.forEach(i->{
+                        //todo: 生成操作记录
+                        AuditLogCenter auditLogCenter =new AuditLogCenter();
+                        auditLogCenter.setAuditorContent("恢复了产品");
+                        auditLogCenter.setAuditorId(user.getId());
+                        auditLogCenter.setAuditorName(user.getName());
+                        auditLogCenter.setModuleId(Integer.valueOf(i));
+                        auditLogCenter.setModuleCode("Product");
+                        auditLogCenters.add(auditLogCenter);
+                    });
+                }
+                if(auditLogCenters.size()>0){
+                    auditLogCenterService.saveBatch(auditLogCenters);
+                }
             }
         }
         return msg;

+ 40 - 27
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/SalesOrderController.java

@@ -20,6 +20,7 @@ import org.springframework.web.multipart.MultipartFile;
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import java.math.BigDecimal;
+import java.time.LocalDateTime;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
@@ -89,7 +90,15 @@ public class SalesOrderController {
         Integer companyId = user.getCompanyId();
         order.setCompanyId(companyId);
         order.setCreatorId(user.getId());
-        if(order.getPrice()!=null){
+        if(order.getReceivedPayment()!=null){
+            BigDecimal price = order.getPrice();
+            if(order.getPrice().doubleValue()!=order.getReceivedPayment().doubleValue()){
+                order.setReceivedStatus(1);
+            }else {
+                order.setReceivedStatus(2);
+            }
+            order.setUnReceivedPayment(price.subtract(order.getReceivedPayment()));
+        }else {
             order.setUnReceivedPayment(order.getPrice());
         }
         int countCode;
@@ -109,13 +118,18 @@ public class SalesOrderController {
             msg.setError("订单名称为["+order.getOrderName()+"]的订单已存在");
             return msg;
         }
+        Integer id = order.getId();
+        if(!salesOrderService.saveOrUpdate(order)){
+            msg.setError("验证失败");
+            return msg;
+        }
         //todo:生成操作记录
         AuditLogCenter auditLogCenter =new AuditLogCenter();
         auditLogCenter.setAuditorId(user.getId());
         auditLogCenter.setAuditorName(user.getName());
         auditLogCenter.setModuleId(order.getId());
         auditLogCenter.setModuleCode("SalesOrder");;
-        if(order.getId()==null){
+        if(id==null){
             auditLogCenter.setAuditorContent("创建了订单");
             auditLogCenterService.save(auditLogCenter);
         }else {
@@ -129,10 +143,6 @@ public class SalesOrderController {
             }
 
         }
-        if(!salesOrderService.saveOrUpdate(order)){
-            msg.setError("验证失败");
-            return msg;
-        }
         //处理订单下的产品数据
         if(!StringUtils.isEmpty(order.getOrderProductDetailString())){
             String orderProductDetailString = order.getOrderProductDetailString();
@@ -209,6 +219,7 @@ public class SalesOrderController {
             }
             orderList.forEach(o->{
                 o.setIsDelete(1);
+                o.setUpdateTime(LocalDateTime.now());
             });
             if(!salesOrderService.updateBatchById(orderList)){
                 msg.setError("验证失败");
@@ -266,29 +277,31 @@ public class SalesOrderController {
             String[] idSplit = ids.split(",");
             List<String> splitList = Arrays.asList(idSplit);
             List<Integer> idList = splitList.stream().map(s -> Integer.valueOf(s)).collect(Collectors.toList());
-            List<SalesOrder> orderList = salesOrderService.list(new LambdaQueryWrapper<SalesOrder>().in(SalesOrder::getId, idList));
-            orderList.forEach(o->{
-                o.setIsDelete(0);
-            });
-            if(!salesOrderService.updateBatchById(orderList)){
-                msg.setError("验证失败");
-                return msg;
-            }
-            List<AuditLogCenter> auditLogCenters =new ArrayList<>();
             if(idList.size()>0){
-                idList.forEach(i->{
-                    //todo: 生成操作记录
-                    AuditLogCenter auditLogCenter =new AuditLogCenter();
-                    auditLogCenter.setAuditorContent("恢复了订单");
-                    auditLogCenter.setAuditorId(user.getId());
-                    auditLogCenter.setAuditorName(user.getName());
-                    auditLogCenter.setModuleId(Integer.valueOf(i));
-                    auditLogCenter.setModuleCode("SalesOrder");
-                    auditLogCenters.add(auditLogCenter);
+                List<SalesOrder> orderList = salesOrderService.list(new LambdaQueryWrapper<SalesOrder>().in(SalesOrder::getId, idList));
+                orderList.forEach(o->{
+                    o.setIsDelete(0);
                 });
-            }
-            if(auditLogCenters.size()>0){
-                auditLogCenterService.saveBatch(auditLogCenters);
+                if(!salesOrderService.updateBatchById(orderList)){
+                    msg.setError("验证失败");
+                    return msg;
+                }
+                List<AuditLogCenter> auditLogCenters =new ArrayList<>();
+                if(idList.size()>0){
+                    idList.forEach(i->{
+                        //todo: 生成操作记录
+                        AuditLogCenter auditLogCenter =new AuditLogCenter();
+                        auditLogCenter.setAuditorContent("恢复了订单");
+                        auditLogCenter.setAuditorId(user.getId());
+                        auditLogCenter.setAuditorName(user.getName());
+                        auditLogCenter.setModuleId(Integer.valueOf(i));
+                        auditLogCenter.setModuleCode("SalesOrder");
+                        auditLogCenters.add(auditLogCenter);
+                    });
+                }
+                if(auditLogCenters.size()>0){
+                    auditLogCenterService.saveBatch(auditLogCenters);
+                }
             }
         }
         return msg;

+ 133 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/TaskController.java

@@ -14,8 +14,10 @@ import com.management.platform.entity.dto.TaskDto;
 import com.management.platform.entity.vo.SysRichFunction;
 import com.management.platform.mapper.*;
 import com.management.platform.service.*;
+import com.management.platform.util.DateTimeUtil;
 import com.management.platform.util.HttpRespMsg;
 import com.management.platform.util.MessageUtils;
+import com.management.platform.util.WorkDayCalculateUtils;
 import com.taobao.api.internal.mapping.ApiField;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.poi.ss.formula.functions.T;
@@ -36,6 +38,7 @@ import java.time.Duration;
 import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
+import java.time.temporal.ChronoUnit;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -55,6 +58,10 @@ public class TaskController {
     private HttpServletRequest request;
     @Resource
     private TaskService taskService;
+    @Resource
+    private InformationService informationService;
+    @Resource
+    private TaskInformationService taskInformationService;
 
 
 
@@ -134,5 +141,131 @@ public class TaskController {
 
     }
 
+    /**
+     * 消息提醒
+     */
+//    @Scheduled(cron = "0 8 * * * ?")
+    public void InfoMationAlerts(){
+        log.info("定时执行了===========>");
+        QueryWrapper<Task> taskQueryWrapper = new QueryWrapper<>();
+        //应该不用考虑任务的状态
+        taskQueryWrapper.eq("is_delete",0).eq("is_repeat",1);
+        List<Task> list = taskService.list(taskQueryWrapper);
+        if (!list.isEmpty()){
+            for (Task task : list) {
+                List<String> executorIdList=new ArrayList<>();
+                String executorId = task.getExecutorId();
+                if (!StringUtils.isEmpty(executorId)){
+                    String[] split = executorId.split(",");
+                    executorIdList = Arrays.asList(split);
+                }
+
+//                重复类型 :每天:0、每周:1、每月:2、自定义周期:3、自定义日期:4
+                if (task.getRepeatType()!=null&&task.getRepeatType()==0){
+                    //获取任务重复结束 重复永不结束   1:勾选
+                    if (task.getRepeatEndNever()!=null&&task.getRepeatEndNever()==1){
+                        saveInformationList(executorIdList);
+                    }else if (task.getRepeatEndCount()!=null&&task.getRepeatEndCount()>0){
+                        TaskInformation taskInformation = selectTaskInformation(task);
+                        int between = task.getRepeatEndCount();
+                        saveInformationListWithCount(task, taskInformation, between, executorIdList);
+                    }else if (task.getRepeatEndDate()!=null){
+                        TaskInformation taskInformation = selectTaskInformation(task);
+                        if (LocalDateTime.now().isAfter(task.getRepeatEndDate())){
+                            continue;
+                        }
+                        int between = (int) ChronoUnit.DAYS.between(LocalDateTime.now(), task.getRepeatEndDate());
+                        saveInformationListWithCount(task, taskInformation, between, executorIdList);
+                    }
+                }
+                //每周
+                else if (task.getRepeatType() != null && task.getRepeatType() == 1) {
+                    //获取任务重复结束 重复永不结束   1:勾选
+                    //每周一才执行
+                    if (LocalDateTime.now().getDayOfWeek().getValue()==1){
+                        if (task.getRepeatEndNever()!=null&&task.getRepeatEndNever()==1){
+                            saveInformationList(executorIdList);
+                        }else if (task.getRepeatEndCount()!=null&&task.getRepeatEndCount()>0){
+                            TaskInformation taskInformation = selectTaskInformation(task);
+                            int between = task.getRepeatEndCount();
+                            saveInformationListWithCount(task, taskInformation, between, executorIdList);
+                        }else if (task.getRepeatEndDate()!=null){
+                            TaskInformation taskInformation = selectTaskInformation(task);
+                            if (LocalDateTime.now().isAfter(task.getRepeatEndDate())){
+                                continue;
+                            }
+                            int between = (int) ChronoUnit.DAYS.between(LocalDateTime.now(), task.getRepeatEndDate());
+                            between=between/7;
+                            saveInformationListWithCount(task, taskInformation, between, executorIdList);
+                        }
+                    }else {
+                        continue;
+                    }
+                }
+                //每月
+                else if (task.getRepeatType() != null && task.getRepeatType() == 2) {
+                    //获取任务重复结束 重复永不结束   1:勾选
+                    //每月一号才执行
+                    if (LocalDateTime.now().getDayOfMonth()==1){
+                        if (task.getRepeatEndNever()!=null&&task.getRepeatEndNever()==1){
+                            saveInformationList(executorIdList);
+                        }else if (task.getRepeatEndCount()!=null&&task.getRepeatEndCount()>0){
+                            TaskInformation taskInformation = selectTaskInformation(task);
+                            int between = task.getRepeatEndCount();
+                            saveInformationListWithCount(task, taskInformation, between, executorIdList);
+                        }else if (task.getRepeatEndDate()!=null){
+                            TaskInformation taskInformation = selectTaskInformation(task);
+                            if (LocalDateTime.now().isAfter(task.getRepeatEndDate())){
+                                continue;
+                            }
+                            int between = (int) ChronoUnit.DAYS.between(LocalDateTime.now(), task.getRepeatEndDate());
+                            between=between/30;
+                            saveInformationListWithCount(task, taskInformation, between, executorIdList);
+                        }
+                    }else {
+                        continue;
+                    }
+                }
+            }
+        }
+    }
+
+    private TaskInformation selectTaskInformation(Task task) {
+        LambdaQueryWrapper<TaskInformation> lqw = new LambdaQueryWrapper<>();
+        lqw.eq(TaskInformation::getTaskId, task.getId()).eq(TaskInformation::getCompanyId, task.getCompanyId());
+        return taskInformationService.getOne(lqw);
+    }
+
+    private void saveInformationListWithCount(Task task, TaskInformation taskInformation, int between, List<String> executorIdList) {
+        if (taskInformation ==null){
+            TaskInformation taskInformationNew = new TaskInformation();
+            taskInformationNew.setTaskId(task.getId())
+                    .setCompanyId(task.getCompanyId()).setCount(between -1);
+            taskInformationService.save(taskInformationNew);
+            saveInformationList(executorIdList);
+        }else {
+            Integer count = taskInformation.getCount();
+            if (count>0){
+                count -= 1;
+                UpdateWrapper<TaskInformation> updateWrapper = new UpdateWrapper<TaskInformation>().set("count", count).eq("id", taskInformation.getId());
+                taskInformationService.update(updateWrapper);
+                saveInformationList(executorIdList);
+            }
+        }
+    }
+
+    private void saveInformationList(List<String> executorIdList) {
+        if (!executorIdList.isEmpty()){
+            ArrayList<Information> informationArrayList = new ArrayList<>();
+            for (String userId : executorIdList) {
+                Information information = new Information();
+                information.setUserId(userId).setMsg("任务提醒")
+                        .setTime(LocalDateTime.now()).setChecked(0);
+                informationArrayList.add(information);
+            }
+            informationService.saveBatch(informationArrayList);
+        }
+    }
+
 }
 

+ 21 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/TaskInformationController.java

@@ -0,0 +1,21 @@
+package com.management.platform.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ * 提示消息 前端控制器
+ * </p>
+ *
+ * @author Seyason
+ * @since 2024-07-04
+ */
+@RestController
+@RequestMapping("/task-information")
+public class TaskInformationController {
+
+}
+

+ 2 - 2
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/AuditLogCenter.java

@@ -47,8 +47,8 @@ public class AuditLogCenter extends Model<AuditLogCenter> {
      * 操作时间
      */
     @TableField("audit_time")
-    @JsonFormat(pattern = "yyyy-MM-dd")
-    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
     private LocalDateTime auditTime;
 
     /**

+ 2 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/Product.java

@@ -150,6 +150,8 @@ public class Product extends Model<Product> {
     private Integer isDelete;
 
     @TableField("update_time")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private LocalDateTime updateTime;
 
     @TableField(exist = false)

+ 57 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/TaskInformation.java

@@ -0,0 +1,57 @@
+package com.management.platform.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableField;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 提示消息
+ * </p>
+ *
+ * @author Seyason
+ * @since 2024-07-04
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+public class TaskInformation extends Model<TaskInformation> {
+
+    private static final long serialVersionUID=1L;
+
+    /**
+     * 主键
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 任务id
+     */
+    @TableField("task_id")
+    private Integer taskId;
+
+    /**
+     * 公司id
+     */
+    @TableField("company_id")
+    private Integer companyId;
+
+    /**
+     * 还要重复多少次:-1代表结束了
+     */
+    @TableField("count")
+    private Integer count;
+
+
+    @Override
+    protected Serializable pkVal() {
+        return this.id;
+    }
+
+}

+ 16 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/mapper/TaskInformationMapper.java

@@ -0,0 +1,16 @@
+package com.management.platform.mapper;
+
+import com.management.platform.entity.TaskInformation;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ * 提示消息 Mapper 接口
+ * </p>
+ *
+ * @author Seyason
+ * @since 2024-07-04
+ */
+public interface TaskInformationMapper extends BaseMapper<TaskInformation> {
+
+}

+ 16 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/TaskInformationService.java

@@ -0,0 +1,16 @@
+package com.management.platform.service;
+
+import com.management.platform.entity.TaskInformation;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ * 提示消息 服务类
+ * </p>
+ *
+ * @author Seyason
+ * @since 2024-07-04
+ */
+public interface TaskInformationService extends IService<TaskInformation> {
+
+}

+ 3 - 3
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/ProductServiceImpl.java

@@ -389,20 +389,20 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
             }
             if(importProductList.size()>0){
                if(!saveOrUpdateBatch(importProductList)){
-                   msg.setError("验证失败");
+                   msg.setError("验证失败,请检验数据格式是否正确");
                    return msg;
                }
             }
         } catch (IOException | NoSuchMethodException e) {
             e.printStackTrace();
-            msg.setError("验证失败");
+            msg.setError("验证失败,请检验数据格式是否正确");
         } catch (IllegalAccessException e) {
             e.printStackTrace();
         } catch (InvocationTargetException e) {
             e.printStackTrace();
         } catch (Exception e) {
             e.printStackTrace();
-            msg.setError("验证失败");
+            msg.setError("验证失败,请检验数据格式是否正确");
             return msg;
         }
         return msg;

+ 33 - 3
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/SalesOrderServiceImpl.java

@@ -560,20 +560,20 @@ public class SalesOrderServiceImpl extends ServiceImpl<SalesOrderMapper, SalesOr
             }
             if(importOrderList.size()>0){
                 if(!saveOrUpdateBatch(importOrderList)){
-                    msg.setError("验证失败");
+                    msg.setError("验证失败,请检验数据格式是否正确");
                     return msg;
                 }
             }
         } catch (IOException | NoSuchMethodException e) {
             e.printStackTrace();
-            msg.setError("验证失败");
+            msg.setError("验证失败,请检验数据格式是否正确");
         } catch (IllegalAccessException e) {
             e.printStackTrace();
         } catch (InvocationTargetException e) {
             e.printStackTrace();
         } catch (Exception e) {
             e.printStackTrace();
-            msg.setError("验证失败");
+            msg.setError("验证失败,请检验数据格式是否正确");
         }
         return msg;
     }
@@ -630,6 +630,21 @@ public class SalesOrderServiceImpl extends ServiceImpl<SalesOrderMapper, SalesOr
                                     value = String.valueOf(aClass.getMethod("getInchargerName").invoke(salesOrder));
                                 }
                             }
+                            if(model.equals("customId")){
+                                value = String.valueOf(aClass.getMethod("getCustomName").invoke(salesOrder));
+                            }
+                            if(model.equals("businessOpportunityId")){
+                                value = String.valueOf(aClass.getMethod("getBusinessOpportunityName").invoke(salesOrder));
+                            }
+                            if(model.equals("customSigner")){
+                                value = String.valueOf(aClass.getMethod("getCustomSignerName").invoke(salesOrder)==null?"":aClass.getMethod("getCustomSignerName").invoke(salesOrder));
+                            }
+                            if(model.equals("companySigner")){
+                                value = String.valueOf(aClass.getMethod("getCompanySignerName").invoke(salesOrder)==null?"":aClass.getMethod("getCompanySignerName").invoke(salesOrder));
+                            }
+                            if(model.equals("type")){
+                                value = String.valueOf(aClass.getMethod("getTypeName").invoke(salesOrder));
+                            }
                             item.add(value);
                         }
                     }
@@ -645,6 +660,21 @@ public class SalesOrderServiceImpl extends ServiceImpl<SalesOrderMapper, SalesOr
                             value = String.valueOf(aClass.getMethod("getInchargerName").invoke(salesOrder));
                         }
                     }
+                    if(model.equals("customId")){
+                        value = String.valueOf(aClass.getMethod("getCustomName").invoke(salesOrder));
+                    }
+                    if(model.equals("businessOpportunityId")){
+                        value = String.valueOf(aClass.getMethod("getBusinessOpportunityName").invoke(salesOrder));
+                    }
+                    if(model.equals("customSigner")){
+                        value = String.valueOf(aClass.getMethod("getCustomSignerName").invoke(salesOrder)==null?"":aClass.getMethod("getCustomSignerName").invoke(salesOrder));
+                    }
+                    if(model.equals("companySigner")){
+                        value = String.valueOf(aClass.getMethod("getCompanySignerName").invoke(salesOrder)==null?"":aClass.getMethod("getCompanySignerName").invoke(salesOrder));
+                    }
+                    if(model.equals("type")){
+                        value = String.valueOf(aClass.getMethod("getTypeName").invoke(salesOrder));
+                    }
                     item.add(value);
                 }
             }

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

@@ -0,0 +1,20 @@
+package com.management.platform.service.impl;
+
+import com.management.platform.entity.TaskInformation;
+import com.management.platform.mapper.TaskInformationMapper;
+import com.management.platform.service.TaskInformationService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 提示消息 服务实现类
+ * </p>
+ *
+ * @author Seyason
+ * @since 2024-07-04
+ */
+@Service
+public class TaskInformationServiceImpl extends ServiceImpl<TaskInformationMapper, TaskInformation> implements TaskInformationService {
+
+}

+ 24 - 4
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/TaskServiceImpl.java

@@ -563,16 +563,36 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
                     else if(modelName.equals("startDate")){
                         if(cell != null && cell.getCellTypeEnum() != CellType.BLANK){
                             if(!StringUtils.isEmpty(cell.getStringCellValue())){
-                                DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
-                                task.setStartDate(LocalDateTime.parse(cell.getStringCellValue(),df));
+                                try {
+                                     int count = Integer.parseInt(cell.getStringCellValue());
+                                    // Excel中的日期序列号的基准日期是1900年1月1日
+                                    LocalDate baseDate = LocalDate.of(1900, 1, 1);
+                                    LocalDate date = baseDate.plusDays(count - 2); // Excel的基准日期是1900年1月0日,所以需要减去2天
+                                    task.setStartDate(date.atStartOfDay());
+
+                                } catch (Exception e) {
+                                    System.out.println("日期时间格式不正确,应该是yyyy/MM/dd" );
+                                    msg.setError("日期时间格式不正确,应该是yyyy/MM/dd");
+                                    return msg;
+                                }
                             }
                         }
                     }
                     else if(modelName.equals("endDate")){
                         if(cell != null && cell.getCellTypeEnum() != CellType.BLANK){
                             if(!StringUtils.isEmpty(cell.getStringCellValue())){
-                                DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
-                                task.setEndDate(LocalDateTime.parse(cell.getStringCellValue(),df));
+                                try {
+                                    int count = Integer.parseInt(cell.getStringCellValue());
+                                    // Excel中的日期序列号的基准日期是1900年1月1日
+                                    LocalDate baseDate = LocalDate.of(1900, 1, 1);
+                                    LocalDate date = baseDate.plusDays(count - 2); // Excel的基准日期是1900年1月0日,所以需要减去2天
+                                    task.setEndDate(date.atStartOfDay());
+
+                                } catch (Exception e) {
+                                    System.out.println("日期时间格式不正确,应该是yyyy/MM/dd" );
+                                    msg.setError("日期时间格式不正确,应该是yyyy/MM/dd");
+                                    return msg;
+                                }
                             }
                         }
                     }

+ 18 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/TaskInformationMapper.xml

@@ -0,0 +1,18 @@
+<?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.management.platform.mapper.TaskInformationMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.management.platform.entity.TaskInformation">
+        <id column="id" property="id" />
+        <result column="task_id" property="taskId" />
+        <result column="company_id" property="companyId" />
+        <result column="count" property="count" />
+    </resultMap>
+
+    <!-- 通用查询结果列 -->
+    <sql id="Base_Column_List">
+        id, task_id, company_id, count
+    </sql>
+
+</mapper>

+ 1 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/TaskController.java

@@ -189,7 +189,7 @@ public class TaskController {
             if(user.getCompanyId()==3092){
                 Project project = projectService.getById(task.getProjectId());
                 //除了报价项目  售后报价项目和研发项目不管控  其它项目都管控
-                if(task.getGroupId()!=null&&(project.getCategory()!=null && !(project.getCategory()==644 || project.getCategory()==647 || project.getCategory()==697))){
+                if(task.getGroupId()!=null&&(project.getCategory()!=null && !(project.getCategory()==644 || project.getCategory()==647 || project.getCategory()==697 ||project.getCategory()==804 ))){
                     TaskGroup taskGroup = taskGroupService.getById(task.getGroupId());
                     if(taskGroup.getManDay()==null){
                         msg.setError("创建失败,请先分配任务分组的预估工时");

+ 2 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/ProjectMapper.xml

@@ -1921,7 +1921,7 @@
         left join task t on t.id=te.task_id
         left join project p on p.id=t.project_id
         left join project_category pc on pc.id=p.category
-        where u.company_id=#{companyId} and te.project_id is not null  and pc.name not in ('报价项目','售后报价项目','研发项目')
+        where u.company_id=#{companyId} and te.project_id is not null  and pc.name not in ('报价项目','售后报价项目','研发项目','运维项目')
         <if test="projectId!=null">
             and p.id=#{projectId}
         </if>
@@ -1952,7 +1952,7 @@
         left join task t on t.id=te.task_id
         left join project p on p.id=t.project_id
         left join project_category pc on pc.id=p.category
-        where u.company_id=#{companyId} and te.project_id is not null  and pc.name not in ('报价项目','售后报价项目','研发项目')
+        where u.company_id=#{companyId} and te.project_id is not null  and pc.name not in ('报价项目','售后报价项目','研发项目','运维项目')
         <if test="projectId!=null">
             and p.id=#{projectId}
         </if>