Browse Source

Merge branch 'master' of http://47.100.37.243:10191/wutt/manHourHousekeeper

douhl 1 year ago
parent
commit
e4bda555a0

+ 30 - 0
fhKeeper/formulahousekeeper/customerBuler-crm/src/components/TaskModal/taskFunction.ts

@@ -0,0 +1,30 @@
+import { dayjs } from 'element-plus';
+import { post } from "@/utils/request";
+import { getFromValue } from '@/utils/tools';
+import { ADD_TASK } from '@/pages/tasks/api';
+
+// 封装新建任务请求
+export async function createTask(submitData: any, isClose: boolean) : Promise<TaskResponse> {
+    return new Promise((resolve, reject) => {
+        const { executorId, startDate, endDate, repeatEndDate } = submitData;
+        let params = {
+            ...submitData,
+            startDate: startDate && dayjs(startDate).format('YYYY-MM-DD 00:00:00'),
+            endDate: endDate && dayjs(endDate).format('YYYY-MM-DD 23:59:59'),
+            repeatEndDate: repeatEndDate && dayjs(repeatEndDate).format('YYYY-MM-DD 23:59:59')
+        }
+        if (executorId) {
+            params = {
+                ...params,
+                executorId: executorId.join(','),
+                taskLogs: []
+            }
+        }
+
+        post(ADD_TASK, getFromValue(params)).then(() => {
+            resolve({ saveLoading: '3', isClose })
+        }).catch((err) => {
+            reject({ saveLoading: '4', isClose, message: err.message })
+        })
+    })
+}

+ 1 - 1
fhKeeper/formulahousekeeper/customerBuler-crm/src/components/TaskModal/type.d.ts

@@ -50,4 +50,4 @@ export interface Emits {
    * @param isClose 是否关闭弹窗
    * @param isClose 是否关闭弹窗
    */
    */
   (event: "submit", submitData: Object, isClose: boolean): void;
   (event: "submit", submitData: Object, isClose: boolean): void;
-}
+}

+ 1 - 0
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/api.ts

@@ -1,3 +1,4 @@
 export const SENDVCODE = "/user/sendVcode";     //发送验证码
 export const SENDVCODE = "/user/sendVcode";     //发送验证码
 export const REGISTER = "/user/insertCompany";  //注册
 export const REGISTER = "/user/insertCompany";  //注册
 export const LOGIN = "/user/loginAdmin";        //登录
 export const LOGIN = "/user/loginAdmin";        //登录
+export const IMPORTTIMELIST = "/sys-form/getExportTemplate" // 下载模板

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

@@ -83,7 +83,7 @@
             <el-table-column label="操作" fixed="right" width="200">
             <el-table-column label="操作" fixed="right" width="200">
               <template #default="scope">
               <template #default="scope">
                 <el-button link type="primary" size="large" @click="editShowVisible('newBusinessisible', scope.row)">编辑</el-button>
                 <el-button link type="primary" size="large" @click="editShowVisible('newBusinessisible', scope.row)">编辑</el-button>
-                <el-button link type="primary" size="large">新建任务</el-button>
+                <el-button link type="primary" size="large" @click="newTask(scope.row)">新建任务</el-button>
                 <el-button link type="danger" size="large">删除</el-button>
                 <el-button link type="danger" size="large">删除</el-button>
               </template>
               </template>
             </el-table-column>
             </el-table-column>
@@ -116,6 +116,10 @@
         <RelatedProducts ref="relatedProductsRef" :productTableList="productTableList" />
         <RelatedProducts ref="relatedProductsRef" :productTableList="productTableList" />
       </div>
       </div>
     </el-dialog>
     </el-dialog>
+
+    <!-- 新建任务 -->
+    <TaskModal :visible="allVisible.taskModalVisible" :edit-form="taskModalForm" :save-loading="taskLoading"
+      @close="closeVisible('taskModalVisible')" @submit="submitForm" :title="'新建任务'" :disabled-list="['taskType', 'businessOpportunityId']" />
   </div>
   </div>
 </template>
 </template>
 
 
@@ -126,10 +130,12 @@ import { useRouter, useRoute } from "vue-router";
 import { GETSYSFILED, MOD, GETPERSONNEL, GETGENERATEFOEM, GETBUSINESSLIST, UPDATEINSET } from './api'
 import { GETSYSFILED, MOD, GETPERSONNEL, GETGENERATEFOEM, GETBUSINESSLIST, UPDATEINSET } from './api'
 import { GETTABLELIST } from '@/pages/product/api'
 import { GETTABLELIST } from '@/pages/product/api'
 import { post, get } from "@/utils/request";
 import { post, get } from "@/utils/request";
-import { getAllListByCode, getFromValue, resetFromValue, getFirstDayOfMonth, getLastDayOfMonth, formatDate } from '@/utils/tools'
+import { getAllListByCode, getFromValue, resetFromValue, getFirstDayOfMonth, createTaskFromType, formatDate } from '@/utils/tools'
+import { createTask } from '@/components/TaskModal/taskFunction'
 import { formatDateTime } from '@/utils/times'
 import { formatDateTime } from '@/utils/times'
 import { GenerateForm } from '@zmjs/form-design';
 import { GenerateForm } from '@zmjs/form-design';
 import RelatedProducts from './component/relatedProducts.vue'
 import RelatedProducts from './component/relatedProducts.vue'
+import TaskModal from '@/components/TaskModal/index.vue'
 
 
 const route = useRoute()
 const route = useRoute()
 const router = useRouter()
 const router = useRouter()
@@ -150,11 +156,15 @@ const allLoading = reactive({
 const allVisible = reactive({
 const allVisible = reactive({
   newBusinessisible: false,
   newBusinessisible: false,
   recycleVisible: false,
   recycleVisible: false,
+  taskModalVisible: false
 })
 })
 const allText = reactive({
 const allText = reactive({
   newBusinessisibleText: '新建商机'
   newBusinessisibleText: '新建商机'
 }) // 所有文本
 }) // 所有文本
 
 
+const taskModalForm = ref({}) // 任务弹窗表单
+const taskLoading = ref<saveLoadingType>("1");
+
 const businessOpportunityForm = reactive<businessOpportunityFormType>({
 const businessOpportunityForm = reactive<businessOpportunityFormType>({
   name: '',
   name: '',
   stageId: '',
   stageId: '',
@@ -201,6 +211,27 @@ function editShowVisible(type: keyof typeof allVisible, item: any) {
   showVisible(type)
   showVisible(type)
 }
 }
 
 
+function newTask(item: any) {
+  const { id } = item
+  taskModalForm.value = { ...createTaskFromType(1), businessOpportunityId: id, }
+  showVisible('taskModalVisible')
+}
+
+function submitForm(submitData: any, isClose: boolean) { // 任务提交
+  taskLoading.value = '2'
+  createTask(submitData, isClose).then((res) => {
+    const { saveLoading, isClose } = res
+    taskLoading.value = saveLoading
+    allVisible.taskModalVisible = isClose
+    globalPopup?.showSuccess('新增成功')
+  }).catch((err) => {
+    const { saveLoading, isClose, message } = err
+    taskLoading.value = saveLoading
+    allVisible.taskModalVisible = isClose
+    globalPopup?.showSuccess(message)
+  })
+}
+
 function showVisible(type: keyof typeof allVisible) { // 显示弹窗
 function showVisible(type: keyof typeof allVisible) { // 显示弹窗
   allVisible[type] = true
   allVisible[type] = true
 }
 }

+ 7 - 1
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/product/api.ts

@@ -16,8 +16,14 @@ export const GETDETAIL = `${prefix}/detail`
 export const GETINCHARGER = `${prefix}/transferIncharger`
 export const GETINCHARGER = `${prefix}/transferIncharger`
 export const GETBUSINESS = `${prefix}/businessListWithProduct`
 export const GETBUSINESS = `${prefix}/businessListWithProduct`
 export const GETORDER = `${prefix}/orderWithProduct`
 export const GETORDER = `${prefix}/orderWithProduct`
+export const EXPORTTIME = `${prefix}/exportData`
 export const UPLOADATTACHMENT = `/attachment/uploadAttachment`
 export const UPLOADATTACHMENT = `/attachment/uploadAttachment`
 export const GETCENTERLIST = `/audit-log-center/list`
 export const GETCENTERLIST = `/audit-log-center/list`
 export const GETATTACHMENT = `/attachment/attachmentList`
 export const GETATTACHMENT = `/attachment/attachmentList`
 export const FILEDETELE = `/attachment/delete`
 export const FILEDETELE = `/attachment/delete`
-export const FILERENAME = `/attachment/rename`
+export const FILERENAME = `/attachment/rename`
+
+export const SELECTSTATUS = [
+    { value: 1, label: '上架' },
+    { value: 0, label: '下架' } 
+]

+ 24 - 6
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/product/index.vue

@@ -15,6 +15,11 @@
                 <el-option v-for="item in fixedData.ProductType" :key="item.id" :label="item.name" :value="item.id" />
                 <el-option v-for="item in fixedData.ProductType" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>
               </el-select>
             </el-form-item>
             </el-form-item>
+            <el-form-item label="状态">
+              <el-select v-model="filterProductForm.status" placeholder="请选择">
+                <el-option v-for="item in fixedData.Personnel" :key="item.id" :label="item.name" :value="item.id" />
+              </el-select>
+            </el-form-item>
             <el-form-item label="负责人">
             <el-form-item label="负责人">
               <el-select v-model="filterProductForm.userId" placeholder="请选择">
               <el-select v-model="filterProductForm.userId" placeholder="请选择">
                 <el-option v-for="item in fixedData.Personnel" :key="item.id" :label="item.name" :value="item.id" />
                 <el-option v-for="item in fixedData.Personnel" :key="item.id" :label="item.name" :value="item.id" />
@@ -43,7 +48,7 @@
           <el-button type="primary" @click="batchDelete()">批量删除</el-button>
           <el-button type="primary" @click="batchDelete()">批量删除</el-button>
           <el-button type="primary" @click="showDeteleProduct(true)">回收站</el-button>
           <el-button type="primary" @click="showDeteleProduct(true)">回收站</el-button>
           <el-button type="primary" @click="dialogVisible.importVisible = true">导入</el-button>
           <el-button type="primary" @click="dialogVisible.importVisible = true">导入</el-button>
-          <el-button type="primary">导出</el-button>
+          <el-button type="primary" @click="exportProductTableList()" :loading="allLoading.exoprtLoading">导出</el-button>
         </div>
         </div>
         <div class="flex-1 w-full overflow-hidden">
         <div class="flex-1 w-full overflow-hidden">
           <el-table ref="productTableRef" :data="productTableList" border v-loading="allLoading.productTableLading"
           <el-table ref="productTableRef" :data="productTableList" border v-loading="allLoading.productTableLading"
@@ -118,7 +123,7 @@
       </template>
       </template>
       <div class="p-8">
       <div class="p-8">
         <div class="ml-4 mr-4">
         <div class="ml-4 mr-4">
-          <div class="flex items-center">1、点击下载 <el-link type="primary">产品导入模板.xlsx</el-link></div>
+          <div class="flex items-center">1、点击下载 <el-link type="primary" @click="downloadTemplate(MODUCODE, '产品导入模板.xlsx')">产品导入模板.xlsx</el-link></div>
           <div class="mt-4">2、填写excel文件、产品编号、产品名称、产品类别、标准价格、库存、状态必填</div>
           <div class="mt-4">2、填写excel文件、产品编号、产品名称、产品类别、标准价格、库存、状态必填</div>
         </div>
         </div>
       </div>
       </div>
@@ -131,8 +136,8 @@
 
 
 <script lang="ts" setup>
 <script lang="ts" setup>
 import { ref, reactive, onMounted, inject } from "vue";
 import { ref, reactive, onMounted, inject } from "vue";
-import { GETSYSFILED, MOD, GETPERSONNEL, GETTEMPLATE, GETTABLELIST, ADDPRODUCT, ALLDETELE, UPLOADFILE } from './api'
-import { getAllListByCode, getFromValue, resetFromValue, getFirstDayOfMonth, getLastDayOfMonth, formatDate, createTaskFromType, confirmAction } from '@/utils/tools'
+import { GETSYSFILED, MOD, MODUCODE, GETPERSONNEL, GETTEMPLATE, GETTABLELIST, ADDPRODUCT, ALLDETELE, UPLOADFILE, EXPORTTIME } from './api'
+import { getAllListByCode, getFromValue, resetFromValue, getFirstDayOfMonth, downloadFile, formatDate, createTaskFromType, confirmAction, downloadTemplate } from '@/utils/tools'
 import { FormInstance, FormRules, ElMessageBox, ElTable, UploadRequestOptions } from 'element-plus'
 import { FormInstance, FormRules, ElMessageBox, ElTable, UploadRequestOptions } from 'element-plus'
 import { post, get, uploadFile } from "@/utils/request";
 import { post, get, uploadFile } from "@/utils/request";
 import { useRouter, useRoute } from "vue-router";
 import { useRouter, useRoute } from "vue-router";
@@ -151,12 +156,14 @@ const filterProductForm = reactive<filterProductFormType>({ // 筛选条件form
   pageSize: 10,
   pageSize: 10,
   id: '',
   id: '',
   type: '',
   type: '',
+  status: '',
 })
 })
 const allLoading = reactive({
 const allLoading = reactive({
   productTableLading: false,
   productTableLading: false,
   generateFormLading: false,
   generateFormLading: false,
   saveLoading: false,
   saveLoading: false,
-  importLoading: false
+  importLoading: false,
+  exoprtLoading: false
 })
 })
 const dialogVisible = reactive({
 const dialogVisible = reactive({
   editProductVisible: false,
   editProductVisible: false,
@@ -272,12 +279,23 @@ async function importProducts(param: UploadRequestOptions) {
   const res = await uploadFile(UPLOADFILE, formData)
   const res = await uploadFile(UPLOADFILE, formData)
   allLoading.importLoading = false
   allLoading.importLoading = false
   if (res.code == 'ok') {
   if (res.code == 'ok') {
-    globalPopup?.showSuccess(res.msg || '')
+    globalPopup?.showSuccess('导入成功' || '')
+    getProductTableList()
     return
     return
   }
   }
   globalPopup?.showError(res.msg || '')
   globalPopup?.showError(res.msg || '')
 }
 }
 
 
+function exportProductTableList() {
+  allLoading.exoprtLoading = true
+  let valueForm = getFromValue(filterProductForm)
+  post(EXPORTTIME, {...valueForm}).then((res) => {
+    downloadFile(res.data, '产品表导出.xlsx')
+  }).finally(() => {
+    allLoading.exoprtLoading = false
+  })
+}
+
 function handleSizeChange(val: number) {
 function handleSizeChange(val: number) {
   filterProductForm.pageIndex = 1
   filterProductForm.pageIndex = 1
   filterProductForm.pageSize = val
   filterProductForm.pageSize = val

+ 2 - 1
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/product/type.d.ts

@@ -7,5 +7,6 @@ interface filterProductFormType {
     type: string | number,
     type: string | number,
     id: string | number,
     id: string | number,
     startTime: string,
     startTime: string,
-    endTime: string
+    endTime: string,
+    status: any
 }
 }

+ 3 - 1
fhKeeper/formulahousekeeper/customerBuler-crm/src/type.d.ts

@@ -26,4 +26,6 @@ type saveLoadingType = "1" | "2" | "3" | "4"; //1是没有保存, 2是正在保
 type TASK_VALUE_TYPE = 0 | 1 | 2 | 3; //0是客户, 1是商机, 2是销售订单 ,3是线索
 type TASK_VALUE_TYPE = 0 | 1 | 2 | 3; //0是客户, 1是商机, 2是销售订单 ,3是线索
 type REPEAT_VALUE_TYPE = 0 | 1 | 2 | 3 | 4; //0是每天, 1是每周, 2是每月, 3是自定义周期, 4是自定义日期
 type REPEAT_VALUE_TYPE = 0 | 1 | 2 | 3 | 4; //0是每天, 1是每周, 2是每月, 3是自定义周期, 4是自定义日期
 
 
-type componentType = "success" | "info" | "warning" | "error"
+type componentType = "success" | "info" | "warning" | "error"
+
+type TaskResponse = { saveLoading: saveLoadingType, isClose: boolean, message?: string }

+ 2 - 2
fhKeeper/formulahousekeeper/customerBuler-crm/src/utils/request.ts

@@ -30,10 +30,10 @@ instance.interceptors.request.use(
 instance.interceptors.response.use(
 instance.interceptors.response.use(
   (response: AxiosResponse) => {
   (response: AxiosResponse) => {
     // 对响应数据进行处理
     // 对响应数据进行处理
-    if (response.status != 200) {
+    if (response.status !== 200 || response.data.code === 'error') {
       ElNotification.closeAll()
       ElNotification.closeAll()
       ElNotification({
       ElNotification({
-        message: showMessage(response.status), // 传入响应码,匹配响应码对应信息,
+        message: response.status !== 200 ? showMessage(response.status) : response.data.msg,
         type: "error",
         type: "error",
       });
       });
     }
     }

+ 13 - 1
fhKeeper/formulahousekeeper/customerBuler-crm/src/utils/tools.ts

@@ -1,6 +1,7 @@
 import { defalutModalForm } from "@/components/TaskModal/api";
 import { defalutModalForm } from "@/components/TaskModal/api";
 import { ElMessageBox } from "element-plus";
 import { ElMessageBox } from "element-plus";
-import { get } from "./request";
+import { IMPORTTIMELIST } from '../pages/api'
+import { get, post } from "./request";
 /**
 /**
  * 判断值是否为空
  * 判断值是否为空
  * @param value 值
  * @param value 值
@@ -203,3 +204,14 @@ export function confirmAction(
 export function backPath() {
 export function backPath() {
   window.history.go(-1);
   window.history.go(-1);
 }
 }
+
+/**
+ * 下载模板
+ * @param mod 模块名称(模板链接)
+ * @param fileName 下载的文件名称
+ */
+export function downloadTemplate(mod: any, fileName: string) {
+  post(`${IMPORTTIMELIST}`, { code: mod }).then((res: any) => {
+    downloadFile(res.data, fileName)
+  });
+}

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

@@ -64,9 +64,9 @@ public class ProductController {
     * @Date: 2024/5/21
     * @Date: 2024/5/21
     */
     */
     @RequestMapping("/list")
     @RequestMapping("/list")
-    public HttpRespMsg list(String userId,String productName,String productCode,Integer productType,Integer status,Integer pageIndex,Integer pageSize){
+    public HttpRespMsg list(String userId,String productName,String productCode,Integer productType,Integer status,String startTime,String endTime,Integer pageIndex,Integer pageSize){
         Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();
         Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();
-        return productService.getList(companyId,userId,productName,productCode,productType,status,pageIndex,pageSize);
+        return productService.getList(companyId,userId,productName,productCode,productType,status,startTime,endTime,pageIndex,pageSize);
     }
     }
 
 
     /**
     /**
@@ -197,8 +197,8 @@ public class ProductController {
     * @Date: 2024/5/21
     * @Date: 2024/5/21
     */
     */
     @RequestMapping("/exportData")
     @RequestMapping("/exportData")
-    public HttpRespMsg exportData(String userId,String productName,String productCode,Integer productType,Integer status) throws Exception {
-        return productService.exportData(userId,productName,productCode,productType,status);
+    public HttpRespMsg exportData(String userId,String productName,String productCode,Integer productType,Integer status,String startTime,String endTime) throws Exception {
+        return productService.exportData(userId,productName,productCode,productType,status,startTime,endTime);
     }
     }
 
 
     /**
     /**

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

@@ -17,11 +17,11 @@ import java.lang.reflect.InvocationTargetException;
  */
  */
 public interface ProductService extends IService<Product> {
 public interface ProductService extends IService<Product> {
 
 
-    HttpRespMsg getList(Integer companyId,String userId, String productName, String productCode,Integer productType,Integer status, Integer pageIndex, Integer pageSize);
+    HttpRespMsg getList(Integer companyId,String userId, String productName, String productCode,Integer productType,Integer status,String startDate,String endDate, Integer pageIndex, Integer pageSize);
 
 
     HttpRespMsg importData(MultipartFile multipartFile);
     HttpRespMsg importData(MultipartFile multipartFile);
 
 
-    HttpRespMsg exportData(String userId, String productName, String productCode,Integer productType,Integer status) throws Exception;
+    HttpRespMsg exportData(String userId, String productName, String productCode,Integer productType,Integer status,String startDate,String endDate) throws Exception;
 
 
     HttpRespMsg getDetail(Integer id);
     HttpRespMsg getDetail(Integer id);
 
 

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

@@ -19,6 +19,11 @@ import org.apache.poi.hssf.usermodel.HSSFRow;
 import org.apache.poi.hssf.usermodel.HSSFSheet;
 import org.apache.poi.hssf.usermodel.HSSFSheet;
 import org.apache.poi.hssf.usermodel.HSSFWorkbook;
 import org.apache.poi.hssf.usermodel.HSSFWorkbook;
 import org.apache.poi.ss.usermodel.CellType;
 import org.apache.poi.ss.usermodel.CellType;
+import org.apache.poi.xssf.streaming.SXSSFWorkbook;
+import org.apache.poi.xssf.usermodel.XSSFCell;
+import org.apache.poi.xssf.usermodel.XSSFRow;
+import org.apache.poi.xssf.usermodel.XSSFSheet;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 import org.springframework.util.StringUtils;
 import org.springframework.util.StringUtils;
@@ -30,7 +35,9 @@ import javax.servlet.http.HttpServletRequest;
 import java.io.*;
 import java.io.*;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.lang.reflect.Method;
+import java.math.BigDecimal;
 import java.time.DateTimeException;
 import java.time.DateTimeException;
+import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.time.LocalDateTime;
 import java.time.LocalTime;
 import java.time.LocalTime;
 import java.time.format.DateTimeFormatter;
 import java.time.format.DateTimeFormatter;
@@ -75,7 +82,7 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
     private AttachmentCenterMapper attachmentCenterMapper;
     private AttachmentCenterMapper attachmentCenterMapper;
 
 
     @Override
     @Override
-    public HttpRespMsg getList(Integer companyId,String userId, String productName, String productCode,Integer productType,Integer status, Integer pageIndex, Integer pageSize) {
+    public HttpRespMsg getList(Integer companyId,String userId, String productName, String productCode,Integer productType,Integer status,String startDate,String endDate, Integer pageIndex, Integer pageSize) {
         HttpRespMsg msg=new HttpRespMsg();
         HttpRespMsg msg=new HttpRespMsg();
         User targetUsr = userMapper.selectById(request.getHeader("token"));
         User targetUsr = userMapper.selectById(request.getHeader("token"));
         List<Department> departments = departmentMapper.selectList(new LambdaQueryWrapper<Department>().eq(Department::getCompanyId, companyId));
         List<Department> departments = departmentMapper.selectList(new LambdaQueryWrapper<Department>().eq(Department::getCompanyId, companyId));
@@ -133,6 +140,12 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
         if(status!=null){
         if(status!=null){
             queryWrapper.eq(Product::getStatus,status);
             queryWrapper.eq(Product::getStatus,status);
         }
         }
+        if(startDate!=null && endDate!=null){
+            DateTimeFormatter df=DateTimeFormatter.ofPattern("yyyy-MM-dd");
+            LocalDateTime start = LocalDate.parse(startDate, df).atTime(LocalTime.MIN);
+            LocalDateTime end = LocalDate.parse(endDate, df).atTime(LocalTime.MAX);
+            queryWrapper.between(Product::getCreateTime,start,end);
+        }
         if(pageIndex==null&&pageSize==null){
         if(pageIndex==null&&pageSize==null){
             pageIndex=-1;
             pageIndex=-1;
             pageSize=-1;
             pageSize=-1;
@@ -189,9 +202,9 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
             inputStream.close();
             inputStream.close();
             outputStream.close();
             outputStream.close();
             //解析表格
             //解析表格
-            HSSFWorkbook workbook = new HSSFWorkbook(new FileInputStream(file));
+            XSSFWorkbook workbook = new XSSFWorkbook(file);
             //我们只需要第一个sheet
             //我们只需要第一个sheet
-            HSSFSheet sheet = workbook.getSheetAt(0);
+            XSSFSheet sheet = workbook.getSheetAt(0);
             //由于第一行需要指明列对应的标题
             //由于第一行需要指明列对应的标题
             int rowNum = sheet.getLastRowNum();
             int rowNum = sheet.getLastRowNum();
             //获取当前表单模板 校验规则
             //获取当前表单模板 校验规则
@@ -207,7 +220,7 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
             List<String> userNameList=new ArrayList<>();
             List<String> userNameList=new ArrayList<>();
             HttpRespMsg respMsg=new HttpRespMsg();
             HttpRespMsg respMsg=new HttpRespMsg();
             for (int rowIndex = 0; rowIndex <= rowNum; rowIndex++) {
             for (int rowIndex = 0; rowIndex <= rowNum; rowIndex++) {
-                HSSFRow row = sheet.getRow(rowIndex);
+                XSSFRow row = sheet.getRow(rowIndex);
                 if (row == null) {
                 if (row == null) {
                     continue;
                     continue;
                 }
                 }
@@ -220,7 +233,7 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
                 for (int i = 0; i < cellNum; i++) {
                 for (int i = 0; i < cellNum; i++) {
                     JSONObject item = configObJSONArray.getJSONObject(i);
                     JSONObject item = configObJSONArray.getJSONObject(i);
                     String modelName = item.getString("model");
                     String modelName = item.getString("model");
-                    HSSFCell cell = row.getCell(i);
+                    XSSFCell cell = row.getCell(i);
                     if(cell!=null){
                     if(cell!=null){
                         switch (item.getString("type")){
                         switch (item.getString("type")){
                             case "time":cell.setCellType(CellType.NUMERIC);
                             case "time":cell.setCellType(CellType.NUMERIC);
@@ -245,8 +258,9 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
                 }
                 }
             }
             }
             List<User> targetUserList= (List<User>) respMsg.data;
             List<User> targetUserList= (List<User>) respMsg.data;
-            for (int rowIndex = 0; rowIndex <= rowNum; rowIndex++) {
-                HSSFRow row = sheet.getRow(rowIndex);
+            //直接忽略空行 从row1开始
+            for (int rowIndex = 1; rowIndex <= rowNum; rowIndex++) {
+                XSSFRow row = sheet.getRow(rowIndex);
                 if (row == null) {
                 if (row == null) {
                     continue;
                     continue;
                 }
                 }
@@ -265,7 +279,7 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
                     String className = modelName.substring(0, 1).toUpperCase() + modelName.substring(1);
                     String className = modelName.substring(0, 1).toUpperCase() + modelName.substring(1);
                     String getter="get"+className;
                     String getter="get"+className;
                     String setter="set"+className;
                     String setter="set"+className;
-                    HSSFCell cell = row.getCell(i);
+                    XSSFCell cell = row.getCell(i);
                     if(cell!=null){
                     if(cell!=null){
                         switch (item.getString("type")){
                         switch (item.getString("type")){
                             case "time":cell.setCellType(CellType.NUMERIC);
                             case "time":cell.setCellType(CellType.NUMERIC);
@@ -274,8 +288,6 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
                         }
                         }
                     }
                     }
 //                    Class<?> productClass = Class.forName("com.management.platform.entity.Product");
 //                    Class<?> productClass = Class.forName("com.management.platform.entity.Product");
-                    Class<Product> productClass = Product.class;
-                    Method method = productClass.getMethod(setter, String.class);
                     //校验当前列是否为必填
                     //校验当前列是否为必填
                     JSONObject options = item.getJSONObject("options");
                     JSONObject options = item.getJSONObject("options");
                     JSONObject rules = options.getJSONObject("rules");
                     JSONObject rules = options.getJSONObject("rules");
@@ -293,9 +305,9 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
                             if(first.isPresent()){
                             if(first.isPresent()){
                                 product.setId(first.get().getId());
                                 product.setId(first.get().getId());
                             }
                             }
+                            product.setProductCode(cell.getStringCellValue());
                         }
                         }
-                    }
-                    if(modelName.equals("inchargerId")){
+                    }else if(modelName.equals("inchargerId")){
                         if(!StringUtils.isEmpty(cell.getStringCellValue())){
                         if(!StringUtils.isEmpty(cell.getStringCellValue())){
                             String userName = cell.getStringCellValue();
                             String userName = cell.getStringCellValue();
                             Optional<User> first;
                             Optional<User> first;
@@ -308,11 +320,11 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
                             if (first.isPresent()) {
                             if (first.isPresent()) {
                                 product.setInchargerId(first.get().getId());
                                 product.setInchargerId(first.get().getId());
                             } else {
                             } else {
-                                throw new Exception("["+userName+"]在系统中不存在");
+                                msg.setError("["+userName+"]在系统中不存在");
+                                return msg;
                             }
                             }
                         }
                         }
-                    }
-                    if(modelName.equals("status")){
+                    }else if(modelName.equals("status")){
                         if(!StringUtils.isEmpty(cell.getStringCellValue())){
                         if(!StringUtils.isEmpty(cell.getStringCellValue())){
                             switch (cell.getStringCellValue()){
                             switch (cell.getStringCellValue()){
                                 case "下架":product.setStatus(0);
                                 case "下架":product.setStatus(0);
@@ -321,18 +333,25 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
                                 break;
                                 break;
                             }
                             }
                         }
                         }
-                    }
-                    if(modelName.equals("type")){
+                    }else if(modelName.equals("price")){
+                        if(!StringUtils.isEmpty(cell.getStringCellValue())){
+                            product.setPrice(new BigDecimal(cell.getStringCellValue()));
+                        }
+                    }else if(modelName.equals("inventory")){
+                        if(!StringUtils.isEmpty(cell.getStringCellValue())){
+                            product.setInventory(new BigDecimal(cell.getStringCellValue()).intValue());
+                        }
+                    }else if(modelName.equals("type")){
                         if(!StringUtils.isEmpty(cell.getStringCellValue())){
                         if(!StringUtils.isEmpty(cell.getStringCellValue())){
                             Optional<SysDict> first = sysDictOfProductType.stream().filter(s -> s.getName().equals(cell.getStringCellValue())).findFirst();
                             Optional<SysDict> first = sysDictOfProductType.stream().filter(s -> s.getName().equals(cell.getStringCellValue())).findFirst();
                             if(first.isPresent()){
                             if(first.isPresent()){
                                 product.setType(first.get().getId());
                                 product.setType(first.get().getId());
                             }else {
                             }else {
-                                throw new Exception("产品类型["+cell.getStringCellValue()+"不存在,请在系统字典中增加");
+                                msg.setError("产品类型["+cell.getStringCellValue()+"]不存在,请在系统字典中增加");
+                                return msg;
                             }
                             }
                         }
                         }
-                    }
-                    if(modelName.equals("unit")){
+                    } else if(modelName.equals("unit")){
                         if(!StringUtils.isEmpty(cell.getStringCellValue())){
                         if(!StringUtils.isEmpty(cell.getStringCellValue())){
                             Optional<SysDict> first = sysDictOfProductUnit.stream().filter(s -> s.getName().equals(cell.getStringCellValue())).findFirst();
                             Optional<SysDict> first = sysDictOfProductUnit.stream().filter(s -> s.getName().equals(cell.getStringCellValue())).findFirst();
                             if(first.isPresent()){
                             if(first.isPresent()){
@@ -341,10 +360,14 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
                                 throw new Exception("产品单位["+cell.getStringCellValue()+"不存在,请在系统字典中增加");
                                 throw new Exception("产品单位["+cell.getStringCellValue()+"不存在,请在系统字典中增加");
                             }
                             }
                         }
                         }
+                    }else {
+                        if(!StringUtils.isEmpty(cell.getStringCellValue())){
+                            Class<Product> productClass = Product.class;
+                            Method method = productClass.getMethod(setter,String.class);
+                            method.invoke(product,cell.getStringCellValue());
+                        }
                     }
                     }
-                    if(!StringUtils.isEmpty(cell.getStringCellValue())){
-                        method.invoke(product,cell.getStringCellValue());
-                    }
+
                 }
                 }
                 importProductList.add(product);
                 importProductList.add(product);
             }
             }
@@ -362,12 +385,14 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
             e.printStackTrace();
             e.printStackTrace();
         } catch (Exception e) {
         } catch (Exception e) {
             e.printStackTrace();
             e.printStackTrace();
+            msg.setError("验证失败");
+            return msg;
         }
         }
         return msg;
         return msg;
     }
     }
 
 
     @Override
     @Override
-    public HttpRespMsg exportData(String userId, String productName, String productCode,Integer productType,Integer status) throws Exception {
+    public HttpRespMsg exportData(String userId, String productName, String productCode,Integer productType,Integer status,String startDate,String endDate) throws Exception {
         User user = userMapper.selectById(request.getHeader("token"));
         User user = userMapper.selectById(request.getHeader("token"));
         SysForm sysForm = sysFormMapper.selectOne(new LambdaQueryWrapper<SysForm>().eq(SysForm::getCompanyId, user.getCompanyId()).eq(SysForm::getCode, "Product").eq(SysForm::getIsCurrent, 1));
         SysForm sysForm = sysFormMapper.selectOne(new LambdaQueryWrapper<SysForm>().eq(SysForm::getCompanyId, user.getCompanyId()).eq(SysForm::getCode, "Product").eq(SysForm::getIsCurrent, 1));
         WxCorpInfo wxCorpInfo = wxCorpInfoService.getOne(new LambdaQueryWrapper<WxCorpInfo>().eq(WxCorpInfo::getCompanyId, user.getCompanyId()));
         WxCorpInfo wxCorpInfo = wxCorpInfoService.getOne(new LambdaQueryWrapper<WxCorpInfo>().eq(WxCorpInfo::getCompanyId, user.getCompanyId()));
@@ -381,7 +406,7 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
             titleList.add(item.getString("label"));
             titleList.add(item.getString("label"));
         }
         }
         dataList.add(titleList);
         dataList.add(titleList);
-        HttpRespMsg respMsg = getList(user.getCompanyId(), userId, productName, productCode,productType,status, null, null);
+        HttpRespMsg respMsg = getList(user.getCompanyId(), userId, productName, productCode,productType,status,startDate,endDate, null, null);
         Map<String, Object> msgData = (Map<String, Object>) respMsg.getData();
         Map<String, Object> msgData = (Map<String, Object>) respMsg.getData();
         List<Product> productList = (List<Product>) msgData.get("record");
         List<Product> productList = (List<Product>) msgData.get("record");
         for (Product product : productList) {
         for (Product product : productList) {

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

@@ -11,11 +11,17 @@ import com.management.platform.mapper.SysFormMapper;
 import com.management.platform.mapper.UserMapper;
 import com.management.platform.mapper.UserMapper;
 import com.management.platform.service.SysFormService;
 import com.management.platform.service.SysFormService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.management.platform.util.ExcelUtil;
 import com.management.platform.util.HttpRespMsg;
 import com.management.platform.util.HttpRespMsg;
 import com.management.platform.util.MessageUtils;
 import com.management.platform.util.MessageUtils;
 import org.apache.poi.hssf.usermodel.*;
 import org.apache.poi.hssf.usermodel.*;
 import org.apache.poi.ss.usermodel.*;
 import org.apache.poi.ss.usermodel.*;
 import org.apache.poi.ss.util.CellRangeAddressList;
 import org.apache.poi.ss.util.CellRangeAddressList;
+import org.apache.poi.xssf.streaming.SXSSFCell;
+import org.apache.poi.xssf.streaming.SXSSFRow;
+import org.apache.poi.xssf.streaming.SXSSFSheet;
+import org.apache.poi.xssf.streaming.SXSSFWorkbook;
+import org.apache.poi.xssf.usermodel.XSSFColor;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
@@ -89,164 +95,15 @@ public class SysFormServiceImpl extends ServiceImpl<SysFormMapper, SysForm> impl
             default:title="";
             default:title="";
         }
         }
         String result=MessageUtils.message("file.excelScu");
         String result=MessageUtils.message("file.excelScu");
-        String fileName= title+".xls";
         try {
         try {
-//            response.reset();
-//            response.setHeader("Content-disposition",
-//                "attachment;filename="+ URLEncoder.encode(fileName, "UTF-8"));
-//            //设置文件头编码格式
-//            response.setContentType("APPLICATION/OCTET-STREAM;charset=UTF-8");//设置类型
-//            response.setHeader("Cache-Control","no-cache");//设置头
-//            response.setDateHeader("Expires", 0);//设置日期头
-            // 创建工作簿
-            HSSFWorkbook workBook = new HSSFWorkbook();
-            // 创建工作类
-            HSSFSheet sheet = workBook.createSheet();
-            //设置首行冻结
-            sheet.createFreezePane(0, 1);
-            sheet.setDefaultColumnWidth(16);
-            //设置字体样式
-            HSSFFont headFont = workBook.createFont();
-            headFont.setBold(true);
-            headFont.setFontHeightInPoints((short) 10);
-            headFont.setFontName("黑体");
-
-            HSSFFont titleFont = workBook.createFont();
-            titleFont.setBold(true);
-            titleFont.setFontHeightInPoints((short) 10);
-            titleFont.setFontName("黑体");
-
-            HSSFFont font = workBook.createFont();
-            font.setFontHeightInPoints((short) 10);
-            font.setFontName("宋体");
-
-            //设置单元格样式
-            CellStyle headStyle = workBook.createCellStyle();
-            headStyle.setFont(headFont);
-            headStyle.setAlignment(HorizontalAlignment.CENTER);
-            headStyle.setVerticalAlignment(org.apache.poi.ss.usermodel.VerticalAlignment.CENTER);
-            headStyle.setWrapText(true);
-            headStyle.setBorderBottom(BorderStyle.THIN); //下边框
-            headStyle.setBorderLeft(BorderStyle.THIN);//左边框
-            headStyle.setBorderTop(BorderStyle.THIN);//上边框
-            headStyle.setBorderRight(BorderStyle.THIN);//右边框
-
-            String color = "c0c0c0";    //此处得到的color为16进制的字符串
-            //转为RGB码
-            int r = Integer.parseInt((color.substring(0,2)),16);   //转为16进制
-            int g = Integer.parseInt((color.substring(2,4)),16);
-            int b = Integer.parseInt((color.substring(4,6)),16);
-
-            //自定义cell颜色
-            HSSFPalette palette = workBook.getCustomPalette();
-            //这里的9是索引
-            palette.setColorAtIndex((short)9, (byte) r, (byte) g, (byte) b);
-
-            CellStyle titleStyle = workBook.createCellStyle();
-            titleStyle.setFont(titleFont);
-            titleStyle.setAlignment(HorizontalAlignment.CENTER);
-            titleStyle.setVerticalAlignment(org.apache.poi.ss.usermodel.VerticalAlignment.CENTER);
-            titleStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND);  //填充单元格
-            titleStyle.setFillForegroundColor((short)9);    //填色
-            titleStyle.setWrapText(true);
-            titleStyle.setBorderBottom(BorderStyle.THIN); //下边框
-            titleStyle.setBorderLeft(BorderStyle.THIN);//左边框
-            titleStyle.setBorderTop(BorderStyle.THIN);//上边框
-            titleStyle.setBorderRight(BorderStyle.THIN);//右边框
-
-            CellStyle cellStyle = workBook.createCellStyle();
-            cellStyle.setFont(font);
-            cellStyle.setAlignment(HorizontalAlignment.CENTER);
-            cellStyle.setVerticalAlignment(org.apache.poi.ss.usermodel.VerticalAlignment.CENTER);
-            cellStyle.setWrapText(true);
-            cellStyle.setBorderBottom(BorderStyle.THIN); //下边框
-            cellStyle.setBorderLeft(BorderStyle.THIN);//左边框
-            cellStyle.setBorderTop(BorderStyle.THIN);//上边框
-            cellStyle.setBorderRight(BorderStyle.THIN);//右边框
-            cellStyle.setDataFormat(workBook.createDataFormat().getFormat("yyyy-MM-dd HH:mm:ss"));
-            if(allList.size() > 0) {
-                int start = 0;
-                for(List<String> rowList : allList) {
-                    HSSFRow row = sheet.createRow(start);
-                    row.setHeightInPoints(24);
-                    for(int i = 0; i < rowList.size(); i++) {
-                        HSSFCell cell = row.createCell(i);
-                        ClientAnchor anchor = new HSSFClientAnchor();
-                        if(start == 0) {
-                            cell.setCellStyle(titleStyle);
-                            // 关键修改
-                            anchor.setDx1(0);
-                            anchor.setDx2(0);
-                            anchor.setDy1(0);
-                            anchor.setDy2(0);
-                            anchor.setCol1(cell.getColumnIndex());
-                            anchor.setRow1(cell.getRowIndex());
-                            anchor.setCol2(cell.getColumnIndex() + 5);
-                            anchor.setRow2(cell.getRowIndex() + 6);
-                            // 结束
-                            Drawing drawing = sheet.createDrawingPatriarch();
-                            Comment comment = null;
-                            String[] textList=null;
-                            DVConstraint constraint =null;
-                            CellRangeAddressList regions =null;
-                            HSSFDataValidation data_validation_list =null;
-//                            switch (rowList.get(i)){
-//                                case "是否为公共项目":
-//                                case "Whether it is a public project":
-//                                    // 加载下拉列表内容
-//                                    //textList= new String[]{"是", "否"};
-//                                    textList= new String[]{MessageUtils.message("excel.yes"), MessageUtils.message("excel.no")};
-//                                    constraint = DVConstraint
-//                                            .createExplicitListConstraint(textList);
-//                                    // 设置数据有效性加载在哪个单元格上,四个参数分别是:起始行、终止行、起始列、终止列
-//                                    regions = new CellRangeAddressList(1,
-//                                            1000, i, i);
-//                                    // 数据有效性对象
-//                                    data_validation_list = new HSSFDataValidation(
-//                                            regions, constraint);
-//                                    sheet.addValidationData(data_validation_list);
-//                                    comment = drawing.createCellComment(anchor);
-//                                    // 输入批注信息
-//                                    //comment.setString(new HSSFRichTextString("是否为公共项目\n" +
-//                                    //"是:公共项目\n" +
-//                                    //"否:普通项目"));
-//                                    comment.setString(new HSSFRichTextString(MessageUtils.message("excel.publicProject")+"\n" +
-//                                            MessageUtils.message("excel.yesPublic")+"\n" +
-//                                            MessageUtils.message("excel.noPublic")));
-//                                    cell.setCellComment(comment);
-//                                    break;
-//                            }
-                        }else {
-                            cell.setCellStyle(cellStyle);
-                        }
-                        cell.setCellValue(rowList.get(i));
-                    }
-                    start++;
-                }
-            }
-            //用于非传统ajax;
-//            String headStr = "attachment; filename=\"" + fileName + "\"";
-//            response.setContentType("APPLICATION/OCTET-STREAM");//返回格式为流
-//            response.setHeader("Content-Disposition", headStr);
-//            //普通下载不需要以上三行,注掉即可
-//            OutputStream os = response.getOutputStream();//在线下载
-            File dir = null;
-            dir = new File(path);
-            // D://cloud/upload 文件上传后所存储的位置,部署到服务器上时配置服务器地址即可
-            if (!dir.exists()) {
-                dir.mkdirs();
-            }
-            FileOutputStream os = new FileOutputStream(path+fileName);//保存到本地
-            workBook.write(os);
-            os.flush();
-            os.close();
+            String resp = ExcelUtil.exportGeneralExcelByTitleAndList(title, allList, path);
+            msg.setData(resp);
+            return msg;
         }catch(Exception e) {
         }catch(Exception e) {
             e.printStackTrace();
             e.printStackTrace();
             //msg.setError("已存在模板名称为["+fileName+"]的文件,请删除后重新下载");
             //msg.setError("已存在模板名称为["+fileName+"]的文件,请删除后重新下载");
-            msg.setError(MessageUtils.message("file.duplicateTemplate",fileName));
+            msg.setError(MessageUtils.message("file.duplicateTemplate",title));
             return msg;
             return msg;
         }
         }
-        msg.data= "/upload/"+fileName;
-        return msg;
     }
     }
 }
 }

+ 16 - 3
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java

@@ -35,6 +35,7 @@ import java.io.File;
 import java.io.FileOutputStream;
 import java.io.FileOutputStream;
 import java.math.BigDecimal;
 import java.math.BigDecimal;
 import java.math.RoundingMode;
 import java.math.RoundingMode;
+import java.text.Bidi;
 import java.text.DecimalFormat;
 import java.text.DecimalFormat;
 import java.text.NumberFormat;
 import java.text.NumberFormat;
 import java.text.SimpleDateFormat;
 import java.text.SimpleDateFormat;
@@ -275,7 +276,11 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
             workingTime = 0.0;
             workingTime = 0.0;
         }
         }
         planProcedureTotal.setTotalFillTime(workingTime);
         planProcedureTotal.setTotalFillTime(workingTime);
-        planProcedureTotal.setTotalProgress((int)((workingTime / planProcedureTotal.getTotalWorkingHours()) * 100));
+        BigDecimal bigDecimal = new BigDecimal(workingTime);
+        bigDecimal=bigDecimal.divide(new BigDecimal(planProcedureTotal.getTotalWorkingHours()));
+        bigDecimal=bigDecimal.multiply(new BigDecimal(100)).setScale(0,RoundingMode.HALF_UP);
+        planProcedureTotal.setTotalProgress(bigDecimal.intValue());
+//            planProcedureTotal.setTotalProgress((int)((workingTime / planProcedureTotal.getTotalWorkingHours()) * 100));
         planProcedureTotalMapper.updateById(planProcedureTotal);
         planProcedureTotalMapper.updateById(planProcedureTotal);
         //检查该计划下的所有工序是否都已经完成
         //检查该计划下的所有工序是否都已经完成
         List<PlanProcedureTotal> planProcedureTotalList = planProcedureTotalMapper.selectList(new QueryWrapper<PlanProcedureTotal>().eq("plan_id", planProcedureTotal.getPlanId()));
         List<PlanProcedureTotal> planProcedureTotalList = planProcedureTotalMapper.selectList(new QueryWrapper<PlanProcedureTotal>().eq("plan_id", planProcedureTotal.getPlanId()));
@@ -4799,7 +4804,11 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                 workingTime = curReportSumItem.getWorkingTime();
                 workingTime = curReportSumItem.getWorkingTime();
             }
             }
             planProcedureTotal.setTotalFillTime(workingTime);
             planProcedureTotal.setTotalFillTime(workingTime);
-            planProcedureTotal.setTotalProgress((int)((workingTime / planProcedureTotal.getTotalWorkingHours()) * 100));
+            BigDecimal bigDecimal = new BigDecimal(workingTime);
+            bigDecimal=bigDecimal.divide(new BigDecimal(planProcedureTotal.getTotalWorkingHours()));
+            bigDecimal=bigDecimal.multiply(new BigDecimal(100)).setScale(0,RoundingMode.HALF_UP);
+            planProcedureTotal.setTotalProgress(bigDecimal.intValue());
+//            planProcedureTotal.setTotalProgress((int)((workingTime / planProcedureTotal.getTotalWorkingHours()) * 100));
             System.out.println("planProcedureTotal.getId()=="+planProcedureTotal.getId()+"--进度 2 workingTime:"+workingTime+" totalWorkingHours:"+planProcedureTotal.getTotalWorkingHours()+" totalProgress:"+planProcedureTotal.getTotalProgress());
             System.out.println("planProcedureTotal.getId()=="+planProcedureTotal.getId()+"--进度 2 workingTime:"+workingTime+" totalWorkingHours:"+planProcedureTotal.getTotalWorkingHours()+" totalProgress:"+planProcedureTotal.getTotalProgress());
             planProcedureTotalMapper.updateById(planProcedureTotal);
             planProcedureTotalMapper.updateById(planProcedureTotal);
             return new HttpRespMsg();
             return new HttpRespMsg();
@@ -4846,7 +4855,11 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                     workingTime = curReportSumItem.getWorkingTime();
                     workingTime = curReportSumItem.getWorkingTime();
                 }
                 }
                 planProcedureTotal.setTotalFillTime(workingTime);
                 planProcedureTotal.setTotalFillTime(workingTime);
-                planProcedureTotal.setTotalProgress((int)((workingTime / planProcedureTotal.getTotalWorkingHours()) * 100));
+                BigDecimal bigDecimal = new BigDecimal(workingTime);
+                bigDecimal=bigDecimal.divide(new BigDecimal(planProcedureTotal.getTotalWorkingHours()));
+                bigDecimal=bigDecimal.multiply(new BigDecimal(100)).setScale(0,RoundingMode.HALF_UP);
+                planProcedureTotal.setTotalProgress(bigDecimal.intValue());
+//            planProcedureTotal.setTotalProgress((int)((workingTime / planProcedureTotal.getTotalWorkingHours()) * 100));
                 System.out.println("planProcedureTotal.getId()=="+planProcedureTotal.getId()+"--进度 3 workingTime:"+workingTime+" totalWorkingHours:"+planProcedureTotal.getTotalWorkingHours()+" totalProgress:"+planProcedureTotal.getTotalProgress());
                 System.out.println("planProcedureTotal.getId()=="+planProcedureTotal.getId()+"--进度 3 workingTime:"+workingTime+" totalWorkingHours:"+planProcedureTotal.getTotalWorkingHours()+" totalProgress:"+planProcedureTotal.getTotalProgress());
                 planProcedureTotalMapper.updateById(planProcedureTotal);
                 planProcedureTotalMapper.updateById(planProcedureTotal);
             }
             }