| | |
| | | name: '修改', |
| | | status: 'primary', |
| | | } |
| | | if(route.query.reviewStatus === "1"){ |
| | | button.name='审核' |
| | | titleUploadData.value.qualityInspector=user.user.userName |
| | | } |
| | | |
| | | gridOptions.toolbarConfig.buttons.push(button) |
| | | } |
| | | inputDisabled.value = true |
| | |
| | | } |
| | | gridOptions.toolbarConfig.buttons[0].disabled=true |
| | | gridOptions.toolbarConfig.buttons[1].disabled=true |
| | | //判断保存还是修改 |
| | | if(saveType==='save'){ |
| | | saveReportingWorkRequest(requestData) |
| | | }else{ |
| | |
| | | |
| | | //更新报工数据 |
| | | 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', |
| | |
| | | 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 |
| | |
| | | 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':{ |
| | |
| | | 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')) |
| | |
| | | {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' }}, |
| | |
| | | {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: '质检状态'} |
| | | ],//表头按钮 |
| | | |
| | |
| | | <!--左边固定显示的插槽--> |
| | | <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> |
| | | |
| | |
| | | this.reportingWorkService = reportingWorkService; |
| | | } |
| | | |
| | | |
| | | @ApiOperation("报工新增查询") |
| | | @PostMapping ("/addSelectLastWork/{processIdStr}/{technologyStr}/{process}") |
| | | public Result AddSelectLastWork( |
| | | @PathVariable String processIdStr, |
| | |
| | | @PathVariable String process) { |
| | | return Result.seccess(reportingWorkService.AddSelectLastWorkSv(processIdStr,technologyStr,process)); |
| | | } |
| | | @ApiOperation("查询工序") |
| | | @PostMapping ("/selectProcess") |
| | | public Result SelectProcess() { |
| | | return Result.seccess(reportingWorkService.SelectProcessSv()); |
| | |
| | | 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("报工查询接口") |
| | |
| | | @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 ; |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDateTime; |
| | | import java.util.*; |
| | | |
| | | @Service |
| | |
| | | |
| | | final |
| | | OrderProcessDetailService orderProcessDetailService; |
| | | |
| | | |
| | | |
| | | public ReportingWorkService(ReportingWorkMapper reportingWorkMapper, BasicDateProduceMapper basicDateProduceMapper, DamageDetailsMapper damageDetailsMapper, ReportingWorkDetailMapper reportingWorkDetailMapper, OrderProcessDetailMapper orderProcessDetailMapper, OrderProcessDetailService orderProcessDetailService, OrderMapper orderMapper, FlowCardMapper flowCardMapper) { |
| | |
| | | } 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; |
| | |
| | | if (interceptProcess.equals(process)) { |
| | | //是第一道工序,查询流程卡数据 |
| | | map.put("Detail", reportingWorkMapper.SelectTechnologicalNumMp(processIdStr,technologyStr,process)); |
| | | } |
| | | else { |
| | | } else { |
| | | //不是第一道工序,查询报工数据 |
| | | map.put("Detail", reportingWorkMapper.SelectReworlDetailMp(processIdStr,technologyStr,process)); |
| | | } |
| | |
| | | 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()); |
| | |
| | | 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<>(); |
| | | //设备下拉框 |
| | |
| | | |
| | | @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); |
| | |
| | | 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; |
| | |
| | | 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()) { |
| | | //获取当前报工编号下工序 |
| | |
| | | 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 { |
| | |
| | | //查询该报工编号本工序完工数量 |
| | | Integer completedQuantity = reportingWorkMapper.selectCompletedQuantity(reportingWorkId); |
| | | //当该工序完工数量小于等于已入库数量时 |
| | | //System.out.println("inventoryQuantity:" + inventoryQuantity +"completedQuantity:" + completedQuantity + "---receiptQuantity:" + receiptQuantity); |
| | | //可入库数量-已入库数量>=报工编号本工序完工数量 |
| | | if (inventoryQuantity - receiptQuantity >= completedQuantity) { |
| | | //查询当前报工编号完工次破数量的数据 |
| | |
| | | } |
| | | } |
| | | |
| | | } |
| | | else{//不是入库工序 |
| | | } else {//不是入库工序 |
| | | if (count==0){ |
| | | //查询当前报工编号完工次破数量的数据 |
| | | List<Map<String, Object>> workDateList=reportingWorkMapper.reportingWorkDate(reportingWorkId); |
| | |
| | | //删除报工,将审核状态改为-1 |
| | | reportingWorkMapper.deleteWork(reportingWorkId); |
| | | return true; |
| | | } |
| | | else { |
| | | } else { |
| | | return false; |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | //查询质检审核 |
| | | 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")) { |
| | |
| | | return map; |
| | | } |
| | | |
| | | //修改质检审核状态 |
| | | public Boolean updateQualityStatusSv(String reportingWorkId,String username) { |
| | | if (!reportingWorkId.isEmpty()) { |
| | | reportingWorkMapper.updateQualityStatusMp(reportingWorkId,username); |
| | |
| | | } |
| | | } |
| | | |
| | | //查询质检明细(未使用) |
| | | 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; |
| | | } |
| | | } |
| | |
| | | <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"/> |
| | |
| | | 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 |
| | |
| | | <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"/> |
| | |
| | | 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 |