LIVE_YE 1 maand geleden
bovenliggende
commit
c82652504a

+ 104 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/record/OperationRecordController.java

@@ -0,0 +1,104 @@
+package com.ruoyi.web.controller.record;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.system.domain.OperationRecord;
+import com.ruoyi.system.service.IOperationRecordService;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 操作记录Controller
+ * 
+ * @author boman
+ * @date 2025-05-16
+ */
+@RestController
+@RequestMapping("/operation/record")
+public class OperationRecordController extends BaseController
+{
+    @Autowired
+    private IOperationRecordService operationRecordService;
+
+    /**
+     * 查询操作记录列表
+     */
+    @PreAuthorize("@ss.hasPermi('operation:record:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(OperationRecord operationRecord)
+    {
+        startPage();
+        List<OperationRecord> list = operationRecordService.selectOperationRecordList(operationRecord);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出操作记录列表
+     */
+    @PreAuthorize("@ss.hasPermi('operation:record:export')")
+    @Log(title = "操作记录", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, OperationRecord operationRecord)
+    {
+        List<OperationRecord> list = operationRecordService.selectOperationRecordList(operationRecord);
+        ExcelUtil<OperationRecord> util = new ExcelUtil<OperationRecord>(OperationRecord.class);
+        util.exportExcel(response, list, "操作记录数据");
+    }
+
+    /**
+     * 获取操作记录详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('operation:record:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return success(operationRecordService.selectOperationRecordById(id));
+    }
+
+    /**
+     * 新增操作记录
+     */
+    @PreAuthorize("@ss.hasPermi('operation:record:add')")
+    @Log(title = "操作记录", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody OperationRecord operationRecord)
+    {
+        return toAjax(operationRecordService.insertOperationRecord(operationRecord));
+    }
+
+    /**
+     * 修改操作记录
+     */
+    @PreAuthorize("@ss.hasPermi('operation:record:edit')")
+    @Log(title = "操作记录", businessType = BusinessType.UPDATE)
+    @PostMapping("/put")
+    public AjaxResult edit(@RequestBody OperationRecord operationRecord)
+    {
+        return toAjax(operationRecordService.updateOperationRecord(operationRecord));
+    }
+
+    /**
+     * 删除操作记录
+     */
+    @PreAuthorize("@ss.hasPermi('operation:record:remove')")
+    @Log(title = "操作记录", businessType = BusinessType.DELETE)
+    @GetMapping("/delete/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(operationRecordService.deleteOperationRecordByIds(ids));
+    }
+}

+ 40 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/work/WorkOrderInfoController.java

@@ -165,6 +165,36 @@ public class WorkOrderInfoController extends BaseController
         return workOrderInfoService.bj();
     }
 
+    /**
+     * pc首页top6员工(月)
+     */
+    @PreAuthorize("@ss.hasPermi('work:month:px')")
+    @GetMapping(value = "/month/px")
+    public AjaxResult monthPx(String time)
+    {
+        return workOrderInfoService.monthPx(time);
+    }
+
+    /**
+     * app首页top6员工(年)
+     */
+    @PreAuthorize("@ss.hasPermi('work:year:px')")
+    @GetMapping(value = "/year/px")
+    public AjaxResult yearPx(String time)
+    {
+        return workOrderInfoService.yearPx(time);
+    }
+
+    /**
+     * app服务类型单量统计(年)
+     */
+    @PreAuthorize("@ss.hasPermi('work:year:fwlx')")
+    @GetMapping(value = "/year/fwlx")
+    public AjaxResult yearFwlx(String time)
+    {
+        return workOrderInfoService.yearFwlx(time);
+    }
+
     /**
      * APP首页季度个人接单统计
      */
@@ -174,4 +204,14 @@ public class WorkOrderInfoController extends BaseController
     {
         return workOrderInfoService.statisticsJd();
     }
+
+    /**
+     * 待办事项数量
+     */
+    @PreAuthorize("@ss.hasPermi('work:db:num')")
+    @GetMapping(value = "/db/num")
+    public AjaxResult dbNum()
+    {
+        return workOrderInfoService.dbNum();
+    }
 }

+ 3 - 0
ruoyi-common/src/main/java/com/ruoyi/common/constant/UserConstants.java

@@ -39,6 +39,9 @@ public class UserConstants
     /** 是否为系统默认(是) */
     public static final String YES = "Y";
 
+    /** 是否为系统默认(否) */
+    public static final String NO = "N";
+
     /** 是否菜单外链(是) */
     public static final String YES_FRAME = "0";
 

+ 2 - 0
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/BaseEntity.java

@@ -7,6 +7,7 @@ import java.util.Map;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.fasterxml.jackson.annotation.JsonIgnore;
 import com.fasterxml.jackson.annotation.JsonInclude;
+import org.springframework.format.annotation.DateTimeFormat;
 
 /**
  * Entity基类
@@ -26,6 +27,7 @@ public class BaseEntity implements Serializable
 
     /** 创建时间 */
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date createTime;
 
     /** 更新者 */

+ 116 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/OperationRecord.java

@@ -0,0 +1,116 @@
+package com.ruoyi.system.domain;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+
+/**
+ * 操作记录对象 operation_record
+ * 
+ * @author boman
+ * @date 2025-05-16
+ */
+public class OperationRecord extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** ID */
+    private Long id;
+
+    /** 工单ID */
+    @Excel(name = "工单ID")
+    private String orderId;
+
+    /** 创建人id */
+    @Excel(name = "创建人id")
+    private Long userId;
+
+    /** 创建人姓名 */
+    @Excel(name = "创建人姓名")
+    private String userName;
+
+    /** 操作描述 */
+    @Excel(name = "操作描述")
+    private String record;
+
+    /** 删除标志(N代表存在 Y代表删除) */
+    private String delFlag;
+
+    public void setId(Long id) 
+    {
+        this.id = id;
+    }
+
+    public Long getId() 
+    {
+        return id;
+    }
+
+    public void setOrderId(String orderId) 
+    {
+        this.orderId = orderId;
+    }
+
+    public String getOrderId() 
+    {
+        return orderId;
+    }
+
+    public void setUserId(Long userId) 
+    {
+        this.userId = userId;
+    }
+
+    public Long getUserId() 
+    {
+        return userId;
+    }
+
+    public void setUserName(String userName) 
+    {
+        this.userName = userName;
+    }
+
+    public String getUserName() 
+    {
+        return userName;
+    }
+
+    public void setRecord(String record) 
+    {
+        this.record = record;
+    }
+
+    public String getRecord() 
+    {
+        return record;
+    }
+
+    public void setDelFlag(String delFlag) 
+    {
+        this.delFlag = delFlag;
+    }
+
+    public String getDelFlag() 
+    {
+        return delFlag;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("orderId", getOrderId())
+            .append("userId", getUserId())
+            .append("userName", getUserName())
+            .append("record", getRecord())
+            .append("delFlag", getDelFlag())
+            .append("createBy", getCreateBy())
+            .append("createTime", getCreateTime())
+            .append("updateBy", getUpdateBy())
+            .append("updateTime", getUpdateTime())
+            .append("remark", getRemark())
+            .toString();
+    }
+}

+ 34 - 1
ruoyi-system/src/main/java/com/ruoyi/system/domain/WorkOrderInfo.java

@@ -22,6 +22,13 @@ public class WorkOrderInfo extends BaseEntity
     /** 工单ID */
     private String orderId;
 
+    /** 用户ID */
+    private Long userId;
+
+    /** 创建人姓名 */
+    @Excel(name = "创建人姓名")
+    private String userName;
+
     /** 单位名称 */
     @Excel(name = "单位名称")
     private String unitName;
@@ -106,6 +113,8 @@ public class WorkOrderInfo extends BaseEntity
     @Excel(name = "派单情况", readConverterExp = "1=系统派单,2=自主接单")
     private String orderPlacement;
 
+    private String agency;
+
     /** 责任人id */
     @Excel(name = "责任人id")
     private Long responsibleId;
@@ -168,7 +177,23 @@ public class WorkOrderInfo extends BaseEntity
         return orderId;
     }
 
-    public void setUnitName(String unitName) 
+    public Long getUserId() {
+        return userId;
+    }
+
+    public void setUserId(Long userId) {
+        this.userId = userId;
+    }
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+    public void setUnitName(String unitName)
     {
         this.unitName = unitName;
     }
@@ -504,6 +529,14 @@ public class WorkOrderInfo extends BaseEntity
         this.workOrderFjgd = workOrderFjgd;
     }
 
+    public String getAgency() {
+        return agency;
+    }
+
+    public void setAgency(String agency) {
+        this.agency = agency;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

+ 61 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/OperationRecordMapper.java

@@ -0,0 +1,61 @@
+package com.ruoyi.system.mapper;
+
+import java.util.List;
+import com.ruoyi.system.domain.OperationRecord;
+
+/**
+ * 操作记录Mapper接口
+ * 
+ * @author boman
+ * @date 2025-05-16
+ */
+public interface OperationRecordMapper 
+{
+    /**
+     * 查询操作记录
+     * 
+     * @param id 操作记录主键
+     * @return 操作记录
+     */
+    public OperationRecord selectOperationRecordById(Long id);
+
+    /**
+     * 查询操作记录列表
+     * 
+     * @param operationRecord 操作记录
+     * @return 操作记录集合
+     */
+    public List<OperationRecord> selectOperationRecordList(OperationRecord operationRecord);
+
+    /**
+     * 新增操作记录
+     * 
+     * @param operationRecord 操作记录
+     * @return 结果
+     */
+    public int insertOperationRecord(OperationRecord operationRecord);
+
+    /**
+     * 修改操作记录
+     * 
+     * @param operationRecord 操作记录
+     * @return 结果
+     */
+    public int updateOperationRecord(OperationRecord operationRecord);
+
+    /**
+     * 删除操作记录
+     * 
+     * @param id 操作记录主键
+     * @return 结果
+     */
+    public int deleteOperationRecordById(Long id);
+
+    /**
+     * 批量删除操作记录
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteOperationRecordByIds(Long[] ids);
+}

+ 6 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/WorkOrderInfoMapper.java

@@ -63,4 +63,10 @@ public interface WorkOrderInfoMapper
     List<WorkOrderInfo> selectWorkOrderInfoListBymonth(String month);
 
     List<WorkOrderInfo> selectWorkOrderInfoListByTime(@Param("startDate")String startDate, @Param("endDate")String endDate, @Param("userId")Long userId);
+
+    List<WorkOrderInfo> selectWorkOrderInfoListBymonthOne(String month);
+
+    List<WorkOrderInfo> selectWorkOrderInfoListByYearOne(String year);
+
+    List<WorkOrderInfo> selectWorkOrderInfoListByYear(@Param("year")String year, @Param("userId")Long userId);
 }

+ 61 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/IOperationRecordService.java

@@ -0,0 +1,61 @@
+package com.ruoyi.system.service;
+
+import java.util.List;
+import com.ruoyi.system.domain.OperationRecord;
+
+/**
+ * 操作记录Service接口
+ * 
+ * @author boman
+ * @date 2025-05-16
+ */
+public interface IOperationRecordService 
+{
+    /**
+     * 查询操作记录
+     * 
+     * @param id 操作记录主键
+     * @return 操作记录
+     */
+    public OperationRecord selectOperationRecordById(Long id);
+
+    /**
+     * 查询操作记录列表
+     * 
+     * @param operationRecord 操作记录
+     * @return 操作记录集合
+     */
+    public List<OperationRecord> selectOperationRecordList(OperationRecord operationRecord);
+
+    /**
+     * 新增操作记录
+     * 
+     * @param operationRecord 操作记录
+     * @return 结果
+     */
+    public int insertOperationRecord(OperationRecord operationRecord);
+
+    /**
+     * 修改操作记录
+     * 
+     * @param operationRecord 操作记录
+     * @return 结果
+     */
+    public int updateOperationRecord(OperationRecord operationRecord);
+
+    /**
+     * 批量删除操作记录
+     * 
+     * @param ids 需要删除的操作记录主键集合
+     * @return 结果
+     */
+    public int deleteOperationRecordByIds(Long[] ids);
+
+    /**
+     * 删除操作记录信息
+     * 
+     * @param id 操作记录主键
+     * @return 结果
+     */
+    public int deleteOperationRecordById(Long id);
+}

+ 8 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/IWorkOrderInfoService.java

@@ -75,4 +75,12 @@ public interface IWorkOrderInfoService
     AjaxResult bj();
 
     AjaxResult statisticsJd();
+
+    AjaxResult dbNum();
+
+    AjaxResult monthPx(String time);
+
+    AjaxResult yearPx(String time);
+
+    AjaxResult yearFwlx(String time);
 }

+ 102 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/OperationRecordServiceImpl.java

@@ -0,0 +1,102 @@
+package com.ruoyi.system.service.impl;
+
+import java.util.List;
+
+import com.ruoyi.common.core.domain.entity.SysUser;
+import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.common.utils.SecurityUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.system.mapper.OperationRecordMapper;
+import com.ruoyi.system.domain.OperationRecord;
+import com.ruoyi.system.service.IOperationRecordService;
+
+/**
+ * 操作记录Service业务层处理
+ * 
+ * @author boman
+ * @date 2025-05-16
+ */
+@Service
+public class OperationRecordServiceImpl implements IOperationRecordService 
+{
+    @Autowired
+    private OperationRecordMapper operationRecordMapper;
+
+    /**
+     * 查询操作记录
+     * 
+     * @param id 操作记录主键
+     * @return 操作记录
+     */
+    @Override
+    public OperationRecord selectOperationRecordById(Long id)
+    {
+        return operationRecordMapper.selectOperationRecordById(id);
+    }
+
+    /**
+     * 查询操作记录列表
+     * 
+     * @param operationRecord 操作记录
+     * @return 操作记录
+     */
+    @Override
+    public List<OperationRecord> selectOperationRecordList(OperationRecord operationRecord)
+    {
+        return operationRecordMapper.selectOperationRecordList(operationRecord);
+    }
+
+    /**
+     * 新增操作记录
+     * 
+     * @param operationRecord 操作记录
+     * @return 结果
+     */
+    @Override
+    public int insertOperationRecord(OperationRecord operationRecord)
+    {
+        SysUser user = SecurityUtils.getLoginUser().getUser();
+        operationRecord.setUserId(user.getUserId());
+        operationRecord.setUserName(user.getNickName());
+        operationRecord.setCreateTime(DateUtils.getNowDate());
+        return operationRecordMapper.insertOperationRecord(operationRecord);
+    }
+
+    /**
+     * 修改操作记录
+     * 
+     * @param operationRecord 操作记录
+     * @return 结果
+     */
+    @Override
+    public int updateOperationRecord(OperationRecord operationRecord)
+    {
+        operationRecord.setUpdateTime(DateUtils.getNowDate());
+        return operationRecordMapper.updateOperationRecord(operationRecord);
+    }
+
+    /**
+     * 批量删除操作记录
+     * 
+     * @param ids 需要删除的操作记录主键
+     * @return 结果
+     */
+    @Override
+    public int deleteOperationRecordByIds(Long[] ids)
+    {
+        return operationRecordMapper.deleteOperationRecordByIds(ids);
+    }
+
+    /**
+     * 删除操作记录信息
+     * 
+     * @param id 操作记录主键
+     * @return 结果
+     */
+    @Override
+    public int deleteOperationRecordById(Long id)
+    {
+        return operationRecordMapper.deleteOperationRecordById(id);
+    }
+}

+ 252 - 26
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/WorkOrderInfoServiceImpl.java

@@ -4,10 +4,7 @@ import java.io.File;
 import java.io.IOException;
 import java.math.BigDecimal;
 import java.math.RoundingMode;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 import java.util.function.Function;
 import java.util.stream.Collectors;
 
@@ -29,19 +26,20 @@ import com.ruoyi.common.utils.base64.Base64DecodedMultipartFile;
 import com.ruoyi.common.utils.file.FileUploadUtils;
 import com.ruoyi.common.utils.file.FileUtils;
 import com.ruoyi.system.domain.ChargeDetails;
+import com.ruoyi.system.domain.OperationRecord;
 import com.ruoyi.system.domain.WorkOrderFj;
 import com.ruoyi.system.domain.vo.WordVo;
-import com.ruoyi.system.mapper.ChargeDetailsMapper;
-import com.ruoyi.system.mapper.WorkOrderFjMapper;
+import com.ruoyi.system.mapper.*;
+import com.ruoyi.system.service.IOperationRecordService;
 import lombok.SneakyThrows;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-import com.ruoyi.system.mapper.WorkOrderInfoMapper;
 import com.ruoyi.system.domain.WorkOrderInfo;
 import com.ruoyi.system.service.IWorkOrderInfoService;
 import org.springframework.web.multipart.MultipartFile;
 
 import static com.ruoyi.common.constant.UserConstants.*;
+import static com.ruoyi.common.utils.DateUtils.YYYY;
 import static com.ruoyi.common.utils.DateUtils.YYYY_MM;
 
 /**
@@ -62,6 +60,13 @@ public class WorkOrderInfoServiceImpl implements IWorkOrderInfoService
     @Autowired
     private ChargeDetailsMapper chargeDetailsMapper;
 
+    @Autowired
+    private SysDictDataMapper dictDataMapper;
+    @Autowired
+    private IOperationRecordService operationRecordService;
+    @Autowired
+    private SysUserMapper userMapper;
+
 
     /**
      * 查询工单信息
@@ -120,6 +125,9 @@ public class WorkOrderInfoServiceImpl implements IWorkOrderInfoService
     @Override
     public int insertWorkOrderInfo(WorkOrderInfo workOrderInfo)
     {
+        SysUser user = SecurityUtils.getLoginUser().getUser();
+        workOrderInfo.setUserId(user.getUserId());
+        workOrderInfo.setUserName(user.getUserName());
         //生成工单编号(时间戳+4位随机数)
         workOrderInfo.setOrderId(DateUtils.getOrderId());
         workOrderInfo.setCreateTime(DateUtils.getNowDate());
@@ -130,6 +138,14 @@ public class WorkOrderInfoServiceImpl implements IWorkOrderInfoService
                 workOrderFjMapper.insertWorkOrderFj(workOrderFj);
             }
         }
+
+        OperationRecord operationRecord = new OperationRecord();
+        operationRecord.setOrderId(workOrderInfo.getOrderId());
+        String type = dictDataMapper.selectDictLabel("service_progress", workOrderInfo.getType());
+        StringBuilder recod = new StringBuilder();
+        recod.append(workOrderInfo.getUnitName()).append("发起了一个").append(type).append(",联系方式").append(workOrderInfo.getPhonenumber());
+        operationRecord.setRecord(recod.toString());
+        operationRecordService.insertOperationRecord(operationRecord);
         return i;
     }
 
@@ -142,20 +158,56 @@ public class WorkOrderInfoServiceImpl implements IWorkOrderInfoService
     @Override
     public int updateWorkOrderInfo(WorkOrderInfo workOrderInfo)
     {
-        if(workOrderInfo.getChargeDetailsList()!=null && !workOrderInfo.getChargeDetailsList().isEmpty()){
-            //删除收费信息重新保存
+
+        if(!THR.equals(workOrderInfo.getServiceProgress())){
+            if(workOrderInfo.getChargeDetailsList()!=null && !workOrderInfo.getChargeDetailsList().isEmpty()){
+                //删除收费信息重新保存
+                chargeDetailsMapper.deleteChargeDetailsByOrderId(workOrderInfo.getOrderId());
+                //删除之后重新保存
+                for (ChargeDetails chargeDetails : workOrderInfo.getChargeDetailsList()) {
+                    chargeDetails.setOrderId(workOrderInfo.getOrderId());
+                    chargeDetailsMapper.insertChargeDetails(chargeDetails);
+                }
+            }
             chargeDetailsMapper.deleteChargeDetailsByOrderId(workOrderInfo.getOrderId());
-            //删除之后重新保存
-            for (ChargeDetails chargeDetails : workOrderInfo.getChargeDetailsList()) {
-                chargeDetails.setOrderId(workOrderInfo.getOrderId());
-                chargeDetailsMapper.insertChargeDetails(chargeDetails);
+            if(workOrderInfo.getWorkOrderFjXqList()!=null && !workOrderInfo.getWorkOrderFjXqList().isEmpty()){
+                for (WorkOrderFj workOrderFj : workOrderInfo.getWorkOrderFjXqList()) {
+                    workOrderFj.setOrderId(workOrderInfo.getOrderId());
+                    workOrderFjMapper.insertWorkOrderFj(workOrderFj);
+                }
             }
-        }
-        if(workOrderInfo.getWorkOrderFjXqList()!=null && !workOrderInfo.getWorkOrderFjXqList().isEmpty()){
-            for (WorkOrderFj workOrderFj : workOrderInfo.getWorkOrderFjXqList()) {
-                workOrderFj.setOrderId(workOrderInfo.getOrderId());
-                workOrderFjMapper.insertWorkOrderFj(workOrderFj);
+            if(workOrderInfo.getWorkOrderFjQmList()!=null && !workOrderInfo.getWorkOrderFjQmList().isEmpty()){
+                for (WorkOrderFj workOrderFj : workOrderInfo.getWorkOrderFjQmList()) {
+                    workOrderFj.setOrderId(workOrderInfo.getOrderId());
+                    workOrderFjMapper.insertWorkOrderFj(workOrderFj);
+                }
             }
+            if(workOrderInfo.getWorkOrderFjgd()!=null){
+                workOrderInfo.getWorkOrderFjgd().setOrderId(workOrderInfo.getOrderId());
+                workOrderFjMapper.insertWorkOrderFj(workOrderInfo.getWorkOrderFjgd());
+            }
+        }
+        if(TWO.equals(workOrderInfo.getServiceProgress())){
+            workOrderInfo.setAgency(TWO);
+
+            //操作记录
+            OperationRecord operationRecord = new OperationRecord();
+            operationRecord.setOrderId(workOrderInfo.getOrderId());
+            String type = dictDataMapper.selectDictLabel("service_progress", workOrderInfo.getType());
+            StringBuilder recod = new StringBuilder();
+            recod.append(workOrderInfo.getUnitName()).append("的").append(type).append("已结束;客户暂无评价");
+            operationRecord.setRecord(recod.toString());
+            operationRecordService.insertOperationRecord(operationRecord);
+        }
+        if(THR.equals(workOrderInfo.getServiceProgress())){
+            //操作记录
+            OperationRecord operationRecord = new OperationRecord();
+            operationRecord.setOrderId(workOrderInfo.getOrderId());
+            String type = dictDataMapper.selectDictLabel("service_progress", workOrderInfo.getType());
+            StringBuilder recod = new StringBuilder();
+            recod.append(workOrderInfo.getUnitName()).append("的").append(type).append("已结束;客户评价:").append(workOrderInfo.getEvaluationContent());
+            operationRecord.setRecord(recod.toString());
+            operationRecordService.insertOperationRecord(operationRecord);
         }
         workOrderInfo.setUpdateTime(DateUtils.getNowDate());
         return workOrderInfoMapper.updateWorkOrderInfo(workOrderInfo);
@@ -187,15 +239,32 @@ public class WorkOrderInfoServiceImpl implements IWorkOrderInfoService
 
     @Override
     public int jd(WorkOrderInfo workOrderInfo) {
+        //操作记录
+        WorkOrderInfo orderInfo = workOrderInfoMapper.selectWorkOrderInfoByOrderId(workOrderInfo.getOrderId());
+        OperationRecord operationRecord = new OperationRecord();
+        operationRecord.setOrderId(workOrderInfo.getOrderId());
+        String type = dictDataMapper.selectDictLabel("service_progress", workOrderInfo.getType());
+        StringBuilder recod = new StringBuilder();
+        recod.append(workOrderInfo.getResponsibleName()).append("接下了").append(orderInfo.getUnitName()).append("的");
+        recod.append(type).append("工单:工单编号").append(orderInfo.getOrderId());
+
         workOrderInfo.setServiceProgress(ONE);
         workOrderInfo.setTakeTime(DateUtils.getNowDate());
-        SysUser user = SecurityUtils.getLoginUser().getUser();
+        workOrderInfo.setAgency(ONE);
+
         //自主接单
         if(TWO.equals(workOrderInfo.getOrderPlacement())){
+            SysUser user = SecurityUtils.getLoginUser().getUser();
             workOrderInfo.setResponsibleId(user.getUserId());
             workOrderInfo.setResponsibleName(user.getNickName());
             workOrderInfo.setResponsiblePhone(user.getPhonenumber());
+            workOrderInfo.setAgency(TWO);
+            recod = new StringBuilder();
+            recod.append(workOrderInfo.getResponsibleName()).append("被分派了").append(orderInfo.getUnitName()).append("的");
+            recod.append(type).append("工单:工单编号").append(orderInfo.getOrderId());
         }
+        operationRecord.setRecord(recod.toString());
+        operationRecordService.insertOperationRecord(operationRecord);
         return workOrderInfoMapper.updateWorkOrderInfo(workOrderInfo);
     }
 
@@ -235,6 +304,7 @@ public class WorkOrderInfoServiceImpl implements IWorkOrderInfoService
         finalMap.put("bz",workOrderInfo.getRemark());
         finalMap.put("lxfs",workOrderInfo.getPhonenumber());
         finalMap.put("rq",DateUtils.getDate());
+        finalMap.put("bz", workOrderInfo.getRemark());
         finalMap.put("qm", "{{@qm}}");
 
         List<Object> workList = new ArrayList<>();
@@ -302,9 +372,19 @@ public class WorkOrderInfoServiceImpl implements IWorkOrderInfoService
     public AjaxResult qm(WordVo wordVo) {
         //查询工单信息
         WorkOrderInfo workOrderInfo = workOrderInfoMapper.selectWorkOrderInfoByOrderId(wordVo.getOrderId());
-        int start = wordVo.getImage().indexOf(",");
-        String head = wordVo.getImage().substring(start + 1);
-        MultipartFile file = Base64DecodedMultipartFile.base64Convert(wordVo.getImage(),head,workOrderInfo.getOrderId()+"签字");
+
+        String base64String = wordVo.getImage();
+        if (base64String.contains("data:")) {
+            int start = base64String.indexOf(",");
+            base64String = base64String.substring(start + 1);
+        }
+        base64String = base64String.replaceAll("\r|\n", "");
+        base64String = base64String.trim();
+
+        int s = wordVo.getImage().indexOf(",");
+        String head = wordVo.getImage().substring(0,s + 1);
+
+        MultipartFile file = Base64DecodedMultipartFile.base64Convert(base64String,head,workOrderInfo.getOrderId()+"签字");
         // 上传文件路径
         String filePath = RuoYiConfig.getUploadPath();
         // 上传并返回新文件名称
@@ -326,12 +406,11 @@ public class WorkOrderInfoServiceImpl implements IWorkOrderInfoService
 
         HashMap<String, Object> finalMap = new HashMap<>();
         //这里也可以是用文件服务器返回的网络文件流
-        String pictureUrl = "http://5b0988e595225.cdn.sohucs.com/images/20171013/fec49f59b98041a4a16886893447f746.jpeg";
-        pictureUrl = "http://localhost:8077" + fileName;
+        String pictureUrl =  fileName.replace("/profile",RuoYiConfig.getProfile());
         // 从网络流读取图片,置入word模板,等待编译
         if (StringUtils.isNotEmpty(pictureUrl)) {
-            PictureRenderData picture = Pictures.ofUrl(pictureUrl).size(100, 60).create();//网络图片地址
-            //PictureRenderData picture = Pictures.ofLocal(pictureUrl).size(100, 60).create();//本地图片地址
+            //PictureRenderData picture = Pictures.ofUrl(pictureUrl).size(100, 60).create();//网络图片地址
+            PictureRenderData picture = Pictures.ofLocal(pictureUrl).size(100, 60).create();//本地图片地址
             finalMap.put("qm", picture);
         }
         // 从网络url 下载word模板到指定文件夹
@@ -351,6 +430,8 @@ public class WorkOrderInfoServiceImpl implements IWorkOrderInfoService
         } catch (IOException e) {
             throw new RuntimeException(e);
         }
+        workOrderInfo.setServiceProgress(TWO);
+        workOrderInfoMapper.updateWorkOrderInfo(workOrderInfo);
         return AjaxResult.success("成功");
     }
 
@@ -596,4 +677,149 @@ public class WorkOrderInfoServiceImpl implements IWorkOrderInfoService
         map.put("zzbfb",zzbfb);
         return AjaxResult.success(map);
     }
+
+    @Override
+    public AjaxResult dbNum() {
+        int num = 0;
+        SysUser user = SecurityUtils.getLoginUser().getUser();
+        WorkOrderInfo workOrderInfo = new WorkOrderInfo();
+        workOrderInfo.setDelFlag(NO);
+        workOrderInfo.setAgency(ONE);
+        workOrderInfo.setResponsibleId(user.getUserId());
+        List<WorkOrderInfo> workOrderInfos = workOrderInfoMapper.selectWorkOrderInfoList(workOrderInfo);
+        if(workOrderInfos!=null && !workOrderInfos.isEmpty()){
+            num = workOrderInfos.size();
+        }
+        return AjaxResult.success(num);
+    }
+
+    @Override
+    public AjaxResult monthPx(String time) {
+        if(StringUtils.isEmpty(time)){
+            time = DateUtils.dateTimeNow(YYYY_MM);
+        }
+        //本月单量
+        List<WorkOrderInfo> workOrderInfoList = workOrderInfoMapper.selectWorkOrderInfoListBymonthOne(time);
+        Map<Long, Integer> map = new HashMap<>();
+        if(workOrderInfoList!=null && !workOrderInfoList.isEmpty()){
+            Map<Long,List<WorkOrderInfo>> workOrderInfomap = workOrderInfoList.stream().collect(Collectors.groupingBy(WorkOrderInfo::getResponsibleId));
+            for (Long s : workOrderInfomap.keySet()) {
+                map.put(s,workOrderInfomap.get(s).size());
+            }
+        }
+        // 使用Stream API和Collectors.toList()将entries转换为List
+        List<Map.Entry<Long, Integer>> entries = new ArrayList<>(map.entrySet());
+
+        // 根据value排序,这里是升序
+        //entries.sort(Map.Entry.comparingByValue());
+        // 如果你需要降序,可以这样做:
+        entries.sort(Map.Entry.comparingByValue(Comparator.reverseOrder()));
+        //取前6个
+        List<Map<String, Object>> listMap = new ArrayList<>();
+        for (int i = 0; i < 6; i++) {
+            if(entries.size()<i+1){
+                break;
+            }
+            Map<String, Object> mapPx = new HashMap<>();
+            SysUser sysUser = userMapper.selectUserById(entries.get(i).getKey());
+            mapPx.put("xh",i+1);
+            mapPx.put("name",sysUser.getNickName());
+            mapPx.put("deptName",sysUser.getDept().getDeptName());
+            mapPx.put("num",entries.get(i).getValue());
+            listMap.add(mapPx);
+        }
+
+        return AjaxResult.success(listMap);
+    }
+
+    @Override
+    public AjaxResult yearPx(String time) {
+        if(StringUtils.isEmpty(time)){
+            time = DateUtils.dateTimeNow(YYYY);
+        }
+        //本年单量
+        List<WorkOrderInfo> workOrderInfoList = workOrderInfoMapper.selectWorkOrderInfoListByYearOne(time);
+        Map<Long, Integer> map = new HashMap<>();
+        if(workOrderInfoList!=null && !workOrderInfoList.isEmpty()){
+            Map<Long,List<WorkOrderInfo>> workOrderInfomap = workOrderInfoList.stream().collect(Collectors.groupingBy(WorkOrderInfo::getResponsibleId));
+            for (Long s : workOrderInfomap.keySet()) {
+                map.put(s,workOrderInfomap.get(s).size());
+            }
+        }
+        // 使用Stream API和Collectors.toList()将entries转换为List
+        List<Map.Entry<Long, Integer>> entries = new ArrayList<>(map.entrySet());
+
+        // 根据value排序,这里是升序
+        //entries.sort(Map.Entry.comparingByValue());
+        // 如果你需要降序,可以这样做:
+        entries.sort(Map.Entry.comparingByValue(Comparator.reverseOrder()));
+        //取前6个
+        List<Map<String, Object>> listMap = new ArrayList<>();
+        for (int i = 0; i < 6; i++) {
+            if(entries.size()<i+1){
+                break;
+            }
+            Map<String, Object> mapPx = new HashMap<>();
+            SysUser sysUser = userMapper.selectUserById(entries.get(i).getKey());
+            mapPx.put("xh",i+1);
+            mapPx.put("name",sysUser.getNickName());
+            mapPx.put("deptName",sysUser.getDept().getDeptName());
+            mapPx.put("num",entries.get(i).getValue());
+            listMap.add(mapPx);
+        }
+
+        return AjaxResult.success(listMap);
+    }
+
+    @Override
+    public AjaxResult yearFwlx(String time) {
+        if(StringUtils.isEmpty(time)){
+            time = DateUtils.dateTimeNow(YYYY);
+        }
+        Map<String,Object> map = new HashMap<>();
+        int zs = 0;
+        int wlfw = 0;
+        int sbfw = 0;
+        int rjfw = 0;
+        int kffw = 0;
+        int sjfw = 0;
+        int qtfw = 0;
+
+        SysUser user = SecurityUtils.getLoginUser().getUser();
+        //本年单量
+        List<WorkOrderInfo> workOrderInfoList = workOrderInfoMapper.selectWorkOrderInfoListByYear(time,user.getUserId());
+        if(workOrderInfoList!=null && !workOrderInfoList.isEmpty()){
+            zs = workOrderInfoList.size();
+            Map<String,List<WorkOrderInfo>> workOrderInfomap = workOrderInfoList.stream().collect(Collectors.groupingBy(WorkOrderInfo::getType));
+
+            if(workOrderInfomap.get(ONE)!=null && !workOrderInfomap.get(ONE).isEmpty()){
+                wlfw = workOrderInfomap.get(ONE).size();
+            }
+            if(workOrderInfomap.get(TWO)!=null && !workOrderInfomap.get(TWO).isEmpty()){
+                sbfw = workOrderInfomap.get(TWO).size();
+            }
+            if(workOrderInfomap.get(THR)!=null && !workOrderInfomap.get(THR).isEmpty()){
+                rjfw = workOrderInfomap.get(THR).size();
+            }
+            if(workOrderInfomap.get(FOR)!=null && !workOrderInfomap.get(FOR).isEmpty()){
+                kffw = workOrderInfomap.get(FOR).size();
+            }
+            if(workOrderInfomap.get(FIV)!=null && !workOrderInfomap.get(FIV).isEmpty()){
+                sjfw = workOrderInfomap.get(FIV).size();
+            }
+            if(workOrderInfomap.get(SIX)!=null && !workOrderInfomap.get(SIX).isEmpty()){
+                qtfw = workOrderInfomap.get(SIX).size();
+            }
+        }
+        map.put("zs", zs);
+        map.put("wlfw", wlfw);
+        map.put("sbfw", sbfw);
+        map.put("rjfw", rjfw);
+        map.put("kffw", kffw);
+        map.put("sjfw", sjfw);
+        map.put("qtfw", qtfw);
+        return AjaxResult.success(map);
+    }
+
+
 }

+ 96 - 0
ruoyi-system/src/main/resources/mapper/system/OperationRecordMapper.xml

@@ -0,0 +1,96 @@
+<?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.ruoyi.system.mapper.OperationRecordMapper">
+    
+    <resultMap type="OperationRecord" id="OperationRecordResult">
+        <result property="id"    column="id"    />
+        <result property="orderId"    column="order_id"    />
+        <result property="userId"    column="user_id"    />
+        <result property="userName"    column="user_name"    />
+        <result property="record"    column="record"    />
+        <result property="delFlag"    column="del_flag"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="remark"    column="remark"    />
+    </resultMap>
+
+    <sql id="selectOperationRecordVo">
+        select id, order_id, user_id, user_name, record, del_flag, create_by, create_time, update_by, update_time, remark from operation_record
+    </sql>
+
+    <select id="selectOperationRecordList" parameterType="OperationRecord" resultMap="OperationRecordResult">
+        <include refid="selectOperationRecordVo"/>
+        <where>  
+            <if test="orderId != null  and orderId != ''"> and order_id = #{orderId}</if>
+            <if test="userId != null "> and user_id = #{userId}</if>
+            <if test="userName != null  and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
+            <if test="record != null  and record != ''"> and record = #{record}</if>
+        </where>
+        order by create_time
+    </select>
+    
+    <select id="selectOperationRecordById" parameterType="Long" resultMap="OperationRecordResult">
+        <include refid="selectOperationRecordVo"/>
+        where id = #{id}
+    </select>
+
+    <insert id="insertOperationRecord" parameterType="OperationRecord" useGeneratedKeys="true" keyProperty="id">
+        insert into operation_record
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="orderId != null">order_id,</if>
+            <if test="userId != null">user_id,</if>
+            <if test="userName != null">user_name,</if>
+            <if test="record != null">record,</if>
+            <if test="delFlag != null">del_flag,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="remark != null">remark,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="orderId != null">#{orderId},</if>
+            <if test="userId != null">#{userId},</if>
+            <if test="userName != null">#{userName},</if>
+            <if test="record != null">#{record},</if>
+            <if test="delFlag != null">#{delFlag},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="remark != null">#{remark},</if>
+         </trim>
+    </insert>
+
+    <update id="updateOperationRecord" parameterType="OperationRecord">
+        update operation_record
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="orderId != null">order_id = #{orderId},</if>
+            <if test="userId != null">user_id = #{userId},</if>
+            <if test="userName != null">user_name = #{userName},</if>
+            <if test="record != null">record = #{record},</if>
+            <if test="delFlag != null">del_flag = #{delFlag},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="remark != null">remark = #{remark},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteOperationRecordById" parameterType="Long">
+        delete from operation_record where id = #{id}
+    </delete>
+
+    <delete id="deleteOperationRecordByIds" parameterType="String">
+        delete from operation_record where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 32 - 2
ruoyi-system/src/main/resources/mapper/system/WorkOrderInfoMapper.xml

@@ -6,6 +6,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     
     <resultMap type="WorkOrderInfo" id="WorkOrderInfoResult">
         <result property="orderId"    column="order_id"    />
+        <result property="userId"    column="user_id"    />
+        <result property="userName"    column="user_name"    />
         <result property="unitName"    column="unit_name"    />
         <result property="provinceId"    column="province_id"    />
         <result property="province"    column="province"    />
@@ -27,6 +29,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="serviceProgress"    column="service_progress"    />
         <result property="serviceType"    column="service_type"    />
         <result property="orderPlacement"    column="order_placement"    />
+        <result property="agency"    column="agency"    />
         <result property="responsibleId"    column="responsible_id"    />
         <result property="responsibleName"    column="responsible_name"    />
         <result property="responsiblePhone"    column="responsible_phone"    />
@@ -45,12 +48,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectWorkOrderInfoVo">
-        select order_id, unit_name, province_id, province, city_id, city, region_id, region, detailed_address, lon, lat, person_name, phonenumber, sex, type, demand, is_signature, evaluation, evaluation_content, service_progress,service_type, order_placement, responsible_id, responsible_name,responsible_phone,take_time, project_name, shelf_life, is_charge, total_cost, total_cost_dx, del_flag, create_by, create_time, update_by, update_time, remark from work_order_info
+        select order_id,user_id,user_name, unit_name, province_id, province, city_id, city, region_id, region, detailed_address, lon, lat, person_name, phonenumber, sex, type, demand, is_signature, evaluation, evaluation_content, service_progress,service_type, order_placement,agency, responsible_id, responsible_name,responsible_phone,take_time, project_name, shelf_life, is_charge, total_cost, total_cost_dx, del_flag, create_by, create_time, update_by, update_time, remark from work_order_info
     </sql>
 
     <select id="selectWorkOrderInfoList" parameterType="WorkOrderInfo" resultMap="WorkOrderInfoResult">
         <include refid="selectWorkOrderInfoVo"/>
-        <where>  
+        <where>
+            <if test="userId != null  and userId != ''"> and user_id = #{userId}</if>
+            <if test="userName != null  and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
             <if test="unitName != null  and unitName != ''"> and unit_name like concat('%', #{unitName}, '%')</if>
             <if test="provinceId != null  and provinceId != ''"> and province_id = #{provinceId}</if>
             <if test="province != null  and province != ''"> and province = #{province}</if>
@@ -72,6 +77,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="serviceProgress != null  and serviceProgress != ''"> and service_progress = #{serviceProgress}</if>
             <if test="serviceType != null  and serviceType != ''"> and service_type = #{serviceType}</if>
             <if test="orderPlacement != null  and orderPlacement != ''"> and order_placement = #{orderPlacement}</if>
+            <if test="agency != null  and agency != ''"> and agency = #{agency}</if>
             <if test="responsibleId != null "> and responsible_id = #{responsibleId}</if>
             <if test="responsibleName != null  and responsibleName != ''"> and responsible_name like concat('%', #{responsibleName}, '%')</if>
             <if test="responsiblePhone != null  and responsiblePhone != ''"> and responsible_phone = #{responsiblePhone}</if>
@@ -80,6 +86,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="isCharge != null  and isCharge != ''"> and is_charge = #{isCharge}</if>
             <if test="totalCost != null  and totalCost != ''"> and total_cost = #{totalCost}</if>
             <if test="totalCostDx != null  and totalCostDx != ''"> and total_cost_dx = #{totalCostDx}</if>
+            <if test="delFlag != null  and delFlag != ''"> and del_flag = #{delFlag}</if>
             <if test="createTime != null and createTime != ''"><!-- 开始时间检索 -->
                 and date_format(create_time,'%y%m%d') = date_format(#{createTime},'%y%m%d')
             </if>
@@ -101,12 +108,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         where take_time &gt;= #{startDate}
         and take_time &lt;= #{endDate}
         and responsible_id = #{userId}
+        and order_placement !=null
+    </select>
+    <select id="selectWorkOrderInfoListBymonthOne" parameterType="WorkOrderInfo" resultMap="WorkOrderInfoResult">
+        <include refid="selectWorkOrderInfoVo"/>
+        where date_format(create_time,'%y%m') = date_format(#{month},'%y%m') and del_flag = 'N' and responsible_id != null
+    </select>
+    <select id="selectWorkOrderInfoListByYearOne" parameterType="WorkOrderInfo" resultMap="WorkOrderInfoResult">
+        <include refid="selectWorkOrderInfoVo"/>
+        where date_format(create_time,'%y') = date_format(#{year},'%y') and del_flag = 'N' and responsible_id != null
+    </select>
+    <select id="selectWorkOrderInfoListByYear" parameterType="WorkOrderInfo" resultMap="WorkOrderInfoResult">
+        <include refid="selectWorkOrderInfoVo"/>
+        where date_format(create_time,'%y') = date_format(#{year},'%y') and del_flag = 'N'
+        <if test="userId != null and userId !=0"> and responsible_id = #{userId}</if>
     </select>
 
     <insert id="insertWorkOrderInfo" parameterType="WorkOrderInfo">
         insert into work_order_info
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="orderId != null">order_id,</if>
+            <if test="userId != null  ">user_id,</if>
+            <if test="userName != null ">user_name,</if>
             <if test="unitName != null">unit_name,</if>
             <if test="provinceId != null">province_id,</if>
             <if test="province != null">province,</if>
@@ -128,6 +151,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="serviceProgress != null">service_progress,</if>
             <if test="serviceType != null "> service_type,</if>
             <if test="orderPlacement != null">order_placement,</if>
+            <if test="agency != null  ">agency,</if>
             <if test="responsibleId != null">responsible_id,</if>
             <if test="responsibleName != null">responsible_name,</if>
             <if test="responsiblePhone != null">responsible_phone,</if>
@@ -146,6 +170,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="orderId != null">#{orderId},</if>
+            <if test="userId != null  ">#{userId},</if>
+            <if test="userName != null  ">#{userName},</if>
             <if test="unitName != null">#{unitName},</if>
             <if test="provinceId != null">#{provinceId},</if>
             <if test="province != null">#{province},</if>
@@ -167,6 +193,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="serviceProgress != null">#{serviceProgress},</if>
             <if test="serviceType != null "> #{serviceType},</if>
             <if test="orderPlacement != null">#{orderPlacement},</if>
+            <if test="agency != null  ">#{agency},</if>
             <if test="responsibleId != null">#{responsibleId},</if>
             <if test="responsibleName != null">#{responsibleName},</if>
             <if test="responsiblePhone != null">#{responsiblePhone},</if>
@@ -188,6 +215,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <update id="updateWorkOrderInfo" parameterType="WorkOrderInfo">
         update work_order_info
         <trim prefix="SET" suffixOverrides=",">
+            <if test="userId != null  "> user_id = #{userId},</if>
+            <if test="userName != null  ">user_name = #{userName},</if>
             <if test="unitName != null">unit_name = #{unitName},</if>
             <if test="provinceId != null">province_id = #{provinceId},</if>
             <if test="province != null">province = #{province},</if>
@@ -209,6 +238,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="serviceProgress != null">service_progress = #{serviceProgress},</if>
             <if test="serviceType != null ">service_type = #{serviceType},</if>
             <if test="orderPlacement != null">order_placement = #{orderPlacement},</if>
+            <if test="agency != null  "> agency = #{agency},</if>
             <if test="responsibleId != null">responsible_id = #{responsibleId},</if>
             <if test="responsibleName != null">responsible_name = #{responsibleName},</if>
             <if test="responsiblePhone != null">responsible_phone = #{responsiblePhone},</if>