chenlu
2024-03-15 74bb31c344b2c66239bfa7f17fd5dc3bd3e2172f
完善质检审核功能
8个文件已修改
87 ■■■■■ 已修改文件
north-glass-erp/northglass-erp/src/views/pp/reportingWorks/AddReportingWork.vue 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/reportingWorks/QualityInReviewDetail.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/reportingWorks/QualityInspectionReview.vue 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/controller/pp/ReportingWorkController.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/entity/pp/ReportingWork.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/service/pp/ReportingWorkService.java 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/resources/mapper/pp/ReportingWork.xml 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/target/classes/mapper/pp/ReportingWork.xml 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/reportingWorks/AddReportingWork.vue
@@ -98,6 +98,11 @@
          name: '修改',
          status: 'primary',
        }
        if(route.query.reviewStatus === "1"){
          button.name='审核'
          titleUploadData.value.qualityInspector=user.user.userName
        }
        gridOptions.toolbarConfig.buttons.push(button)
      }
      inputDisabled.value = true
@@ -648,6 +653,7 @@
  }
  gridOptions.toolbarConfig.buttons[0].disabled=true
  gridOptions.toolbarConfig.buttons[1].disabled=true
  //判断保存还是修改
  if(saveType==='save'){
    saveReportingWorkRequest(requestData)
  }else{
@@ -682,7 +688,11 @@
//更新报工数据
const updateReportingWorkRequest = (requestData) =>{
  request.post(`/reportingWork/updateReportingWork`,requestData).then(res =>{
  let reviewState = 'update'
  if(route.query.reviewStatus==="1"){
    reviewState = 'review'
  }
  request.post(`/reportingWork/updateReportingWork/${reviewState}`,requestData).then(res =>{
    if (res.code == 200){
      ElMessage.success("报工修改成功")
      router.push({path:'/main/reportingWorks/AddReportingWork',
north-glass-erp/northglass-erp/src/views/pp/reportingWorks/QualityInReviewDetail.vue
@@ -63,7 +63,6 @@
request.post(`/reportingWork/detailsQuality/${reportingWorkId}/${processId}/${thisProcess}`, filterData.value).then((res) => {
  if (res.code == 200) {
    console.log(res.data.basic)
    produceList = produceList.value.concat(deepClone(res.data.data))
    xGrid.value.reloadData(produceList)
    gridOptions.loading = false
north-glass-erp/northglass-erp/src/views/pp/reportingWorks/QualityInspectionReview.vue
@@ -17,7 +17,7 @@
  switch (type) {
    case 'edit' :{
      //alert('我接收到子组件传送的编辑信息')
      router.push({path: '/main/reportingWorks/QualityInReviewDetail', query: { reportingWorkId: row.reportingWorkId,processId:row.processId,thisProcess:row.thisProcess }})
      router.push({path: '/main/reportingWorks/AddReportingWork', query: { reportingWorkId: row.reportingWorkId,reviewStatus:"1" }})
      break
    }
    case 'delete':{
@@ -29,7 +29,6 @@
      let endTime = form.date1[1]
      let state = optionVal.value
      let inputVal = form.processId
      //console.log(startTime,endTime,state,inputVal)
      request.post(`/reportingWork/updateQualityStatus/${row.reportingWorkId}/${username}`).then((res) => {
        if (res.code == 200) {
          ElMessage.success(t('processCard.modifySuccessfully'))
@@ -277,7 +276,7 @@
    {title: '操作', width: 120, slots: { default: 'button_slot' },fixed:"left"},
    { type: 'seq',fixed:"left", title: '自序', width: 50 },
    {field: 'reportingWorkId',width: 120,  title: '报工编号',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, },
    {field: 'reportingWorkId',width: 130,  title: '报工编号',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, },
    {field: 'reportingWorkTime',width: 120, title: '报工时间',showOverflow:"ellipsis" },
    {field: 'processId',width: 130, title: '流程卡号',filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
    {field: 'order.project',width: 120, title: '项目名称',filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
@@ -290,6 +289,7 @@
    {field: 'previousProcess', width: 100,title: '上工序'},
    {field: 'nextProcess',width: 100, title: '下工序'},
    {field: 'qualityInspector',width: 120, title: '质检员'},
    {field: 'qualityInsTime',width: 120, title: '质检时间'},
    {field: 'damageDetails.qualityInsStatus',width: 120, title: '质检状态'}
  ],//表头按钮
@@ -387,7 +387,7 @@
      <!--左边固定显示的插槽-->
      <template #button_slot="{ row }">
        <el-button @click="getTableRow(row,'edit')" link type="primary" size="small">编辑</el-button>
        <el-button v-if="state==1" @click="getTableRow(row,'setType')" link type="primary" size="small">审核</el-button>
        <el-button v-if="row.damageDetails.qualityInsStatus===1" @click="getTableRow(row,'setType')" link type="primary" size="small">审核</el-button>
        <el-button v-else disabled @click="getTableRow(row,'setType')" link type="primary" size="small">审核</el-button>
      </template>
north-glass-erp/src/main/java/com/example/erp/controller/pp/ReportingWorkController.java
@@ -24,7 +24,7 @@
        this.reportingWorkService = reportingWorkService;
    }
    @ApiOperation("报工新增查询")
    @PostMapping  ("/addSelectLastWork/{processIdStr}/{technologyStr}/{process}")
    public Result AddSelectLastWork(
            @PathVariable String processIdStr,
@@ -32,6 +32,7 @@
            @PathVariable String process)  {
        return  Result.seccess(reportingWorkService.AddSelectLastWorkSv(processIdStr,technologyStr,process));
    }
    @ApiOperation("查询工序")
    @PostMapping  ("/selectProcess")
    public Result SelectProcess()  {
        return  Result.seccess(reportingWorkService.SelectProcessSv());
@@ -55,9 +56,9 @@
        return  Result.seccess(reportingWorkService.selectUpdateReportingWorkSv(reportingWorkId));
    }
    @ApiOperation("报工修改")
    @PostMapping  ("/updateReportingWork")
    public Result updateReportingWork(@RequestBody Map<String,Object> reportingWork)  {
        return  Result.seccess(reportingWorkService.updateReportingWork(reportingWork));
    @PostMapping  ("/updateReportingWork/{reviewState}")
    public Result updateReportingWork(@PathVariable String reviewState,@RequestBody Map<String,Object> reportingWork)  {
        return  Result.seccess(reportingWorkService.updateReportingWork(reportingWork,reviewState));
    }
    @ApiOperation("报工查询接口")
north-glass-erp/src/main/java/com/example/erp/entity/pp/ReportingWork.java
@@ -66,13 +66,17 @@
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime reportingWorkTime;
    //审核时间
    private LocalDate examineTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime examineTime;
    //质检时间
    private LocalDate qualityInsTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime qualityInsTime;
    //建立时间
    private LocalDate createTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime createTime;
    //修改时间
    private LocalDate updateTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime updateTime;
    //创建者
    private String creatorId ;
north-glass-erp/src/main/java/com/example/erp/service/pp/ReportingWorkService.java
@@ -25,6 +25,7 @@
import org.springframework.transaction.annotation.Transactional;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.util.*;
@Service
@@ -49,7 +50,6 @@
    final
    OrderProcessDetailService orderProcessDetailService;
    public ReportingWorkService(ReportingWorkMapper reportingWorkMapper, BasicDateProduceMapper basicDateProduceMapper, DamageDetailsMapper damageDetailsMapper, ReportingWorkDetailMapper reportingWorkDetailMapper, OrderProcessDetailMapper orderProcessDetailMapper, OrderProcessDetailService orderProcessDetailService, OrderMapper orderMapper, FlowCardMapper flowCardMapper) {
@@ -94,9 +94,7 @@
                } else {
                    nextProcess = processList[i + 1];
                }
                //System.out.println("当前工序:" + process + " 上一道工序:" + previousProcess + " 下一道工序:" + nextProcess);
                //查询当前工序的表头数据
               //System.out.println(reportingWorkMapper.AddSelectLastWorkMp(processIdStr, technologyStr,previousProcess,nextProcess,process));
                map.put("data", reportingWorkMapper.AddSelectLastWorkMp(processIdStr, technologyStr,previousProcess,nextProcess,process));
                map.put("thisProcess", processList);
                break;
@@ -118,8 +116,7 @@
        if (interceptProcess.equals(process)) {
            //是第一道工序,查询流程卡数据
            map.put("Detail", reportingWorkMapper.SelectTechnologicalNumMp(processIdStr,technologyStr,process));
        }
        else {
        } else {
            //不是第一道工序,查询报工数据
            map.put("Detail", reportingWorkMapper.SelectReworlDetailMp(processIdStr,technologyStr,process));
        }
@@ -138,10 +135,10 @@
        map.put("historyProcess",reportingWorkMapper.SelectHistoryProcessMp(historyProcess,process));
        return map;
    }
    //查询工序
    public Map<String, Object> SelectProcessSv() {
        Map<String, Object> map = new HashMap<>();
        map.put("process", reportingWorkMapper.SelectProcessMp());
@@ -325,11 +322,11 @@
        map.put("basic",getReportingWorkBase(reportingWork.getProcessId(),reportingWork.getThisProcess()));
        return map;
    }
    //报工下拉框数据
    private Map<String,Object> getReportingWorkBase(String processId, String thisProcess) {
        Map<String,Object> map = new HashMap<>();
        //设备下拉框
@@ -355,7 +352,7 @@
    @Transactional
    //报工修改
    public Boolean updateReportingWork(Map<String, Object> reportingWorkMap) {
    public Boolean updateReportingWork(Map<String, Object> reportingWorkMap, String reviewState) {
        //接收解析主附表信息
        JSONObject reportingWorkJson = new JSONObject(reportingWorkMap);
        ReportingWork reportingWork = JSONObject.parseObject(JSONObject.toJSONString(reportingWorkJson.get("title")), ReportingWork.class);
@@ -382,16 +379,29 @@
                    if(!Objects.equals(reportingWork.getThisProcess(), damageDetail.getResponsibleProcess())){
                        damageDetail.setQualityInsStatus(1);
                    }
                    if (Objects.equals(reviewState, "review")) {
                        damageDetail.setQualityInsStatus(2);
                    }
                    damageDetailsMapper.insert(damageDetail);
                });
            }
            //插入报工数据
            reportingWorkDetailMapper.insert(reportingWorkDetail);
        });
        //获取质检时间
        if (Objects.equals(reviewState, "review")) {
            LocalDateTime
                    currentDate = LocalDateTime.now();
            reportingWork.setQualityInsTime(currentDate);
            reportingWorkMapper.updateById(reportingWork);
        }
        //修改小片流程表数量为报工明细表数量
        orderProcessDetailMapper.updateQuantity(reportingWork.getReportingWorkId(),reportingWork.getThisProcess(),"add");
        return  true;
    }
    //报工管理查询
    public Map<String, Object> selectReportingWorkSv(Integer pageNum, Integer pageSize, java.sql.Date selectTime1, java.sql.Date selectTime2, String orderId, ReportingWork reportingWork) {
        Integer offset = (pageNum - 1) * pageSize;
@@ -401,10 +411,10 @@
        Map<String, Object> map = new HashMap<>();
        map.put("data", reportingWorkMapper.selectReportingWorkMp(offset, pageSize, selectTime1, selectTime2, orderId, reportingWork));
        map.put("total", reportingWorkMapper.getPageTotal(offset, pageSize, selectTime1, selectTime2, orderId, reportingWork));
        //System.out.println(map.get("data"));
        return map;
    }
    //删除报工
    public Boolean deleteWorkSv(String reportingWorkId, String processId, String thisProcess) {
        if (!reportingWorkId.isEmpty() && !processId.isEmpty() && !thisProcess.isEmpty()) {
            //获取当前报工编号下工序
@@ -417,7 +427,6 @@
            if (lastProcess.equals(thisProcess)) {//是入库工序
                //查询该流程卡数量、可入库数量、已入库数量
                Map<String, Object> list = reportingWorkMapper.selectReceiptQuantity(processId);
                // System.out.println(list.get("quantity")+"--"+list.get("inventoryQuantity")+"---"+list.get("receivedQuantity"));
                if (list.get("quantity") == list.get("receiptQuantity")) {
                    return false;
                } else {
@@ -428,7 +437,6 @@
                    //查询该报工编号本工序完工数量
                    Integer completedQuantity = reportingWorkMapper.selectCompletedQuantity(reportingWorkId);
                    //当该工序完工数量小于等于已入库数量时
                    //System.out.println("inventoryQuantity:" + inventoryQuantity +"completedQuantity:" + completedQuantity + "---receiptQuantity:" + receiptQuantity);
                    //可入库数量-已入库数量>=报工编号本工序完工数量
                    if (inventoryQuantity - receiptQuantity >= completedQuantity) {
                        //查询当前报工编号完工次破数量的数据
@@ -448,8 +456,7 @@
                    }
                }
            }
          else{//不是入库工序
            } else {//不是入库工序
              if (count==0){
                  //查询当前报工编号完工次破数量的数据
                  List<Map<String, Object>> workDateList=reportingWorkMapper.reportingWorkDate(reportingWorkId);
@@ -460,8 +467,7 @@
                  //删除报工,将审核状态改为-1
                  reportingWorkMapper.deleteWork(reportingWorkId);
                  return true;
              }
            else {
                } else {
                return false;
            }
          }
@@ -472,6 +478,7 @@
        }
    }
    //查询质检审核
    public Map<String, Object> selectQualityTestingSv(Integer pageNum, Integer pageSize, java.sql.Date selectTime1, java.sql.Date selectTime2, Integer state, String processId, ReportingWork reportingWork) {
        Integer offset = (pageNum - 1) * pageSize;
        if (processId.equals("null")) {
@@ -484,6 +491,7 @@
        return map;
    }
    //修改质检审核状态
    public Boolean updateQualityStatusSv(String reportingWorkId,String username) {
        if (!reportingWorkId.isEmpty()) {
            reportingWorkMapper.updateQualityStatusMp(reportingWorkId,username);
@@ -493,11 +501,12 @@
        }
    }
    //查询质检明细(未使用)
    public Map<String, Object> detailsQualitySv(String reportingWorkId,String processId,String thisProcess, ReportingWork reportingWork) {
        Map<String, Object> map = new HashMap<>();
        map.put("data", reportingWorkMapper.detailsQualityMp(reportingWorkId, reportingWork));
        map.put("basic",getReportingWorkBase(processId,thisProcess));
        System.out.println(map.get("basic"));
        return map;
    }
}
north-glass-erp/src/main/resources/mapper/pp/ReportingWork.xml
@@ -22,6 +22,7 @@
        <result property="completedArea" column="completedArea"/>
        <result property="wornArea" column="wornArea"/>
        <result property="qualityInspector" column="quality_inspector"/>
        <result property="qualityInsTime" column="quality_ins_time"/>
        <association property="order" javaType="com.example.erp.entity.sd.Order">
            <result property="customerId" column="customer_id"/>
@@ -594,6 +595,7 @@
               rw.previous_process,
               rw.next_process,
               rw.quality_inspector,
               rw.quality_ins_time,
               dd.quality_ins_status
        from sd.order as o
                 left join sd.order_glass_detail as ogd on ogd.order_id = o.order_id
north-glass-erp/target/classes/mapper/pp/ReportingWork.xml
@@ -22,6 +22,7 @@
        <result property="completedArea" column="completedArea"/>
        <result property="wornArea" column="wornArea"/>
        <result property="qualityInspector" column="quality_inspector"/>
        <result property="qualityInsTime" column="quality_ins_time"/>
        <association property="order" javaType="com.example.erp.entity.sd.Order">
            <result property="customerId" column="customer_id"/>
@@ -594,6 +595,7 @@
               rw.previous_process,
               rw.next_process,
               rw.quality_inspector,
               rw.quality_ins_time,
               dd.quality_ins_status
        from sd.order as o
                 left join sd.order_glass_detail as ogd on ogd.order_id = o.order_id