已添加7个文件
已重命名1个文件
已修改28个文件
已删除4个文件
| | |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.mom.pojo.FinishedInspect; |
| | | import com.yuanchu.mom.pojo.vo.FinishedInspectVo1; |
| | | import com.yuanchu.mom.pojo.ProcessInspect; |
| | | import com.yuanchu.mom.pojo.vo.FinishedInspectVo; |
| | | import com.yuanchu.mom.service.*; |
| | | import com.yuanchu.mom.utils.JackSonUtil; |
| | | import com.yuanchu.mom.utils.Jwt; |
| | |
| | | |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | |
| | | @Autowired |
| | | Jwt jwt; |
| | | |
| | | @ApiOperation(value = "æ°å¢è¿ç¨æ£éªå-->æ ¹æ®è®¢åå·éæ©äº§åä¿¡æ¯åå·¥èº") |
| | | @ApiOperation(value = "æ°å¢æåæ£éªå-->æ ¹æ®è®¢åå·éæ©äº§åä¿¡æ¯åå·¥èº") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "orderNumber", value = "订åç¼å·", dataTypeClass = String.class, required = true) |
| | | }) |
| | |
| | | return Result.success(finishedInspectService.chooseMater(orderNumber)); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ°å¢è¿ç¨æ£éªå-->éæ©è®¾å¤") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "technologyId", value = "å
³èçå·¥èºè·¯çº¿id", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "father", value = "项ç®ç¶åç§°", dataTypeClass = String.class, required = true), |
| | | @ApiImplicitParam(name = "name", value = "项ç®åç§°", dataTypeClass = String.class, required = true) |
| | | }) |
| | | @GetMapping("/chooseDev") |
| | | public Result<?> chooseDev(Integer technologyId, String father, String name) { |
| | | return Result.success(finishedInspectService.chooseDev(technologyId,father,name)); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ°å¢è¿ç¨æ£éªå") |
| | | @PostMapping("/addProcess") |
| | | public Result<?> addProcess(@RequestHeader("token") String token, @RequestBody FinishedInspectVo1 finishedInspectVo1) throws Exception { |
| | | @ApiOperation(value = "æ°å¢æåæ£éªå") |
| | | @PostMapping("/addFinish") |
| | | public Result<?> addFinish(@RequestHeader("token") String token, @Validated @RequestBody FinishedInspectVo finishedInspectVo) throws Exception { |
| | | Map<String, String> data = JackSonUtil.unmarshal(jwt.readJWT(token).get("data"), Map.class); |
| | | return Result.success(finishedInspectService.addProcess(data.get("id").replaceAll("\"", ""), finishedInspectVo1)); |
| | | return Result.success(finishedInspectService.addProcessInspectionSheet(data.get("id").replaceAll("\"", ""), finishedInspectVo)); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "æ°å¢æé®-->1ãæ°å¢æåæ£éªå") |
| | | @PostMapping("/add_process_inspection_sheet") |
| | | public Result<?> addProcessInspectionSheet(@Validated @RequestBody FinishedInspect finishedInspect) { |
| | | Integer isInsertSuccess = finishedInspectService.addProcessInspectionSheet(finishedInspect); |
| | | if (isInsertSuccess == 1) { |
| | | return Result.success("æ°å¢æåï¼", finishedInspect.getId()); |
| | | } |
| | | return Result.fail("æ°å¢å¤±è´¥ï¼"); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "æ°å¢æé®-->1ãæ°å¢è¿ç¨æ£éªå-->1ã项ç®åç§°ä¸ææ¡") |
| | | @GetMapping("/list_material") |
| | | public Result<?> selectMaterialIdAndNameAndCode() { |
| | | List<Map<String, Object>> maps = materialService.selectMaterialIdAndNameAndCode(); |
| | | return Result.success(maps); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ°å¢æé®-->3ãæ£éªç»è®º") |
| | | @ApiOperation(value = "䏿¥(æ´æ°æ£éªç¶æ)") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "finishedInspectId", value = "æ£éªåId", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "result", value = "æ£éªç»è®º", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "id", value = "æ£éªåid", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @PostMapping("/inspection_conclusion") |
| | | public Result<?> inspectionConclusion(@RequestHeader("token") String token, Integer finishedInspectId, Integer result) throws Exception { |
| | | Map<String, String> data = JackSonUtil.unmarshal(jwt.readJWT(token).get("data"), Map.class); |
| | | Integer isInsertSuccess = finishedInspectService.inspectionConclusion(data.get("name").replaceAll("\"", ""), finishedInspectId, result); |
| | | if (isInsertSuccess == 1) { |
| | | return Result.success("䏿¥æåï¼"); |
| | | @PostMapping("/updateFinishInspectsById") |
| | | public Result updateFinishInspectsById(@RequestHeader("token") String token, Integer id) throws Exception { |
| | | //妿已ç»ä¸æ¥äºä¸è½å䏿¬¡ä¸æ¥ |
| | | FinishedInspect finishedInspect = finishedInspectService.getById(id); |
| | | if (ObjectUtils.isNotEmpty(finishedInspect.getResult())) { |
| | | return Result.fail("å·²ç»ä¸æ¥è¿äº,ä¸è½åæ¬¡ä¸æ¥!"); |
| | | } |
| | | return Result.fail("䏿¥å¤±è´¥ï¼"); |
| | | Map<String, String> data = JackSonUtil.unmarshal(jwt.readJWT(token).get("data"), Map.class); |
| | | return Result.success(finishedInspectService.updateFinishInspectsById(data.get("name").replaceAll("\"", ""), id)); |
| | | } |
| | | |
| | | @ApiOperation(value = "4ã主页å页") |
| | | @ApiOperation(value = "æ ¹æ®æ£éªåidæ¥è¯¢æåæ£éªå详æ
") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "æ£éªåid", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @GetMapping("/selectFinishInspectsListById") |
| | | public Result selectFinishInspectsListById(Integer id) { |
| | | return Result.success(finishedInspectService.selectFinishInspectsListById(id)); |
| | | } |
| | | |
| | | @ApiOperation(value = "å页æ¥è¯¢æåæ£éªåå表") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "pageNo", value = "æ¡æ°/页", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "pageSize", value = "页æ°", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "inspectResult", value = "æ£éªç»æ", dataTypeClass = Integer.class), |
| | | @ApiImplicitParam(name = "inspectDate", value = "æ£éªæ¥æ", dataTypeClass = Date.class, dataType = "date"), |
| | | @ApiImplicitParam(name = "inspectUsername", value = "主æºå·¥", dataTypeClass = String.class) |
| | | @ApiImplicitParam(name = "result", value = "æ£éªç»æ(为空=å
¨é¨)", dataTypeClass = Integer.class), |
| | | @ApiImplicitParam(name = "material", value = "产ååç§°", dataTypeClass = String.class) |
| | | }) |
| | | @GetMapping("/list_page") |
| | | public Result<?> selectFinishedInspectPage(Integer pageNo, Integer pageSize, Integer inspectResult, String inspectDate, String inspectUsername) { |
| | | IPage<Map<String, Object>> page = finishedInspectService.selectFinishedInspectPage(new Page<Object>(pageNo, pageSize), inspectResult, inspectDate, inspectUsername); |
| | | public Result<?> list_page(Integer pageNo, Integer pageSize, Integer result, String material) { |
| | | IPage<Map<String, Object>> page = finishedInspectService.selectFinishedInspectPage(new Page<Object>(pageNo, pageSize), result, material); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("total", page.getTotal()); |
| | | map.put("row", page.getRecords()); |
| | |
| | | * @author zss |
| | | * @since 2023-08-07 10:04:01 |
| | | */ |
| | | @Api(tags = "QMS管ç-->ä¸åæ ¼å管ç") |
| | | @RestController |
| | | @RequestMapping("/inspectUnaccepted") |
| | | public class InspectUnacceptedController { |
| | |
| | | |
| | | /** |
| | | * <p> |
| | | * å端æ§å¶å¨ |
| | | * å端æ§å¶å¨ |
| | | * </p> |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2023-08-01 |
| | | */ |
| | | @Api(tags = "QMS管ç-->æåæ£éª") |
| | | @Api(tags = "QMS管ç-->æåè¿ç¨æ£éªé¡¹ç®") |
| | | @RestController |
| | | @RequestMapping("/inspection-item") |
| | | public class InspectionItemController { |
| | |
| | | @Autowired |
| | | private InspectionItemService inspectionItemService; |
| | | |
| | | |
| | | @Autowired |
| | | private Jwt jwt; |
| | | |
| | | @ApiOperation(value = "æ°å¢æé®-->2ãæ¥è¯¢æææ£éªé¡¹ç®") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "finishInspectId",value = "æåæ£éªåId",dataTypeClass = Integer.class,required = true) |
| | | @ApiImplicitParam(name = "id", value = "æ£éªåId", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "type", value = "ç±»å", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @GetMapping("/list_user") |
| | | public Result<?> selectInspectionItem(Integer finishInspectId){ |
| | | List<InspectionItemDto> inspectionItemDto = inspectionItemService.selectInspectionItem(finishInspectId); |
| | | public Result<?> selectInspectionItem(Integer id, Integer type) { |
| | | List<InspectionItemDto> inspectionItemDto = inspectionItemService.selectInspectionItem(id,type); |
| | | return Result.success(inspectionItemDto); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ°å¢æé®-->2ãæ£éªé¡¹ç®-->失å»ç¦ç¹å起该请æ±") |
| | | @ApiOperation(value = "æ°å¢æ£éªå-->éæ©è®¾å¤") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "technologyId", value = "å
³èçå·¥èºè·¯çº¿id", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "father", value = "项ç®ç¶åç§°", dataTypeClass = String.class, required = true), |
| | | @ApiImplicitParam(name = "name", value = "项ç®åç§°", dataTypeClass = String.class, required = true) |
| | | }) |
| | | @GetMapping("/chooseDev") |
| | | public Result<?> chooseDev(Integer technologyId, String father, String name) { |
| | | return Result.success(inspectionItemService.chooseDev(technologyId,father,name)); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ°å¢æé®-->2ãæ£éªé¡¹ç®çæ£éªå¼-->失å»ç¦ç¹å起该请æ±") |
| | | @PostMapping("/lose_focus_update") |
| | | public Result<?> addInspectionItem(@RequestHeader("token")String token, @RequestBody UpdateInspectionItemDto updateInspectionItemDto) throws Exception { |
| | | public Result<?> addInspectionItem(@RequestHeader("token") String token, @RequestBody UpdateInspectionItemDto updateInspectionItemDto) throws Exception { |
| | | Map<String, String> usernameMessage = jwt.readJWT(token); |
| | | Map<String, Object> usernameAndId = JackSonUtil.unmarshal(usernameMessage.get("data"), Map.class); |
| | | String name = usernameAndId.get("name").toString().replaceAll("\"", ""); |
| | |
| | | return Result.success(map); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ°å¢æé®-->2ãæ£éªé¡¹ç®-->è¯éªè®¾å¤ä¸ææ¡") |
| | | @GetMapping("/list_device") |
| | | public Result<?> selectDeviceIdAndName(){ |
| | | List<Map<String, Object>> maps = inspectionItemService.selectDeviceIdAndName(); |
| | | return Result.success(maps); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.mom.pojo.ProcessInspect; |
| | | import com.yuanchu.mom.pojo.vo.ProcessInspectVo; |
| | | import com.yuanchu.mom.utils.JackSonUtil; |
| | | import com.yuanchu.mom.utils.Jwt; |
| | | import com.yuanchu.mom.vo.Result; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.yuanchu.mom.service.ProcessInspectService; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | |
| | | /** |
| | | * è¿ç¨æ£éª(ProcessInspect)表æ§å¶å± |
| | | * |
| | | * @author zss |
| | | * @since 2023-09-06 13:36:02 |
| | | */ |
| | | @Api(tags = "QMS管ç-->è¿ç¨æ£éª") |
| | | @RestController |
| | | @RequestMapping("/processInspect") |
| | | public class ProcessInspectController { |
| | | |
| | | @Autowired |
| | | private ProcessInspectService processInspectService; |
| | | |
| | | @Resource |
| | | Jwt jwt; |
| | | |
| | | @ApiOperation(value = "æ°å¢è¿ç¨æ£éªå-->æ ¹æ®è®¢åå·éæ©äº§åä¿¡æ¯åå·¥èº") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "orderNumber", value = "订åç¼å·", dataTypeClass = String.class, required = true) |
| | | }) |
| | | @GetMapping("/chooseMater") |
| | | public Result<?> chooseMater(String orderNumber) { |
| | | return Result.success(processInspectService.chooseMater(orderNumber)); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ°å¢è¿ç¨æ£éªå") |
| | | @PostMapping("/addProcess") |
| | | public Result<?> addProcess(@RequestHeader("token") String token,@Validated @RequestBody ProcessInspectVo processInspectVo) throws Exception { |
| | | Map<String, String> data = JackSonUtil.unmarshal(jwt.readJWT(token).get("data"), Map.class); |
| | | return Result.success(processInspectService.addProcess(data.get("id").replaceAll("\"", ""), processInspectVo)); |
| | | } |
| | | |
| | | @ApiOperation(value = "䏿¥(æ´æ°æ£éªç¶æ)") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "æ£éªåid", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @PostMapping("/updateProcessInspectsById") |
| | | public Result updateProcessInspectsById(Integer id) { |
| | | //妿已ç»ä¸æ¥äºä¸è½å䏿¬¡ä¸æ¥ |
| | | ProcessInspect processInspect = processInspectService.getById(id); |
| | | if (ObjectUtils.isNotEmpty(processInspect.getResult())) { |
| | | return Result.fail("å·²ç»ä¸æ¥è¿äº,ä¸è½åæ¬¡ä¸æ¥!"); |
| | | } |
| | | return Result.success(processInspectService.updateProcessInspectsById(id)); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ ¹æ®æ£éªåidæ¥è¯¢è¿ç¨æ£éªå详æ
") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "æ£éªåid", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @GetMapping("/selectProcessInspectsListById") |
| | | public Result selectProcessInspectsListById(Integer id) { |
| | | return Result.success(processInspectService.selectProcessInspectsListById(id)); |
| | | } |
| | | |
| | | @ApiOperation(value = "å页æ¥è¯¢è¿ç¨æ£éªåå表") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "pageSize", value = "页æ°", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "countSize", value = "æ¡æ°/页", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "techfather", value = "å·¥åº", dataTypeClass = String.class), |
| | | @ApiImplicitParam(name = "result", value = "æ£æµç»æ(为空=å
¨é¨)", dataTypeClass = Integer.class), |
| | | @ApiImplicitParam(name = "name", value = "产ååç§°", dataTypeClass = String.class) |
| | | }) |
| | | @PostMapping("/selectProcessInspectsList") |
| | | public Result selectProcessInspectsList(Integer pageSize, Integer countSize, String techfather, Integer result, String name) { |
| | | IPage<Map<String, Object>> page = processInspectService.selectProcessInspectsList(new Page<Object>(pageSize, countSize), techfather, result, name); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("total", page.getTotal()); |
| | | map.put("row", page.getRecords()); |
| | | return Result.success(map); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | import org.json.JSONException; |
| | | import org.json.JSONObject; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | |
| | | @ApiOperation(value = "æ°å¢åæææ£éªå") |
| | | @PostMapping("/addRawInspects") |
| | | public Result addRawInspects(@RequestHeader("token") String token, @RequestBody RawInspectVo rawInspectVo) throws Exception { |
| | | public Result addRawInspects(@RequestHeader("token") String token,@Validated @RequestBody RawInspectVo rawInspectVo) throws Exception { |
| | | Map<String, String> data = JackSonUtil.unmarshal(jwt.readJWT(token).get("data"), Map.class); |
| | | return Result.success(rawInspectService.addRawInspects(data.get("id").replaceAll("\"", ""), rawInspectVo)); |
| | | } |
| | |
| | | return Result.success(rawInspectService.updateRawInspectsById(id)); |
| | | } |
| | | |
| | | @ApiOperation(value = "å é¤") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "åæææ£éªåid", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @PostMapping("/delRawInsById") |
| | | public Result delRawInsById(Integer id) { |
| | | rawInspectService.delRawInsById(id); |
| | | return Result.success("å é¤" + id + "æå!"); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ¹éå é¤") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "ids", value = "åæææ£éªåid", dataTypeClass = String.class, required = true) |
| | | }) |
| | | @PostMapping("/delAllRawIns") |
| | | public Result delAllRawIns(String ids) { |
| | | rawInspectService.delAllRawIns(ids); |
| | | return Result.success("æ¹éå 餿å!"); |
| | | } |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.mom.pojo.FinishedInspect; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yuanchu.mom.pojo.FinishedInspect; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | */ |
| | | public interface FinishedInspectMapper extends BaseMapper<FinishedInspect> { |
| | | |
| | | IPage<Map<String, Object>> selectFinishedInspectPage(Page<Object> page, Integer inspectResult, String inspectDate, String inspectUsername); |
| | | //å页æ¥è¯¢æåæ£éª |
| | | IPage<Map<String, Object>> selectFinishedInspectPage(Page<Object> page, Integer result, String material); |
| | | |
| | | //è®¡ç®æåæè
è¿ç¨æ£éªå¨æä¸ä¸ªæ¶é´æ®µçåæ ¼æ° |
| | | Integer selCountFin(String begin, String end, int type,int result); |
| | | |
| | | //è®¡ç®æäº§é |
| | | Long seAllCount(String begin, String end, int type); |
| | | |
| | | //æ°å¢è¿ç¨æ£éªå-->æ ¹æ®è®¢åå·éæ©äº§åä¿¡æ¯ |
| | | //æ°å¢æ£éªå-->æ ¹æ®è®¢åå·éæ©äº§åä¿¡æ¯ |
| | | List<Map<String, Object>> chooseMater(String orderNumber); |
| | | |
| | | //æ ¹æ®æ£éªåidæ¥è¯¢æåæ£éªå详æ
|
| | | List<Map<String, Object>> selectFinishInspectsListById(Integer id); |
| | | } |
| | |
| | | //æ¥è¯¢æåæ£éªä¸ä¸åæ ¼åæ£éªåå表 |
| | | IPage<Map<String, Object>> selectInsList(Page<Object> page, String formTime, Integer dealState); |
| | | |
| | | //æ ¹æ®åæææ£éªåidå é¤åææä¸åæ ¼å |
| | | void updaRawIns(Integer id); |
| | | |
| | | //æ ¹æ®åæææ£éªåidæ¹éå é¤åææä¸åæ ¼å |
| | | void delAllRawIns(String ids); |
| | | |
| | | IPage<Map<String, Object>> selectUnqualifiedRawMaterials(Page<Object> page, String formTime, String productName, String supplier, Integer processingStatus); |
| | | |
| | |
| | | package com.yuanchu.mom.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yuanchu.mom.mybatis_config.MyBaseMapper; |
| | | import com.yuanchu.mom.pojo.InspectionItem; |
| | | import com.yuanchu.mom.pojo.dto.InspectionItemDto; |
| | |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2023-08-01 |
| | | */ |
| | | public interface InspectionItemMapper extends MyBaseMapper<InspectionItem> { |
| | | public interface InspectionItemMapper extends BaseMapper<InspectionItem> { |
| | | |
| | | List<InspectionItemDto> selectInspectionItem(Integer finishInspectId); |
| | | |
| | | //è·åè¯¥ç±»åæ£éªåidä¸çæ£éªé¡¹ç®ç»æé |
| | | List<Integer> getResult(Integer id, int type); |
| | | |
| | | List<InspectionItemDto> selectInspectionItem(Integer finishInspectId, Integer type); |
| | | |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.mom.pojo.ProcessInspect; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * è¿ç¨æ£éª(ProcessInspect)è¡¨æ°æ®åºè®¿é®å± |
| | | * |
| | | * @author zss |
| | | * @since 2023-09-06 13:36:02 |
| | | */ |
| | | public interface ProcessInspectMapper extends BaseMapper<ProcessInspect> { |
| | | |
| | | //æ°å¢è¿ç¨æ£éªå-->æ ¹æ®è®¢åå·éæ©äº§åä¿¡æ¯åå·¥èº |
| | | List<Map<String, Object>> chooseMater(String orderNumber); |
| | | |
| | | //æ ¹æ®æ£éªåidæ¥è¯¢è¿ç¨æ£éªå详æ
|
| | | List<Map<String, Object>> selectProcessInspectsListById(Integer id); |
| | | |
| | | //å页æ¥è¯¢è¿ç¨æ£éªåå表 |
| | | IPage<Map<String, Object>> selectProcessInspectsList(Page<Object> page, String techfather, Integer result, String name); |
| | | } |
| | | |
| | |
| | | //æ ¹æ®åæææ£éªåidæ¥è¯¢æ£éªé¡¹ç® |
| | | List<Integer> getresult(Integer id); |
| | | |
| | | //æ ¹æ®åæææ£éªåidå é¤ |
| | | void updaRawInsById(Integer id); |
| | | |
| | | //æ ¹æ®åæææ£éªåidæ¹éå é¤åæææ£éªé¡¹ç® |
| | | void delAllRawIns(String ids); |
| | | } |
| | | |
| | |
| | | //æ ¹æ®åæææ£éªåidæ¥ç详æ
|
| | | List<Map<String, Object>> selectRawInspectsListById(Integer id); |
| | | |
| | | //æ ¹æ®åæææ£éªåidæ¹éå é¤ |
| | | void delAllRawIns(String ids); |
| | | } |
| | | |
| | | |
| | |
| | | package com.yuanchu.mom.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.NoArgsConstructor; |
| | | import lombok.experimental.Accessors; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | import java.util.Date; |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * <p> |
| | | * æåæ£éª(FinishedInspect)表å®ä½ç±» |
| | | * |
| | | * </p> |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2023-08-01 |
| | | * @author zss |
| | | * @since 2023-09-06 13:33:56 |
| | | */ |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @ApiModel(value="FinishedInspect对象", description="") |
| | | @TableName("finished_inspect") |
| | | public class FinishedInspect implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "主é®", hidden = true) |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | /** |
| | | * ä¸»é® |
| | | **/ |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | |
| | | @ApiModelProperty(value = "订åå·", required = true, example = "DDH202308010001") |
| | | /** |
| | | * 订åå· |
| | | **/ |
| | | private String orderNumber; |
| | | |
| | | |
| | | @ApiModelProperty(value = "客æ·åç§°", required = true, example = "ææ´æ´") |
| | | /** |
| | | * 客æ·åç§° |
| | | **/ |
| | | private String customerName; |
| | | |
| | | |
| | | @ApiModelProperty(value = "å·¥ç¨åç§°", required = true, example = "æ¶²ä½ç¡
æ©¡è¶") |
| | | /** |
| | | * å·¥ç¨åç§° |
| | | **/ |
| | | private String projectName; |
| | | |
| | | |
| | | @ApiModelProperty(value = "è´¨é追溯å·", required = true, example = "ZLZSH202308010001") |
| | | /** |
| | | * è´¨éè¿½æº¯å· |
| | | **/ |
| | | private String qualityTraceability; |
| | | |
| | | @ApiModelProperty(value = "0:æå;1ï¼è¿ç¨;", hidden = true) |
| | | private Integer type; |
| | | |
| | | |
| | | @ApiModelProperty(value = "åä½", required = true, example = "å¨") |
| | | /** |
| | | * åä½ |
| | | **/ |
| | | private String unit; |
| | | |
| | | |
| | | @ApiModelProperty(value = "æ°é", required = true, example = "50") |
| | | /** |
| | | * æ°é |
| | | **/ |
| | | private Integer quantity; |
| | | |
| | | |
| | | @ApiModelProperty(value = "è§æ ¼åå·æ¼æ¥å符", required = true, example = "8.7/15kV JLS-3.2") |
| | | /** |
| | | * è§æ ¼åå· |
| | | **/ |
| | | private String specificationsModel; |
| | | |
| | | |
| | | @ApiModelProperty(value = "产åç¼ç ", required = true, example = "GX20230807") |
| | | private String materialCode; |
| | | |
| | | |
| | | @ApiModelProperty(value = "产ååç§°", required = true, example = "å
纤") |
| | | /** |
| | | * ç©æåç§° |
| | | **/ |
| | | private String material; |
| | | |
| | | /** |
| | | * ç©æç¼ç |
| | | **/ |
| | | private String materialCode; |
| | | |
| | | @ApiModelProperty(value = "æ¥æ£äºº:ç¨æ·id", required = true, example = "1") |
| | | /** |
| | | * æ¥æ£äºº:ç¨æ·id |
| | | **/ |
| | | private Integer userId; |
| | | |
| | | @ApiModelProperty(value = "æ£éªç»è®º", hidden = true, required = true, example = "DDH202308010001") |
| | | /** |
| | | * æ£éªç»è®º;0:ä¸åæ ¼;1:åæ ¼ |
| | | **/ |
| | | private Integer result; |
| | | |
| | | @ApiModelProperty(value = "é»è¾å é¤ æ£å¸¸>=1,å é¤<=0", hidden = true) |
| | | private Integer state; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @ApiModelProperty(value = "å建æ¶é´", hidden = true) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date createTime; |
| | | |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @ApiModelProperty(value = "æ´æ°æ¶é´", hidden = true) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date updateTime; |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | package com.yuanchu.mom.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | import com.baomidou.mybatisplus.extension.activerecord.Model; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.NoArgsConstructor; |
| | | import lombok.experimental.Accessors; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.util.Date; |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * <p> |
| | | * æå/è¿ç¨æ£éªé¡¹ç®(InspectionItem)表å®ä½ç±» |
| | | * |
| | | * </p> |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2023-08-01 |
| | | * @author zss |
| | | * @since 2023-09-06 13:34:17 |
| | | */ |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @ApiModel(value="InspectionItem对象", description="") |
| | | public class InspectionItem extends Model<InspectionItem> implements Serializable { |
| | | |
| | | @TableName("inspection_item") |
| | | public class InspectionItem implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "主é®") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | /** |
| | | * ä¸»é® |
| | | **/ |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "项ç®åç§°") |
| | | /** |
| | | * 项ç®åç§° |
| | | **/ |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "ç¶åç§°") |
| | | /** |
| | | * ç¶åç§° |
| | | **/ |
| | | private String father; |
| | | |
| | | @ApiModelProperty(value = "åä½") |
| | | /** |
| | | * åä½ |
| | | **/ |
| | | private String unit; |
| | | |
| | | @ApiModelProperty(value = "æ åå¼") |
| | | /** |
| | | * æ åå¼ |
| | | **/ |
| | | private String required; |
| | | |
| | | @ApiModelProperty(value = "å
æ§å¼") |
| | | /** |
| | | * å
æ§å¼ |
| | | **/ |
| | | private String internal; |
| | | |
| | | @ApiModelProperty(value = "æåæ£éªåId") |
| | | private Integer finishInspectId; |
| | | |
| | | @ApiModelProperty(value = "æ£éªå¼") |
| | | /** |
| | | * æ£éªå¼ |
| | | **/ |
| | | private String inspectionValue; |
| | | |
| | | @ApiModelProperty(value = "è¯éªè®¾å¤") |
| | | /** |
| | | * è¯éªè®¾å¤Id å
³è |
| | | **/ |
| | | private Integer deviceId; |
| | | |
| | | @ApiModelProperty(value = "ç»è®º") |
| | | /** |
| | | * ç»è®º |
| | | **/ |
| | | private Integer result; |
| | | |
| | | @ApiModelProperty(value = "æ£éªäºº") |
| | | /** |
| | | * æ£éªåId |
| | | **/ |
| | | private Integer inspectId; |
| | | |
| | | /** |
| | | * æ£éªäºº |
| | | **/ |
| | | private String username; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | /** |
| | | * ç±»å 1:è¿ç¨;2:æå |
| | | **/ |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty(value = "é»è¾å é¤ æ£å¸¸>=1,å é¤<=0", hidden = true) |
| | | @TableLogic(value = "1", delval = "0") |
| | | private Integer state; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @ApiModelProperty(value = "å建æ¶é´", hidden = true) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date createTime; |
| | | |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @ApiModelProperty(value = "æ´æ°æ¶é´", hidden = true) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date updateTime; |
| | | |
| | | |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.NoArgsConstructor; |
| | | import lombok.experimental.Accessors; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.util.Date; |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * è¿ç¨æ£éª(ProcessInspect)表å®ä½ç±» |
| | | * |
| | | * @author zss |
| | | * @since 2023-09-06 13:36:03 |
| | | */ |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("process_inspect") |
| | | public class ProcessInspect implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * ä¸»é® |
| | | **/ |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | /** |
| | | * 订åå· |
| | | **/ |
| | | private String orderNumber; |
| | | |
| | | /** |
| | | * 产ååç§° |
| | | **/ |
| | | private String material; |
| | | |
| | | /** |
| | | * 产åç¼ç |
| | | **/ |
| | | private String materialCode; |
| | | |
| | | /** |
| | | * åä½ |
| | | **/ |
| | | private String unit; |
| | | |
| | | /** |
| | | * æ°é |
| | | **/ |
| | | private Integer quantity; |
| | | |
| | | /** |
| | | * è§æ ¼åå· |
| | | **/ |
| | | private String specificationsModel; |
| | | |
| | | /** |
| | | * å·¥åº |
| | | **/ |
| | | private String techfather; |
| | | |
| | | /** |
| | | * å·¥èº |
| | | **/ |
| | | private String techname; |
| | | |
| | | /** |
| | | * æ¥æ£äºº:ç¨æ·id |
| | | **/ |
| | | private Integer userId; |
| | | |
| | | /** |
| | | * æ£éªç»è®º;0:ä¸åæ ¼;1:åæ ¼ |
| | | **/ |
| | | private Integer result; |
| | | |
| | | @ApiModelProperty(value = "é»è¾å é¤ æ£å¸¸>=1,å é¤<=0", hidden = true) |
| | | private Integer state; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date createTime; |
| | | |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date updateTime; |
| | | } |
| | | |
| | |
| | | public class UpdateInspectionItemDto { |
| | | |
| | | @ApiModelProperty(value = "æ£éªå¼Idï¼æ ¹æ®è¿ä¸ªIDä¿®æ¹", required = true, example = "5079") |
| | | String inspectionItemId; |
| | | |
| | | @ApiModelProperty(value = "æ åå¼", required = true, example = ">=1") |
| | | private String required; |
| | | |
| | | @ApiModelProperty(value = "å
æ§å¼", required = true, example = ">2") |
| | | private String internal; |
| | | Integer inspectionItemId; |
| | | |
| | | @ApiModelProperty(value = "æ£éªå¼", required = true, example = "3") |
| | | String inspectionValue; |
| | | |
| | | @ApiModelProperty(value = "è¯éªè®¾å¤", required = true, example = "1") |
| | | String deviceId; |
| | | Integer deviceId; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.pojo.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | @Data |
| | | //æ°å¢æåæ£éªåæ° |
| | | public class FinishedInspectVo { |
| | | @NotBlank(message = "订åå·ä¸è½ä¸ºç©º!") |
| | | private String orderNumber; |
| | | |
| | | @NotBlank(message = "客æ·åç§°ä¸è½ä¸ºç©º!") |
| | | private String prname; |
| | | |
| | | @NotBlank(message = "å·¥ç¨åç§°ä¸è½ä¸ºç©º!") |
| | | private String sname; |
| | | |
| | | @NotBlank(message = "è´¨é追溯å·ä¸è½ä¸ºç©º!") |
| | | private String qualityTraceability; |
| | | |
| | | @NotBlank(message = "åä½ä¸è½ä¸ºç©º!") |
| | | private String unit; |
| | | |
| | | @NotNull(message = "æ°éä¸è½ä¸ºç©º!") |
| | | private Integer quantity; |
| | | |
| | | @NotBlank(message = "è§æ ¼åå·ä¸è½ä¸ºç©º!") |
| | | private String specificationsModel; |
| | | |
| | | @NotBlank(message = "产ååç§°ä¸è½ä¸ºç©º!") |
| | | private String material; |
| | | |
| | | @NotBlank(message = "产åç¼ç ä¸è½ä¸ºç©º!") |
| | | private String mcode; |
| | | |
| | | @NotNull(message = "ç产订åidä¸è½ä¸ºç©º!") |
| | | private Integer id; |
| | | |
| | | } |
| ÎļþÃû´Ó inspect-server/src/main/java/com/yuanchu/mom/pojo/vo/FinishedInspectVo1.java ÐÞ¸Ä |
| | |
| | | |
| | | @Data |
| | | //æ°å¢è¿ç¨æ£éªåæ° |
| | | public class FinishedInspectVo1 { |
| | | public class ProcessInspectVo { |
| | | |
| | | @NotBlank(message = "订åå·ä¸è½ä¸ºç©º!") |
| | | private String orderNumber; |
| | |
| | | @NotBlank(message = "å·¥èºä¸è½ä¸ºç©º!") |
| | | private String techname; |
| | | |
| | | @NotNull(message = "æ°éä¸è½ä¸ºç©º!") |
| | | private Integer quantity; |
| | | |
| | | @NotNull(message = "å
³èçå·¥èºè·¯çº¿idä¸è½ä¸ºç©º!") |
| | | private Integer technologyId; |
| | | |
| | | //æ£éªå¼ |
| | | private String inspectionValue; |
| | | |
| | | //设å¤id |
| | | private Integer deviceId; |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.mom.pojo.FinishedInspect; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yuanchu.mom.pojo.vo.FinishedInspectVo1; |
| | | import com.yuanchu.mom.pojo.FinishedInspect; |
| | | import com.yuanchu.mom.pojo.vo.FinishedInspectVo; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | |
| | | */ |
| | | public interface FinishedInspectService extends IService<FinishedInspect> { |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | Integer addProcessInspectionSheet(FinishedInspect finishedInspect); |
| | | |
| | | Integer inspectionConclusion(String username, Integer finishedInspectId, Integer result); |
| | | |
| | | IPage<Map<String, Object>> selectFinishedInspectPage(Page<Object> page, Integer inspectResult, String inspectDate, String inspectUsername); |
| | | |
| | | /** |
| | | * æ°å¢è¿ç¨æ£éªå-->æ ¹æ®è®¢åå·éæ©äº§åä¿¡æ¯ |
| | | * æ°å¢æ£éªå-->æ ¹æ®è®¢åå·éæ©äº§åä¿¡æ¯ |
| | | * |
| | | * @param orderNumber |
| | | * @return |
| | |
| | | List<Map<String, Object>> chooseMater(String orderNumber); |
| | | |
| | | /** |
| | | * æ°å¢è¿ç¨æ£éªå |
| | | * æ°å¢æåæ£éªå |
| | | * |
| | | * @param finishedInspectVo1 |
| | | * @param finishedInspectVo |
| | | * @return |
| | | */ |
| | | String addProcess(String userId, FinishedInspectVo1 finishedInspectVo1); |
| | | Integer addProcessInspectionSheet(String userId, FinishedInspectVo finishedInspectVo); |
| | | |
| | | |
| | | /** |
| | | * æ°å¢è¿ç¨æ£éªå-->éæ©è®¾å¤ |
| | | * @param mtid |
| | | * @param father |
| | | * @param name |
| | | * 䏿¥(æ´æ°æ£éªç¶æ) |
| | | * @param id |
| | | * @return |
| | | */ |
| | | List<Map<String,Object>> chooseDev(Integer technologyId, String father, String name); |
| | | String updateFinishInspectsById(String username,Integer id); |
| | | |
| | | /** |
| | | * å页æ¥è¯¢æåæ£éªåå表 |
| | | * @param page |
| | | * @param result |
| | | * @param material |
| | | * @return |
| | | */ |
| | | IPage<Map<String, Object>> selectFinishedInspectPage(Page<Object> page, Integer result, String material); |
| | | |
| | | /** |
| | | * æ ¹æ®æ£éªåidæ¥è¯¢æåæ£éªå详æ
|
| | | * @param id |
| | | * @return |
| | | */ |
| | | List<Map<String,Object>> selectFinishInspectsListById(Integer id); |
| | | } |
| | |
| | | package com.yuanchu.mom.service; |
| | | |
| | | import com.yuanchu.mom.pojo.InspectionItem; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yuanchu.mom.pojo.InspectionItem; |
| | | import com.yuanchu.mom.pojo.dto.InspectionItemDto; |
| | | import com.yuanchu.mom.pojo.dto.UpdateInspectionItemDto; |
| | | |
| | |
| | | */ |
| | | public interface InspectionItemService extends IService<InspectionItem> { |
| | | |
| | | void insertList(Integer finishInspectId, List<Map<String, Object>> list); |
| | | |
| | | List<InspectionItemDto> selectInspectionItem(Integer finishInspectId); |
| | | /** |
| | | * æ°å¢æé®-->2ãæ¥è¯¢æææ£éªé¡¹ç® |
| | | * @param finishInspectId |
| | | * @return |
| | | */ |
| | | List<InspectionItemDto> selectInspectionItem(Integer finishInspectId, Integer type); |
| | | |
| | | /** |
| | | * æ°å¢æé®-->2ãæ£éªé¡¹ç®-->失å»ç¦ç¹åèµ·è¯¥è¯·æ± |
| | | * @param username |
| | | * @param updateInspectionItemDto |
| | | * @return |
| | | */ |
| | | Integer addProcessInspectionSheet(String username, UpdateInspectionItemDto updateInspectionItemDto); |
| | | |
| | | List<Map<String, Object>> selectDeviceIdAndName(); |
| | | /** |
| | | * æ°å¢æé®-->éæ©è®¾å¤ |
| | | * @param technologyId |
| | | * @param father |
| | | * @param name |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> chooseDev(Integer technologyId, String father, String name); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yuanchu.mom.pojo.ProcessInspect; |
| | | import com.yuanchu.mom.pojo.vo.ProcessInspectVo; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * è¿ç¨æ£éª(ProcessInspect)表æå¡æ¥å£ |
| | | * |
| | | * @author zss |
| | | * @since 2023-09-06 13:36:03 |
| | | */ |
| | | public interface ProcessInspectService extends IService<ProcessInspect> { |
| | | |
| | | /** |
| | | * æ°å¢è¿ç¨æ£éªå-->æ ¹æ®è®¢åå·éæ©äº§åä¿¡æ¯åå·¥èº |
| | | * @param orderNumber |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> chooseMater(String orderNumber); |
| | | |
| | | /** |
| | | * æ°å¢è¿ç¨æ£éªå |
| | | * @param id |
| | | * @param processInspectVo |
| | | * @return |
| | | */ |
| | | Integer addProcess(String id, ProcessInspectVo processInspectVo); |
| | | |
| | | /** |
| | | * 䏿¥(æ´æ°æ£éªç¶æ) |
| | | * @param id |
| | | * @return |
| | | */ |
| | | String updateProcessInspectsById(Integer id); |
| | | |
| | | /** |
| | | * æ ¹æ®æ£éªåidæ¥è¯¢è¿ç¨æ£éªå详æ
|
| | | * @param id |
| | | * @return |
| | | */ |
| | | List<Map<String,Object>> selectProcessInspectsListById(Integer id); |
| | | |
| | | /** |
| | | * å页æ¥è¯¢è¿ç¨æ£éªåå表 |
| | | * @param page |
| | | * @param techfather |
| | | * @param result |
| | | * @param name |
| | | * @return |
| | | */ |
| | | IPage<Map<String, Object>> selectProcessInspectsList(Page<Object> page, String techfather, Integer result, String name); |
| | | } |
| | | |
| | |
| | | */ |
| | | String updateRawInspectsById(Integer id); |
| | | |
| | | /** |
| | | * æ ¹æ®åæææ£éªåidå é¤ |
| | | * @param id |
| | | */ |
| | | void delRawInsById(Integer id); |
| | | |
| | | /** |
| | | * æ¹éå é¤ |
| | | * @param ids |
| | | */ |
| | | void delAllRawIns(String ids); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.mom.mapper.*; |
| | | import com.yuanchu.mom.pojo.*; |
| | | import com.yuanchu.mom.pojo.vo.FinishedInspectVo1; |
| | | import com.yuanchu.mom.pojo.vo.FinishedInspectVo; |
| | | import com.yuanchu.mom.service.*; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | |
| | | public class FinishedInspectServiceImpl extends ServiceImpl<FinishedInspectMapper, FinishedInspect> implements FinishedInspectService { |
| | | |
| | | @Resource |
| | | private FinishedInspectMapper finishedInspectMapper; |
| | | FinishedInspectMapper finishedInspectMapper; |
| | | |
| | | @Resource |
| | | MaterialMapper materialMapper; |
| | |
| | | SpecificationsService specificationsService; |
| | | |
| | | @Resource |
| | | InspectionItemService inspectionItemService; |
| | | |
| | | @Autowired |
| | | private ProductService productService; |
| | | ManualTechnologyMapper manualTechnologyMapper; |
| | | |
| | | @Resource |
| | | UserMapper userMapper; |
| | | ProductService productService; |
| | | |
| | | @Resource |
| | | InspectionItemService inspectionItemService; |
| | | |
| | | @Resource |
| | | InspectionItemMapper inspectionItemMapper; |
| | | |
| | | @Resource |
| | | InspectUnacceptedMapper inspectUnacceptedMapper; |
| | |
| | | @Resource |
| | | RepertoryMapper repertoryMapper; |
| | | |
| | | @Resource |
| | | ImportRepertoryMapper importRepertoryMapper; |
| | | |
| | | @Resource |
| | | TechnologyMapper technologyMapper; |
| | | |
| | | @Resource |
| | | TechniqueMapper techniqueMapper; |
| | | |
| | | @Override |
| | | public Integer addProcessInspectionSheet(FinishedInspect finishedInspect) { |
| | | finishedInspect.setType(0); |
| | | int insert = finishedInspectMapper.insert(finishedInspect); |
| | | if (insert == 1) { |
| | | /*List<Map<String, Object>> maps = productService.selectProductList(finishedInspect.getSpecificationsId()); |
| | | inspectionItemService.insertList(finishedInspect.getId(), maps);*/ |
| | | return insert; |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Integer inspectionConclusion(String username, Integer finishedInspectId, Integer result) { |
| | | //æ´æ°æ£éªåéé¢çæ£éªç»è®º |
| | | LambdaUpdateWrapper<FinishedInspect> updateWrapper = new LambdaUpdateWrapper<>(); |
| | | updateWrapper.eq(FinishedInspect::getId, finishedInspectId); |
| | | updateWrapper.set(FinishedInspect::getResult, result); |
| | | finishedInspectMapper.update(new FinishedInspect(), updateWrapper); |
| | | FinishedInspect finishedInspect = finishedInspectMapper.selectById(finishedInspectId); |
| | | /*æ£éªç»è®ºä¸ºä¸åæ ¼*/ |
| | | if (result == 0) { |
| | | //å¦ææ¯æåçç»è®ºä¸ºä¸åæ ¼,éè¦æ°å¢æåä¸åæ ¼æ£éªå |
| | | if (finishedInspect.getType() == 0) { |
| | | /*æ°å¢æåä¸åæ ¼æ£éªå*/ |
| | | InspectUnaccepted inspectUnaccepted = InspectUnaccepted.builder() |
| | | .reason(finishedInspect.getProjectName() + "ä¸åæ ¼") //æä¸å®ä¹ä¸ºå·¥ç¨åç§°ä¸åæ ¼ |
| | | .rawInspectId(finishedInspectId) |
| | | .build(); |
| | | inspectUnacceptedMapper.insert(inspectUnaccepted); |
| | | } |
| | | //妿æ¯è¿ç¨æ£éªçç»è®ºä¸ºä¸åæ ¼,éè¦æ°å¢åæååºå䏿£éªç»æä¸ºä¸åæ ¼ |
| | | if (finishedInspect.getType() == 1) { |
| | | /*æ°å¢åæå(1)åºå*/ |
| | | //妿å
¥åºçä¿¡æ¯ä¸æ ·åªæåºåä¸ä¸æ ·,åå¨åæ¥çåºåæ°éä¸å ä¸ç¸åºçæ°é |
| | | LambdaQueryWrapper<Repertory> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(Repertory::getOrderCode, finishedInspect.getOrderNumber()) |
| | | .eq(Repertory::getQualityTraceability, finishedInspect.getQualityTraceability()) |
| | | .eq(Repertory::getName, finishedInspect.getMaterial()) |
| | | .eq(Repertory::getSpecifications, finishedInspect.getSpecificationsModel()) |
| | | .eq(Repertory::getUnit, finishedInspect.getUnit()) |
| | | .eq(Repertory::getType, 1) |
| | | .eq(Repertory::getCheckResult, 0); |
| | | Repertory rep = repertoryMapper.selectOne(queryWrapper); |
| | | if (rep != null) { |
| | | rep.setNumber(rep.getNumber() + finishedInspect.getQuantity()); |
| | | rep.setUserName(username); |
| | | repertoryMapper.updateById(rep); |
| | | } else { |
| | | //妿é¤äºåºåå«çä¿¡æ¯æä»»ä½ä¸ä¸ªä¸ä¸æ ·,åæ°å¢ä¸æ¡åæååºå |
| | | Repertory repertory = Repertory.builder() |
| | | .orderCode(finishedInspect.getOrderNumber()) |
| | | .qualityTraceability(finishedInspect.getQualityTraceability()) |
| | | .name(finishedInspect.getMaterial()) |
| | | .specifications(finishedInspect.getSpecificationsModel()) |
| | | .unit(finishedInspect.getUnit()) |
| | | .number(finishedInspect.getQuantity()) |
| | | .userName(username) |
| | | .type(1) |
| | | .checkResult(0)//æ£éªç»æä¸ºä¸åæ ¼ |
| | | .build(); |
| | | repertoryMapper.insert(repertory); |
| | | } |
| | | } |
| | | } |
| | | /*æ£éªç»è®ºä¸ºåæ ¼*/ |
| | | if (result == 1) { |
| | | //å¦ææ¯æåæ£éªåæ ¼,,éè¦æ°å¢æå(0)åºååå
¥åºè®°å½ |
| | | if (finishedInspect.getType() == 0) { |
| | | /*æ°å¢æåå
¥åºè®°å½*/ |
| | | ImportRepertory importRepertory = ImportRepertory.builder() |
| | | .orderCode(finishedInspect.getOrderNumber()) |
| | | .qualityTraceability(finishedInspect.getQualityTraceability()) |
| | | .name(finishedInspect.getMaterial()) |
| | | .specifications(finishedInspect.getSpecificationsModel()) |
| | | .unit(finishedInspect.getUnit()) |
| | | .number(finishedInspect.getQuantity()) |
| | | .userName(username) |
| | | .build(); |
| | | importRepertoryMapper.insert(importRepertory); |
| | | /*æ°å¢æå(0)åºå*/ |
| | | //妿å
¥åºçä¿¡æ¯ä¸æ ·åªæåºåä¸ä¸æ ·,åå¨åæ¥çåºåæ°éä¸å ä¸ç¸åºçæ°é |
| | | LambdaQueryWrapper<Repertory> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(Repertory::getOrderCode, finishedInspect.getOrderNumber()) |
| | | .eq(Repertory::getQualityTraceability, finishedInspect.getQualityTraceability()) |
| | | .eq(Repertory::getName, finishedInspect.getMaterial()) |
| | | .eq(Repertory::getSpecifications, finishedInspect.getSpecificationsModel()) |
| | | .eq(Repertory::getUnit, finishedInspect.getUnit()) |
| | | .eq(Repertory::getType, 0) |
| | | .eq(Repertory::getCheckResult, 1); |
| | | Repertory rep = repertoryMapper.selectOne(queryWrapper); |
| | | if (rep != null) { |
| | | rep.setNumber(rep.getNumber() + finishedInspect.getQuantity()); |
| | | rep.setUserName(username); |
| | | repertoryMapper.updateById(rep); |
| | | } else { |
| | | //妿é¤äºåºåå«çä¿¡æ¯æä»»ä½ä¸ä¸ªä¸ä¸æ ·,åæ°å¢ä¸æ¡æååºå |
| | | Repertory repertory = Repertory.builder() |
| | | .orderCode(finishedInspect.getOrderNumber()) |
| | | .qualityTraceability(finishedInspect.getQualityTraceability()) |
| | | .name(finishedInspect.getMaterial()) |
| | | .specifications(finishedInspect.getSpecificationsModel()) |
| | | .unit(finishedInspect.getUnit()) |
| | | .number(finishedInspect.getQuantity()) |
| | | .userName(username) |
| | | .type(0) |
| | | .checkResult(1) //åºåæ£éªç»æä¸ºåæ ¼ |
| | | .build(); |
| | | repertoryMapper.insert(repertory); |
| | | } |
| | | } |
| | | //妿æ¯è¿ç¨æ£éªåæ ¼,éè¦æ°å¢åæå(1)åºå,æ£éªç»æä¸ºåæ ¼1 |
| | | if (finishedInspect.getType() == 1) { |
| | | /*æ°å¢åæå(1)åºå*/ |
| | | //妿å
¥åºçä¿¡æ¯ä¸æ ·åªæåºåä¸ä¸æ ·,åå¨åæ¥çåºåæ°éä¸å ä¸ç¸åºçæ°é |
| | | LambdaQueryWrapper<Repertory> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(Repertory::getOrderCode, finishedInspect.getOrderNumber()) |
| | | .eq(Repertory::getQualityTraceability, finishedInspect.getQualityTraceability()) |
| | | .eq(Repertory::getName, finishedInspect.getMaterial()) |
| | | .eq(Repertory::getSpecifications, finishedInspect.getSpecificationsModel()) |
| | | .eq(Repertory::getUnit, finishedInspect.getUnit()) |
| | | .eq(Repertory::getType, 1) |
| | | .eq(Repertory::getCheckResult, 1); |
| | | Repertory rep = repertoryMapper.selectOne(queryWrapper); |
| | | if (rep != null) { |
| | | rep.setNumber(rep.getNumber() + finishedInspect.getQuantity()); |
| | | rep.setUserName(username); |
| | | repertoryMapper.updateById(rep); |
| | | } else { |
| | | //妿é¤äºåºåå«çä¿¡æ¯æä»»ä½ä¸ä¸ªä¸ä¸æ ·,åæ°å¢ä¸æ¡åæååºå |
| | | Repertory repertory = Repertory.builder() |
| | | .orderCode(finishedInspect.getOrderNumber()) |
| | | .qualityTraceability(finishedInspect.getQualityTraceability()) |
| | | .name(finishedInspect.getMaterial()) |
| | | .specifications(finishedInspect.getSpecificationsModel()) |
| | | .unit(finishedInspect.getUnit()) |
| | | .number(finishedInspect.getQuantity()) |
| | | .userName(username) |
| | | .type(1) |
| | | .checkResult(1)//æ£éªç»æä¸ºåæ ¼ |
| | | .build(); |
| | | repertoryMapper.insert(repertory); |
| | | } |
| | | } |
| | | |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | @Override |
| | | public IPage<Map<String, Object>> selectFinishedInspectPage(Page<Object> page, Integer inspectResult, String inspectDate, String inspectUsername) { |
| | | return finishedInspectMapper.selectFinishedInspectPage(page, inspectResult, inspectDate, inspectUsername); |
| | | } |
| | | |
| | | //æ°å¢è¿ç¨æ£éªå-->æ ¹æ®è®¢åå·éæ©äº§åä¿¡æ¯ |
| | | //æ°å¢æ£éªå-->æ ¹æ®è®¢åå·éæ©äº§åä¿¡æ¯ |
| | | @Override |
| | | public List<Map<String, Object>> chooseMater(String orderNumber) { |
| | | return finishedInspectMapper.chooseMater(orderNumber); |
| | | } |
| | | |
| | | //æ°å¢è¿ç¨æ£éªå |
| | | //æ°å¢æåæ£éªå |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public String addProcess(String userId, FinishedInspectVo1 finishedInspectVo1) { |
| | | /*æ°å¢è¿ç¨æ£éªå*/ |
| | | public Integer addProcessInspectionSheet(String userId, FinishedInspectVo finishedInspectVo) { |
| | | /*æ°å¢æåæ£éªå*/ |
| | | FinishedInspect finishedInspect = new FinishedInspect(); |
| | | finishedInspect.setType(1); |
| | | finishedInspect.setUserId(Integer.parseInt(userId)); |
| | | BeanUtils.copyProperties(finishedInspectVo1, finishedInspect); |
| | | finishedInspect.setOrderNumber(finishedInspectVo.getOrderNumber()); |
| | | finishedInspect.setCustomerName(finishedInspectVo.getPrname()); |
| | | finishedInspect.setProjectName(finishedInspectVo.getSname()); |
| | | finishedInspect.setQualityTraceability(finishedInspectVo.getQualityTraceability()); |
| | | finishedInspect.setUnit(finishedInspectVo.getUnit()); |
| | | finishedInspect.setQuantity(finishedInspectVo.getQuantity()); |
| | | finishedInspect.setSpecificationsModel(finishedInspectVo.getSpecificationsModel()); |
| | | finishedInspect.setMaterial(finishedInspectVo.getMaterial()); |
| | | finishedInspect.setMaterialCode(finishedInspectVo.getMcode()); |
| | | finishedInspectMapper.insert(finishedInspect); |
| | | /*æ¹éæ°å¢è¿ç¨æ£éªé¡¹ç®è¡¨*/ |
| | | /*æ¹éæ°å¢æåæ£éªé¡¹ç®å*/ |
| | | //è·ååå·id |
| | | Integer specificationId = getSpecificationId(finishedInspectVo1.getMaterial(), finishedInspectVo1.getMaterialCode(), finishedInspectVo1.getSpecificationsModel()); |
| | | Integer specificationId = getSpecificationId(finishedInspectVo.getMaterial(), finishedInspectVo.getMcode(), finishedInspectVo.getSpecificationsModel()); |
| | | //æ ¹æ®ç产订åidæ¥è¯¢ç¼å¶å·¥åºçæåä¸éå·¥èº |
| | | List<ManualTechnology> manualTechnologyList = manualTechnologyMapper.selAllByMoId(finishedInspectVo.getId()); |
| | | //è·åæåä¸éå·¥èºå
³èçå·¥èºè·¯çº¿id |
| | | Integer technologyId = manualTechnologyList.get(0).getTechnologyId(); |
| | | //æ¥è¯¢æ åBOMææ¯ææ ä¸è¯¥åå·å·¥èºä¸ææ°çæ¬çæ£éªé¡¹ç® |
| | | Integer ver = productService.selectVerByPro(specificationId).get(0);//该åå·ä¸ææ¯ææ ææ°çæ¬ |
| | | List<Product> productList = productService.selProByVerSpe(finishedInspectVo1.getTechnologyId(), ver); |
| | | List<Product> productList = productService.selProByVerSpe(technologyId, ver); |
| | | List<InspectionItem> inspectionItemList = productList.stream().map(product -> { |
| | | InspectionItem inspectionItem = new InspectionItem(); |
| | | BeanUtils.copyProperties(product, inspectionItem); |
| | | inspectionItem.setFinishInspectId(finishedInspect.getId()); |
| | | //妿æ°å¢æ¶è¿å¡«åäºæ£éªå¼åè¦è¿è¡å¤ææ£éªç»æ |
| | | if (ObjectUtils.isNotEmpty(finishedInspectVo1.getInspectionValue())) { |
| | | inspectionItem.setInspectionValue(finishedInspectVo1.getInspectionValue()); |
| | | //å¤ææ£æµå¼æ¯å¦æ»¡è¶³æ åå¼åå
æ§å¼çè¦æ±,妿䏿»¡è¶³åæ£éªç»è®ºä¸ºä¸åæ ¼0 |
| | | String required = product.getRequired();//æ åå¼ |
| | | String internal = product.getInternal();//å
æ§å¼ |
| | | String testValue = finishedInspectVo1.getInspectionValue();//æ£æµå¼ |
| | | List<Integer> list = Arrays.stream(testValue.split(",")).map(s -> { |
| | | int values = checkValues(required, internal, s); |
| | | return values; |
| | | }).collect(Collectors.toList()); |
| | | if (list.contains(0)) { |
| | | //妿å
¶ä¸ä¸ä¸ªæ£éªå¼ä¸åæ ¼åè¯¥é¡¹ç®æ£éªä¸åæ ¼ |
| | | inspectionItem.setResult(0); |
| | | } else { |
| | | inspectionItem.setResult(1); |
| | | } |
| | | inspectionItem.setUsername(userMapper.selectById(userId).getName()); |
| | | } |
| | | inspectionItem.setInspectId(finishedInspect.getId()); |
| | | inspectionItem.setType(2);//æå |
| | | return inspectionItem; |
| | | }).collect(Collectors.toList()); |
| | | inspectionItemService.saveBatch(inspectionItemList); |
| | | return "æ°å¢è¿ç¨æ£éªå"+finishedInspect.getId()+"æå!"; |
| | | return finishedInspect.getId(); |
| | | } |
| | | |
| | | //æ°å¢è¿ç¨æ£éªå-->éæ©è®¾å¤ |
| | | //䏿¥(æ´æ°æ£éªç¶æ) |
| | | @Override |
| | | public List<Map<String, Object>> chooseDev(Integer technologyId, String father, String name) { |
| | | //该工èºidä¸çäº§å·¥èºææ°çæ¬ |
| | | Integer ver = techniqueMapper.selectVerByTeId(technologyId).get(0); |
| | | return techniqueMapper.selDevByVerTecIdFaNam(technologyId,father,name,ver); |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public String updateFinishInspectsById(String username,Integer id) { |
| | | /*æ´æ°æ£éªåéé¢çæ£éªç»è®º*/ |
| | | //å
夿æ£éªç»æ |
| | | List<Integer> results = inspectionItemMapper.getResult(id,1); |
| | | int count = 0; |
| | | for (Integer result : results) { |
| | | if (result != null && result == 1) { |
| | | count++; |
| | | } |
| | | } |
| | | FinishedInspect finishedInspect = finishedInspectMapper.selectById(id); |
| | | //妿æ£éªé¡¹ç®ä¸çç»è®ºå
å«ä¸åæ ¼åæ£éªåä¸åæ ¼ |
| | | if (results.contains(0)) { |
| | | finishedInspect.setResult(0);//ä¸åæ ¼ |
| | | //æ´æ°æ£éªå |
| | | finishedInspectMapper.updateById(finishedInspect); |
| | | } else if (count == results.size()) { |
| | | finishedInspect.setResult(1);//åæ ¼ |
| | | finishedInspectMapper.updateById(finishedInspect); |
| | | } else return "é¡¹ç®æªæ£éªå®!"; |
| | | /*妿æ£éªç»è®ºä¸ºä¸åæ ¼,åéè¦æ°å¢ä¸åæ ¼æ£éªå*/ |
| | | if (finishedInspect.getResult() == 0) { |
| | | InspectUnaccepted finishUnaccepted = InspectUnaccepted.builder() |
| | | .reason(finishedInspect.getMaterial() + "ä¸åæ ¼") //æä¸å®ä¹ä¸ºäº§ååç§°ä¸åæ ¼ |
| | | .rawInspectId(id) |
| | | .type(1) //ç±»å为æåæ£éª |
| | | .build(); |
| | | inspectUnacceptedMapper.insert(finishUnaccepted); |
| | | } |
| | | /*妿æ£éªç»è®ºä¸ºåæ ¼,åéè¦æ°å¢åæååºå*/ |
| | | if (finishedInspect.getResult() == 1) { |
| | | //妿å
¥åºçä¿¡æ¯ä¸æ ·åªæåºåä¸ä¸æ ·,åå¨åæ¥çåºåæ°éä¸å ä¸ç¸åºçæ°é |
| | | LambdaQueryWrapper<Repertory> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(Repertory::getOrderCode, finishedInspect.getOrderNumber()) |
| | | .eq(Repertory::getQualityTraceability, finishedInspect.getQualityTraceability()) |
| | | .eq(Repertory::getName, finishedInspect.getMaterial()) |
| | | .eq(Repertory::getSpecifications, finishedInspect.getSpecificationsModel()) |
| | | .eq(Repertory::getUnit, finishedInspect.getUnit()) |
| | | .eq(Repertory::getType, 1); |
| | | Repertory rep = repertoryMapper.selectOne(queryWrapper); |
| | | if (rep != null ) { |
| | | rep.setNumber(rep.getNumber() + finishedInspect.getQuantity()); |
| | | rep.setUserName(username); |
| | | repertoryMapper.updateById(rep); |
| | | } else { |
| | | //妿é¤äºåºåå«çä¿¡æ¯æä»»ä½ä¸ä¸ªä¸ä¸æ ·,åæ°å¢ä¸æ¡æååºå |
| | | Repertory repertory = new Repertory(); |
| | | repertory.setOrderCode(finishedInspect.getOrderNumber()); |
| | | repertory.setQualityTraceability(finishedInspect.getQualityTraceability()); |
| | | repertory.setName(finishedInspect.getMaterial()); |
| | | repertory.setSpecifications(finishedInspect.getSpecificationsModel()); |
| | | repertory.setUnit(finishedInspect.getUnit()); |
| | | repertory.setNumber(finishedInspect.getQuantity()); |
| | | repertory.setUserName(username); |
| | | repertory.setType(1);//åæå |
| | | repertory.setCheckResult(1);//æå®ä¸å |
| | | repertoryMapper.insert(repertory); |
| | | } |
| | | } |
| | | return "䏿¥æå!"; |
| | | } |
| | | |
| | | //å页æ¥è¯¢æåæ£éªåå表 |
| | | @Override |
| | | public IPage<Map<String, Object>> selectFinishedInspectPage(Page<Object> page, Integer result, String material) { |
| | | return finishedInspectMapper.selectFinishedInspectPage(page, result,material); |
| | | } |
| | | |
| | | //æ ¹æ®æ£éªåidæ¥è¯¢æåæ£éªå详æ
|
| | | @Override |
| | | public List<Map<String, Object>> selectFinishInspectsListById(Integer id) { |
| | | return finishedInspectMapper.selectFinishInspectsListById(id); |
| | | } |
| | | |
| | | |
| | |
| | | package com.yuanchu.mom.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.yuanchu.mom.pojo.Device; |
| | | import com.yuanchu.mom.pojo.InspectionItem; |
| | | import com.yuanchu.mom.mapper.InspectionItemMapper; |
| | | import com.yuanchu.mom.mapper.TechniqueMapper; |
| | | import com.yuanchu.mom.pojo.InspectionItem; |
| | | import com.yuanchu.mom.pojo.dto.InspectionItemDto; |
| | | import com.yuanchu.mom.pojo.dto.UpdateInspectionItemDto; |
| | | import com.yuanchu.mom.service.DeviceService; |
| | | import com.yuanchu.mom.service.InspectionItemService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.yuanchu.mom.service.SpecificationsService; |
| | | import com.yuanchu.mom.utils.JackSonUtil; |
| | | import com.yuanchu.mom.utils.MyUtil; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Resource |
| | | private InspectionItemMapper inspectionItemMapper; |
| | | |
| | | @Autowired |
| | | private DeviceService deviceService; |
| | | @Resource |
| | | TechniqueMapper techniqueMapper; |
| | | |
| | | |
| | | |
| | | //æ°å¢æé®-->2ãæ¥è¯¢æææ£éªé¡¹ç® |
| | | @Override |
| | | public void insertList(Integer finishInspectId, List<Map<String, Object>> list) { |
| | | List<InspectionItem> list1 = new ArrayList<>(); |
| | | for (Map<String, Object> map : list){ |
| | | try { |
| | | InspectionItem inspectionItem = JackSonUtil.unmarshal(JackSonUtil.marshal(map), InspectionItem.class); |
| | | inspectionItem.setFinishInspectId(finishInspectId); |
| | | list1.add(inspectionItem); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | inspectionItemMapper.insertBatchSomeColumn(list1); |
| | | public List<InspectionItemDto> selectInspectionItem(Integer finishInspectId, Integer type) { |
| | | return inspectionItemMapper.selectInspectionItem(finishInspectId,type); |
| | | } |
| | | |
| | | |
| | | //æ°å¢è¿ç¨æ£éªå-->éæ©è®¾å¤ |
| | | @Override |
| | | public List<InspectionItemDto> selectInspectionItem(Integer finishInspectId) { |
| | | return inspectionItemMapper.selectInspectionItem(finishInspectId); |
| | | public List<Map<String, Object>> chooseDev(Integer technologyId, String father, String name) { |
| | | //该工èºidä¸çäº§å·¥èºææ°çæ¬ |
| | | Integer ver = techniqueMapper.selectVerByTeId(technologyId).get(0); |
| | | return techniqueMapper.selDevByVerTecIdFaNam(technologyId, father, name, ver); |
| | | } |
| | | |
| | | //æ°å¢æé®-->2ãæ£éªé¡¹ç®-->失å»ç¦ç¹åèµ·è¯¥è¯·æ± |
| | | @Override |
| | | public Integer addProcessInspectionSheet(String username, UpdateInspectionItemDto updateInspectionItemDto) { |
| | | LambdaUpdateWrapper<InspectionItem> wrapper = new LambdaUpdateWrapper<>(); |
| | | wrapper.eq(InspectionItem::getId, updateInspectionItemDto.getInspectionItemId()); |
| | | wrapper.set(InspectionItem::getInspectionValue, updateInspectionItemDto.getInspectionValue()); |
| | | wrapper.set(InspectionItem::getDeviceId, updateInspectionItemDto.getDeviceId()); |
| | | int i = checkValues(updateInspectionItemDto.getRequired(), updateInspectionItemDto.getInternal(), updateInspectionItemDto.getInspectionValue()); |
| | | wrapper.set(InspectionItem::getResult, i); |
| | | wrapper.set(InspectionItem::getUsername, username); |
| | | int update = inspectionItemMapper.update(new InspectionItem(), wrapper); |
| | | if (update > 0){ |
| | | return i; |
| | | //æ¥è¯¢å
æ§å¼åæ åå¼ |
| | | InspectionItem inspectionItem = inspectionItemMapper.selectById(updateInspectionItemDto.getInspectionItemId()); |
| | | inspectionItem.setInspectionValue(updateInspectionItemDto.getInspectionValue()); |
| | | inspectionItem.setDeviceId(updateInspectionItemDto.getDeviceId()); |
| | | List<Integer> list = Arrays.stream( updateInspectionItemDto.getInspectionValue().split(",")).map(s -> { |
| | | int values = checkValues(inspectionItem.getRequired(), inspectionItem.getInternal(), s); |
| | | return values; |
| | | }).collect(Collectors.toList()); |
| | | if (list.contains(0)) { |
| | | //妿å
¶ä¸ä¸ä¸ªæ£éªå¼ä¸åæ ¼åè¯¥é¡¹ç®æ£éªä¸åæ ¼ |
| | | inspectionItem.setResult(0); |
| | | } else { |
| | | inspectionItem.setResult(1); |
| | | } |
| | | return 2; |
| | | inspectionItemMapper.updateById(inspectionItem); |
| | | //è¿åæ£éªé¡¹ç®çç»è®º |
| | | return inspectionItem.getResult(); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> selectDeviceIdAndName() { |
| | | LambdaQueryWrapper<Device> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.select(Device::getId, Device::getName); |
| | | return deviceService.listMaps(wrapper); |
| | | } |
| | | |
| | | /*å¤ææ£æµå¼æ¯å¦æ»¡è¶³æ åå¼åå
æ§å¼çè¦æ±,妿䏿»¡è¶³åæ£éªç»è®ºä¸ºä¸åæ ¼*/ |
| | | private int checkValues(String standardValueStr, String controlValueStr, String detectionValueStr) { |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.yuanchu.mom.mapper.*; |
| | | import com.yuanchu.mom.pojo.*; |
| | | import com.yuanchu.mom.pojo.vo.ProcessInspectVo; |
| | | import com.yuanchu.mom.service.*; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * è¿ç¨æ£éª(ProcessInspect)表æå¡å®ç°ç±» |
| | | * |
| | | * @author zss |
| | | * @since 2023-09-06 13:36:03 |
| | | */ |
| | | @Service |
| | | public class ProcessInspectServiceImpl extends ServiceImpl<ProcessInspectMapper, ProcessInspect> implements ProcessInspectService { |
| | | |
| | | @Resource |
| | | ProcessInspectMapper processInspectMapper; |
| | | |
| | | @Resource |
| | | MaterialMapper materialMapper; |
| | | |
| | | @Resource |
| | | StandardService standardService; |
| | | |
| | | @Resource |
| | | SpecificationsService specificationsService; |
| | | |
| | | @Resource |
| | | ProductService productService; |
| | | |
| | | @Resource |
| | | InspectionItemMapper inspectionItemMapper; |
| | | |
| | | @Resource |
| | | InspectionItemService inspectionItemService; |
| | | |
| | | @Resource |
| | | InspectUnacceptedMapper inspectUnacceptedMapper; |
| | | |
| | | //æ°å¢è¿ç¨æ£éªå-->æ ¹æ®è®¢åå·éæ©äº§åä¿¡æ¯åå·¥èº |
| | | @Override |
| | | public List<Map<String, Object>> chooseMater(String orderNumber) { |
| | | return processInspectMapper.chooseMater(orderNumber); |
| | | } |
| | | |
| | | //æ°å¢è¿ç¨æ£éªå |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Integer addProcess(String userId, ProcessInspectVo processInspectVo) { |
| | | /*æ°å¢è¿ç¨æ£éªå*/ |
| | | ProcessInspect processInspect = new ProcessInspect(); |
| | | processInspect.setUserId(Integer.parseInt(userId)); |
| | | BeanUtils.copyProperties(processInspectVo, processInspect); |
| | | processInspectMapper.insert(processInspect); |
| | | /*æ¹éæ°å¢è¿ç¨æ£éªé¡¹ç®è¡¨*/ |
| | | //è·ååå·id |
| | | Integer specificationId = getSpecificationId(processInspectVo.getMaterial(), processInspectVo.getMaterialCode(), processInspectVo.getSpecificationsModel()); |
| | | //æ¥è¯¢æ åBOMææ¯ææ ä¸è¯¥åå·å·¥èºä¸ææ°çæ¬çæ£éªé¡¹ç® |
| | | Integer ver = productService.selectVerByPro(specificationId).get(0);//该åå·ä¸ææ¯ææ ææ°çæ¬ |
| | | List<Product> productList = productService.selProByVerSpe(processInspectVo.getTechnologyId(), ver); |
| | | List<InspectionItem> inspectionItemList = productList.stream().map(product -> { |
| | | InspectionItem inspectionItem = new InspectionItem(); |
| | | BeanUtils.copyProperties(product, inspectionItem); |
| | | inspectionItem.setInspectId(processInspect.getId()); |
| | | inspectionItem.setType(1); |
| | | return inspectionItem; |
| | | }).collect(Collectors.toList()); |
| | | inspectionItemService.saveBatch(inspectionItemList); |
| | | return processInspect.getId(); |
| | | } |
| | | |
| | | //䏿¥(æ´æ°æ£éªç¶æ) |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public String updateProcessInspectsById(Integer id) { |
| | | /*æ´æ°æ£éªåéé¢çæ£éªç»è®º*/ |
| | | //å
夿æ£éªç»æ |
| | | List<Integer> results = inspectionItemMapper.getResult(id,1); |
| | | int count = 0; |
| | | for (Integer result : results) { |
| | | if (result != null && result == 1) { |
| | | count++; |
| | | } |
| | | } |
| | | ProcessInspect processInspect = processInspectMapper.selectById(id); |
| | | //妿æ£éªé¡¹ç®ä¸çç»è®ºå
å«ä¸åæ ¼åæ£éªåä¸åæ ¼ |
| | | if (results.contains(0)) { |
| | | processInspect.setResult(0);//ä¸åæ ¼ |
| | | //æ´æ°æ£éªå |
| | | processInspectMapper.updateById(processInspect); |
| | | } else if (count == results.size()) { |
| | | processInspect.setResult(1);//åæ ¼ |
| | | processInspectMapper.updateById(processInspect); |
| | | } else return "é¡¹ç®æªæ£éªå®!"; |
| | | /*妿æ£éªç»è®ºä¸ºä¸åæ ¼,åéè¦æ°å¢ä¸åæ ¼æ£éªå*/ |
| | | if (processInspect.getResult() == 0) { |
| | | InspectUnaccepted processUnaccepted = InspectUnaccepted.builder() |
| | | .reason(processInspect.getMaterial() +processInspect.getTechname()+ "ä¸åæ ¼") //æä¸å®ä¹ä¸ºäº§ååç§°+å·¥èºä¸åæ ¼ |
| | | .rawInspectId(id) |
| | | .type(2) //ç±»å为è¿ç¨æ£éª |
| | | .build(); |
| | | inspectUnacceptedMapper.insert(processUnaccepted); |
| | | } |
| | | return "䏿¥æå!"; |
| | | } |
| | | |
| | | //æ ¹æ®æ£éªåidæ¥è¯¢è¿ç¨æ£éªå详æ
|
| | | @Override |
| | | public List<Map<String, Object>> selectProcessInspectsListById(Integer id) { |
| | | return processInspectMapper.selectProcessInspectsListById(id); |
| | | } |
| | | |
| | | //å页æ¥è¯¢è¿ç¨æ£éªåå表 |
| | | @Override |
| | | public IPage<Map<String, Object>> selectProcessInspectsList(Page<Object> page, String techfather, Integer result, String name) { |
| | | return processInspectMapper.selectProcessInspectsList(page,techfather,result,name); |
| | | } |
| | | |
| | | |
| | | /*æ ¹æ®æ ·ååç§°,æ ·åç¼å·,åå·è§æ ¼è·ååå·id*/ |
| | | private Integer getSpecificationId(String name, String mcode, String specification) { |
| | | //è·åç©æid |
| | | Material material = materialMapper.selectOne(Wrappers.<Material>query() |
| | | .eq("name", name) |
| | | .eq("code", mcode)); |
| | | if (Objects.isNull(material)) { |
| | | return null; |
| | | } |
| | | //è·åè§æ ¼åç§°ååå·åç§° |
| | | String[] split = specification.split("-"); |
| | | String stName = split[0]; |
| | | String spName = split[1]; |
| | | //è·åè§æ ¼id |
| | | Standard standard = standardService.getOne(Wrappers.<Standard>query() |
| | | .eq("name", stName) |
| | | .eq("material_id", material.getId())); |
| | | //è·ååå·id |
| | | Specifications specifications = specificationsService.getOne(Wrappers.<Specifications>query() |
| | | .eq("name", spName) |
| | | .eq("standard_id", standard.getId())); |
| | | return specifications.getId(); |
| | | } |
| | | |
| | | /*å¤ææ£æµå¼æ¯å¦æ»¡è¶³æ åå¼åå
æ§å¼çè¦æ±,妿䏿»¡è¶³åæ£éªç»è®ºä¸ºä¸åæ ¼*/ |
| | | private int checkValues(String standardValueStr, String controlValueStr, String detectionValueStr) { |
| | | boolean isStandardValueSatisfied = isValueSatisfied(standardValueStr, detectionValueStr); |
| | | boolean isControlValueSatisfied = isValueSatisfied(controlValueStr, detectionValueStr); |
| | | |
| | | if (isStandardValueSatisfied && isControlValueSatisfied) { |
| | | return 1; |
| | | } else { |
| | | return 0; |
| | | } |
| | | } |
| | | |
| | | private boolean isValueSatisfied(String valueStr, String detectionValueStr) { |
| | | String substring = valueStr.substring(1, 2); |
| | | if (substring.equals("=")) { |
| | | String operator = valueStr.substring(0, 2); |
| | | Double standardValue = Double.parseDouble(valueStr.substring(2)); |
| | | Double detectionValue = Double.parseDouble(detectionValueStr); |
| | | switch (operator) { |
| | | case ">=": |
| | | return detectionValue >= standardValue; |
| | | case "<=": |
| | | return detectionValue <= standardValue; |
| | | default: |
| | | return false; |
| | | } |
| | | } else { |
| | | String operator = valueStr.substring(0, 1); |
| | | Double standardValue = Double.parseDouble(valueStr.substring(1)); |
| | | Double detectionValue = Double.parseDouble(detectionValueStr); |
| | | switch (operator) { |
| | | case ">": |
| | | return detectionValue > standardValue; |
| | | case "â¥": |
| | | return detectionValue >= standardValue; |
| | | case "â¤": |
| | | return detectionValue <= standardValue; |
| | | case "<": |
| | | return detectionValue < standardValue; |
| | | case "=": |
| | | return detectionValue.equals(standardValue); |
| | | default: |
| | | return false; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | return "䏿¥æå!"; |
| | | } |
| | | |
| | | //æ ¹æ®åæææ£éªåidå é¤ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void delRawInsById(Integer id) { |
| | | /*å é¤åæææ£éªå*/ |
| | | RawInspect rawInspect = new RawInspect(); |
| | | rawInspect.setId(id); |
| | | rawInspect.setState(0); |
| | | rawInspectMapper.updateById(rawInspect); |
| | | /*å é¤åæææ£éªé¡¹ç®è¡¨*/ |
| | | rawInsProductMapper.updaRawInsById(id); |
| | | /*å é¤åææä¸åæ ¼å*/ |
| | | inspectUnacceptedMapper.updaRawIns(id); |
| | | } |
| | | |
| | | //æ¹éå é¤ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void delAllRawIns(String ids) { |
| | | /*æ¹éå é¤åæææ£éªå*/ |
| | | rawInspectMapper.delAllRawIns(ids); |
| | | /*æ¹éå é¤åæææ£éªé¡¹ç®è¡¨*/ |
| | | rawInsProductMapper.delAllRawIns(ids); |
| | | /*æ¹éå é¤åææä¸åæ ¼å*/ |
| | | inspectUnacceptedMapper.delAllRawIns(ids); |
| | | |
| | | } |
| | | |
| | | |
| | | /*å¤ææ£æµå¼æ¯å¦æ»¡è¶³æ åå¼åå
æ§å¼çè¦æ±,妿䏿»¡è¶³åæ£éªç»è®ºä¸ºä¸åæ ¼*/ |
| | | private int checkValues(String standardValueStr, String controlValueStr, String detectionValueStr) { |
| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.yuanchu.mom.mapper.FinishedInspectMapper"> |
| | | <select id="selectFinishedInspectPage" resultType="map"> |
| | | SELECT f.`id`, f.`order_number`, f.`customer_name`, f.`project_name`, f.`quality_traceability`, |
| | | f.`material_code`, f.`material`, f.`specifications_model`, f.`unit`, |
| | | f.`quantity`, u.`name`, DATE_FORMAT(f.`create_time`, '%Y-%m-%d') detectionPeriod, f.`result` |
| | | FROM finished_inspect f, `user` u |
| | | SELECT f.`id`, |
| | | f.`order_number`, |
| | | f.`customer_name`, |
| | | f.`project_name`, |
| | | f.`quality_traceability`, |
| | | f.`material_code`, |
| | | f.`material`, |
| | | f.`specifications_model`, |
| | | f.`unit`, |
| | | f.`quantity`, |
| | | u.`name`, |
| | | DATE_FORMAT(f.`create_time`, '%Y-%m-%d') detectionPeriod, |
| | | f.`result` |
| | | FROM mom_ocean.finished_inspect f, mom_ocean.`user` u |
| | | WHERE f.`user_id` = u.`id` |
| | | AND f.`state` = 1 |
| | | <if test="inspectResult != null and inspectResult != ''"> |
| | | AND f.result = #{inspectResult} |
| | | <if test="result != null "> |
| | | AND f.result = #{result} |
| | | </if> |
| | | <if test="inspectDate != null and inspectDate != ''"> |
| | | AND DATE_FORMAT(f.`create_time`, '%Y-%m-%d') = #{inspectDate} |
| | | </if> |
| | | <if test="inspectUsername != null and inspectUsername != ''"> |
| | | AND u.`name` LIKE CONCAT('%',#{inspectUsername},'%') |
| | | <if test="material != null and material != ''"> |
| | | AND f.`material` LIKE CONCAT('%',#{material},'%') |
| | | </if> |
| | | </select> |
| | | <select id="selCountFin" resultType="java.lang.Integer"> |
| | | select count(id) |
| | | from mom_ocean.finished_inspect |
| | | where state=1 |
| | | and result=#{result} |
| | | and type=#{type} |
| | | <if test="begin != null and begin!=''"> |
| | | and finished_inspect.create_time >= #{begin} |
| | | </if> |
| | | <if test="end != null and end!=''"> |
| | | and finished_inspect.create_time <= #{end} |
| | | </if> |
| | | </select> |
| | | <select id="seAllCount" resultType="java.lang.Long"> |
| | | select count(id) |
| | | from mom_ocean.finished_inspect |
| | | where state=1 |
| | | and type=#{type} |
| | | <if test="begin != null and begin!=''"> |
| | | and finished_inspect.create_time >= #{begin} |
| | | </if> |
| | | <if test="end != null and end!=''"> |
| | | and finished_inspect.create_time <= #{end} |
| | | </if> |
| | | </select> |
| | | <!--æ°å¢è¿ç¨æ£éªå-æ ¹æ®è®¢åå·éæ©äº§åä¿¡æ¯--> |
| | | |
| | | <!--æ°å¢æ£éªå-æ ¹æ®è®¢åå·éæ©äº§åä¿¡æ¯--> |
| | | <resultMap id="oneMap" type="map"> |
| | | <id property="name" column="material"/> |
| | | <result property="code" column="code"/> |
| | | <result property="specifications" column="specifications"/> |
| | | <result property="unit" column="unit"/> |
| | | <id property="prname" column="prname"/> |
| | | <result property="sname" column="sname"/> |
| | | <collection property="children" resultMap="twoMap" javaType="List"/> |
| | | </resultMap> |
| | | <resultMap id="twoMap" type="map"> |
| | | <result property="name" column="techfather"/> |
| | | <id property="id" column="moid"/> |
| | | <result property="name" column="material"/> |
| | | <result property="mcode" column="mcode"/> |
| | | <result property="qualityTraceability" column="quality_traceability"/> |
| | | <result property="specifications" column="specifications"/> |
| | | <result property="unit" column="unit"/> |
| | | <collection property="children" resultMap="threeMap" javaType="List"/> |
| | | </resultMap> |
| | | <resultMap id="threeMap" type="map"> |
| | | <id property="id" column="technologyId"/> |
| | | <result property="name" column="techname"/> |
| | | </resultMap> |
| | | <select id="chooseMater" resultMap="oneMap"> |
| | | select mo.name material, |
| | | code, |
| | | select s.proname prname, |
| | | s.name sname, |
| | | quality_traceability, |
| | | m.code mcode, |
| | | mo.name material, |
| | | specifications, |
| | | unit, |
| | | technology_id technologyId, |
| | | techfather, |
| | | techname |
| | | from mom_ocean.manual_technology mt |
| | | left join mom_ocean.manufacture_order mo on mt.manufacture_order_id = mo.id |
| | | mo.id moid |
| | | from mom_ocean.manufacture_order mo |
| | | left join mom_ocean.material m on m.name = mo.name |
| | | left join mom_ocean.sale s on order_number = order_code |
| | | where mo.state = 1 |
| | | and type = 1 |
| | | and m.type = 1 |
| | | and order_code = #{orderNumber} |
| | | </select> |
| | | |
| | | <!--æ ¹æ®æ£éªåidæ¥è¯¢æåæ£éªå详æ
--> |
| | | <resultMap id="seProInsListById" type="map"> |
| | | <id property="name" column="order_number"/> |
| | | <result property="customerName" column="customer_name"/> |
| | | <result property="projectName" column="project_name"/> |
| | | <result property="qualityTraceability" column="quality_traceability"/> |
| | | <result property="materialCode" column="material_code"/> |
| | | <result property="material" column="material"/> |
| | | <result property="specifications" column="specifications_model"/> |
| | | <result property="funit" column="funit"/> |
| | | <result property="quantity" column="quantity"/> |
| | | <result property="fresult" column="fresult"/> |
| | | <collection property="children" resultMap="seProInsListByIdmap" javaType="List"/> |
| | | </resultMap> |
| | | <resultMap id="seProInsListByIdmap" type="map"> |
| | | <result property="ifather" column="ifather"/> |
| | | <collection property="children" resultMap="seProInsListByIdmaps" javaType="List"/> |
| | | </resultMap> |
| | | <resultMap id="seProInsListByIdmaps" type="map"> |
| | | <id property="iid" column="iid"/> |
| | | <result property="iname" column="iname"/> |
| | | <result property="iunit" column="iunit"/> |
| | | <result property="required" column="required"/> |
| | | <result property="internal" column="internal"/> |
| | | <result property="inspectionValue" column="inspection_value"/> |
| | | <result property="dname" column="dname"/> |
| | | <result property="iresult" column="iresult"/> |
| | | <result property="username" column="username"/> |
| | | </resultMap> |
| | | <select id="selectFinishInspectsListById" resultMap="seProInsListById"> |
| | | select order_number, |
| | | customer_name, |
| | | project_name, |
| | | quality_traceability, |
| | | material_code, |
| | | material, |
| | | specifications_model, |
| | | fi.unit funit, |
| | | quantity, |
| | | ii.id iid, |
| | | ii.father ifather, |
| | | ii.name iname, |
| | | ii.unit iunit, |
| | | required, |
| | | internal, |
| | | inspection_value, |
| | | device.name dname, |
| | | ii.result iresult, |
| | | username, |
| | | fi.result fresult |
| | | from mom_ocean.inspection_item ii |
| | | left join mom_ocean.finished_inspect fi on fi.id = inspect_id |
| | | left join mom_ocean.device |
| | | on ii.device_id = device.id |
| | | where ii.type = 2 |
| | | and ii.state = 1 |
| | | and fi.state = 1 |
| | | and fi.id = #{id} |
| | | </select> |
| | | </mapper> |
| | |
| | | <?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.yuanchu.mom.mapper.InspectUnacceptedMapper"> |
| | | <!--æ ¹æ®åæææ£éªåidå é¤åææä¸åæ ¼å--> |
| | | <update id="updaRawIns"> |
| | | update mom_ocean.inspect_unaccepted |
| | | set state=0 |
| | | where raw_inspect_id = #{id} |
| | | and type = 0 |
| | | </update> |
| | | <!--æ ¹æ®åæææ£éªåidæ¹éå é¤åææä¸åæ ¼å--> |
| | | <update id="delAllRawIns"> |
| | | update mom_ocean.inspect_unaccepted |
| | | set state=0 |
| | | where raw_inspect_id in (${ids}) |
| | | and type = 0 |
| | | </update> |
| | | |
| | | |
| | | <select id="selectUnRawInspectsList" resultType="java.util.Map"> |
| | | select ru.id, |
| | |
| | | deal_state, |
| | | deal_reasult, |
| | | DATE_FORMAT(deal_time, '%Y-%m-%d') processingDate |
| | | FROM (inspect_unaccepted ru, |
| | | `user` u) |
| | | LEFT JOIN finished_inspect fi ON fi.`id` = ru.`raw_inspect_id` |
| | | FROM (mom_ocean.inspect_unaccepted ru, |
| | | mom_ocean.`user` u) |
| | | LEFT JOIN mom_ocean.finished_inspect fi ON fi.`id` = ru.`raw_inspect_id` |
| | | where fi.id = ru.raw_inspect_id |
| | | AND ru.type = 1 |
| | | AND ru.state=1 |
| | |
| | | <?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.yuanchu.mom.mapper.InspectionItemMapper"> |
| | | |
| | | <resultMap id="selectInspectionItemMap" type="inspectionItemDto"> |
| | | <id property="father" column="father"/> |
| | | <id property="father" column="ifather"/> |
| | | <association property="children" resultMap="selectInspectionItemDto2Map"/> |
| | | </resultMap> |
| | | |
| | | <resultMap id="selectInspectionItemDto2Map" type="inspectionItemDto2"> |
| | | <id property="id" column="id"/> |
| | | <result property="name" column="name"/> |
| | |
| | | <result property="internal" column="internal"/> |
| | | <result property="required" column="required"/> |
| | | <result property="inspectionValue" column="inspection_value"/> |
| | | <result property="deviceId" column="device_id"/> |
| | | <result property="dname" column="dname"/> |
| | | <result property="result" column="result"/> |
| | | <result property="username" column="username"/> |
| | | </resultMap> |
| | | |
| | | <select id="selectInspectionItem" resultMap="selectInspectionItemMap"> |
| | | SELECT i.`id`, IFNULL(i.`father`,i.`name`) father, i.`name`, i.`unit`, i.`internal`, i.`required`, i.`inspection_value`, i.`device_id`, i.`result` |
| | | FROM inspection_item i |
| | | WHERE i.`finish_inspect_id` = #{finishInspectId} |
| | | SELECT i.`id`, |
| | | i.`father` ifather, |
| | | i.`name`, |
| | | i.`unit`, |
| | | i.`internal`, |
| | | i.`required`, |
| | | i.`inspection_value`, |
| | | device.name dname, |
| | | i.`result`, |
| | | username |
| | | FROM mom_ocean.inspection_item i |
| | | left join mom_ocean.device on i.device_id = device.id |
| | | WHERE i.`inspect_id` = #{id} |
| | | AND i.`state` = 1 |
| | | and i.type = #{type} |
| | | </select> |
| | | |
| | | <!--è·å该æ£éªå䏿£éªé¡¹ç®çç»æé--> |
| | | <select id="getResult" resultType="java.lang.Integer"> |
| | | select distinct result |
| | | from mom_ocean.inspection_item |
| | | where state = 1 |
| | | and type = #{type} |
| | | and inspect_id = #{id} |
| | | </select> |
| | | </mapper> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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.yuanchu.mom.mapper.ProcessInspectMapper"> |
| | | <!--æ°å¢è¿ç¨æ£éªå-æ ¹æ®è®¢åå·éæ©äº§åä¿¡æ¯åå·¥èº--> |
| | | <resultMap id="oneMap" type="map"> |
| | | <id property="name" column="material"/> |
| | | <result property="code" column="code"/> |
| | | <result property="specifications" column="specifications"/> |
| | | <result property="unit" column="unit"/> |
| | | <collection property="children" resultMap="twoMap" javaType="List"/> |
| | | </resultMap> |
| | | <resultMap id="twoMap" type="map"> |
| | | <result property="name" column="techfather"/> |
| | | <collection property="children" resultMap="threeMap" javaType="List"/> |
| | | </resultMap> |
| | | <resultMap id="threeMap" type="map"> |
| | | <id property="id" column="technologyId"/> |
| | | <result property="name" column="techname"/> |
| | | </resultMap> |
| | | <select id="chooseMater" resultMap="oneMap"> |
| | | select mo.name material, |
| | | code, |
| | | specifications, |
| | | unit, |
| | | technology_id technologyId, |
| | | techfather, |
| | | techname |
| | | from mom_ocean.manual_technology mt |
| | | left join mom_ocean.manufacture_order mo on mt.manufacture_order_id = mo.id |
| | | left join mom_ocean.material m on m.name = mo.name |
| | | where mo.state = 1 |
| | | and type = 1 |
| | | and order_code = #{orderNumber} |
| | | </select> |
| | | |
| | | <!--æ ¹æ®æ£éªåidæ¥è¯¢è¿ç¨æ£éªå详æ
--> |
| | | <resultMap id="seProInsListById" type="map"> |
| | | <id property="name" column="order_number"/> |
| | | <result property="materialCode" column="material_code"/> |
| | | <result property="material" column="material"/> |
| | | <result property="specifications" column="specifications_model"/> |
| | | <result property="techfather" column="techfather"/> |
| | | <result property="techname" column="techname"/> |
| | | <result property="punit" column="punit"/> |
| | | <result property="quantity" column="quantity"/> |
| | | <result property="presult" column="presult"/> |
| | | <collection property="children" resultMap="seProInsListByIdmap" javaType="List"/> |
| | | </resultMap> |
| | | <resultMap id="seProInsListByIdmap" type="map"> |
| | | <result property="ifather" column="ifather"/> |
| | | <collection property="children" resultMap="seProInsListByIdmaps" javaType="List"/> |
| | | </resultMap> |
| | | <resultMap id="seProInsListByIdmaps" type="map"> |
| | | <id property="iid" column="iid"/> |
| | | <result property="iname" column="iname"/> |
| | | <result property="iunit" column="iunit"/> |
| | | <result property="required" column="required"/> |
| | | <result property="internal" column="internal"/> |
| | | <result property="inspectionValue" column="inspection_value"/> |
| | | <result property="dname" column="dname"/> |
| | | <result property="iresult" column="iresult"/> |
| | | <result property="username" column="username"/> |
| | | </resultMap> |
| | | <select id="selectProcessInspectsListById" resultMap="seProInsListById"> |
| | | select order_number, |
| | | material_code, |
| | | material, |
| | | specifications_model, |
| | | techfather, |
| | | techname, |
| | | pi.unit punit, |
| | | quantity, |
| | | ii.id iid, |
| | | ii.father ifather, |
| | | ii.name iname, |
| | | ii.unit iunit, |
| | | required, |
| | | internal, |
| | | inspection_value, |
| | | device.name dname, |
| | | ii.result iresult, |
| | | username, |
| | | pi.result presult |
| | | from mom_ocean.inspection_item ii |
| | | left join mom_ocean.process_inspect pi on pi.id = inspect_id |
| | | left join mom_ocean.device on ii.device_id = device.id |
| | | where ii.type = 1 |
| | | and ii.state = 1 |
| | | and pi.state = 1 |
| | | and pi.id = #{id} |
| | | </select> |
| | | <!--å页æ¥è¯¢è¿ç¨æ£éªåå表--> |
| | | <select id="selectProcessInspectsList" resultType="java.util.Map"> |
| | | select process_inspect.id, |
| | | order_number, |
| | | material_code, |
| | | material, |
| | | specifications_model, |
| | | techfather, |
| | | techname, |
| | | unit, |
| | | quantity, |
| | | DATE_FORMAT(process_inspect.create_time, '%Y-%m-%d') createTime, |
| | | name, |
| | | DATE_FORMAT(process_inspect.update_time, '%Y-%m-%d') updateTime, |
| | | result |
| | | from mom_ocean.process_inspect |
| | | left join mom_ocean.user on process_inspect.user_id = user.id |
| | | where process_inspect.state = 1 |
| | | <if test="techfather!=null and techfather!=''"> |
| | | and techfather like concat('%',#{techfather},'%') |
| | | </if> |
| | | <if test="material!=null and material!=''"> |
| | | and material like concat('%',#{name},'%') |
| | | </if> |
| | | <if test="result!=null "> |
| | | and result =#{result} |
| | | </if> |
| | | </select> |
| | | </mapper> |
| | |
| | | <?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.yuanchu.mom.mapper.RawInsProductMapper"> |
| | | <!--æ ¹æ®åæææ£éªåidå é¤--> |
| | | <update id="updaRawInsById"> |
| | | update mom_ocean.raw_ins_product |
| | | set state=0 |
| | | where raw_inspect_id = #{id} |
| | | </update> |
| | | <!--æ ¹æ®åæææ£éªåidæ¹éå é¤åæææ£éªé¡¹ç®--> |
| | | <update id="delAllRawIns"> |
| | | update mom_ocean.raw_ins_product |
| | | set state=0 |
| | | where raw_inspect_id in (${ids}) |
| | | </update> |
| | | <!--æ ¹æ®åæææ£éªåidæ¥è¯¢æ£éªé¡¹ç®--> |
| | | <select id="getresult" resultType="java.lang.Integer"> |
| | | select test_state |
| | |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.yuanchu.mom.mapper.RawInspectMapper"> |
| | | <!--æ ¹æ®åæææ£éªåidæ¹éå é¤--> |
| | | <update id="delAllRawIns"> |
| | | update mom_ocean.raw_inspect |
| | | set state=0 |
| | | where id in (${ids}) |
| | | </update> |
| | | <select id="selCountRaw" resultType="java.lang.Integer"> |
| | | select count(id) |
| | | from mom_ocean.raw_inspect |
| | |
| | | List<Map<String, Object>> seleDatil(Integer manOrdId); |
| | | |
| | | List<Map<String, Object>> selectListTowTree(Integer schedulingId); |
| | | |
| | | //æ ¹æ®çäº§è®¢åæ¥è¯¢ææ(ååº) |
| | | List<ManualTechnology> selAllByMoId(Integer id); |
| | | } |
| | | |
| | |
| | | <?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.yuanchu.mom.mapper.ManualTechnologyMapper"> |
| | | |
| | | <resultMap id="seleDatilMap" type="map"> |
| | | <id property="lable" column="techfather"/> |
| | | <collection property="children" resultMap="seleDatilTowMap" javaType="List"/> |
| | |
| | | <result property="period" column="period"/> |
| | | </resultMap> |
| | | <select id="selectListTowTree" resultMap="selectListTowTreeFirstMap"> |
| | | SELECT p.`id`, t.`techfather`, t.`techname`, d.`name`, DATE_FORMAT(p.`start_time`, '%Y-%m-%d') start_time, |
| | | DATE_FORMAT(p.`end_time`, '%Y-%m-%d') end_time, p.`period` |
| | | SELECT p.`id`, |
| | | t.`techfather`, |
| | | t.`techname`, |
| | | d.`name`, |
| | | DATE_FORMAT(p.`start_time`, '%Y-%m-%d') start_time, |
| | | DATE_FORMAT(p.`end_time`, '%Y-%m-%d') end_time, |
| | | p.`period` |
| | | FROM manufacture_order_process p |
| | | LEFT JOIN device d ON d.`id` = p.`device_id` |
| | | LEFT JOIN manual_technology t ON t.`id` = p.`manual_technology_id` |
| | |
| | | AND p.`manufacture_scheduling_id` = #{schedulingId} |
| | | ORDER BY p.`create_time` DESC |
| | | </select> |
| | | |
| | | <!--æ ¹æ®ç产订åidæ¥è¯¢ææ(ååº)--> |
| | | <select id="selAllByMoId" resultType="com.yuanchu.mom.pojo.ManualTechnology"> |
| | | select * |
| | | from mom_ocean.manual_technology |
| | | where state = 1 |
| | | and manufacture_order_id = #{id} |
| | | order by id desc |
| | | </select> |
| | | </mapper> |
| | |
| | | String addMaterial(MaterialDto materialDto); |
| | | |
| | | |
| | | /** |
| | | * æ£éªæ¨¡å-->QMS管ç-->æåæ£éª-->æ°å¢(项ç®åç§°ä¸ææ¡ï¼Idä¸åç§°ï¼ç¼ç ) |
| | | */ |
| | | List<Map<String, Object>> selectMaterialIdAndNameAndCode(); |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | return "æ·»å ç©æã" + materialDto.getName() + "ãæå"; |
| | | } |
| | | |
| | | //æ£éªæ¨¡å-->QMS管ç-->æåæ£éª-->æ°å¢(项ç®åç§°ä¸ææ¡ï¼Idä¸åç§°ï¼ç¼ç ) |
| | | @Override |
| | | public List<Map<String, Object>> selectMaterialIdAndNameAndCode() { |
| | | LambdaQueryWrapper<Material> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.select(Material::getId, Material::getName, Material::getCode); |
| | | return materialMapper.selectMaps(wrapper); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | datasource: |
| | | type: com.alibaba.druid.pool.DruidDataSource |
| | | driverClassName: com.mysql.cj.jdbc.Driver |
| | | url: jdbc:mysql://192.168.65.113:3306/mom_ocean?useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8 |
| | | url: jdbc:mysql://192.168.218.113:3306/mom_ocean?useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8 |
| | | username: user |
| | | password: 123456 |
| | | druid: |
| | |
| | | # redisæ°æ®åºç´¢å¼(é»è®¤ä¸º0)ï¼æä»¬ä½¿ç¨ç´¢å¼ä¸º3çæ°æ®åºï¼é¿å
åå
¶ä»æ°æ®åºå²çª |
| | | database: 0 |
| | | # redisæå¡å¨å°åï¼é»è®¤ä¸ºlocalhostï¼ |
| | | host: 192.168.65.113 |
| | | host: 192.168.218.113 |
| | | # redis端å£ï¼é»è®¤ä¸º6379ï¼ |
| | | port: 6379 |
| | | # redis访é®å¯ç ï¼é»è®¤ä¸ºç©ºï¼ |