| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | 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.service.*; |
| | | import com.yuanchu.mom.utils.JackSonUtil; |
| | | import com.yuanchu.mom.utils.Jwt; |
| | |
| | | |
| | | /** |
| | | * <p> |
| | | * å端æ§å¶å¨ |
| | | * å端æ§å¶å¨ |
| | | * </p> |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | |
| | | @Autowired |
| | | 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(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 { |
| | | Map<String, String> data = JackSonUtil.unmarshal(jwt.readJWT(token).get("data"), Map.class); |
| | | return Result.success(finishedInspectService.addProcess(data.get("id").replaceAll("\"", ""), finishedInspectVo1)); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "æ°å¢æé®-->1ãæ°å¢æåæ£éªå") |
| | | @PostMapping("/add_process_inspection_sheet") |
| | | public Result<?> addProcessInspectionSheet(@Validated @RequestBody FinishedInspect finishedInspect){ |
| | | public Result<?> addProcessInspectionSheet(@Validated @RequestBody FinishedInspect finishedInspect) { |
| | | Integer isInsertSuccess = finishedInspectService.addProcessInspectionSheet(finishedInspect); |
| | | if (isInsertSuccess == 1){ |
| | | if (isInsertSuccess == 1) { |
| | | return Result.success("æ°å¢æåï¼", finishedInspect.getId()); |
| | | } |
| | | return Result.fail("æ°å¢å¤±è´¥ï¼"); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ°å¢æé®-->1ãæ°å¢è¿ç¨æ£éªå-->主æºå·¥ä¸ææ¡") |
| | | @GetMapping("/list_user") |
| | | public Result<?> selectUserIdAndName(){ |
| | | List<Map<String, Object>> maps = userService.listUserIdAndName(); |
| | | return Result.success(maps); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ°å¢æé®-->1ãæ°å¢è¿ç¨æ£éªå-->2ãè§æ ¼åå·ä¸ææ¡ï¼æ ¹æ®é¡¹ç®IDæ¥è¯¢") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "materialId",value = "项ç®åç§°ID",dataTypeClass = Integer.class,required = true) |
| | | }) |
| | | @GetMapping("/list_specification") |
| | | public Result<?> selectSpecificationIdAndName(Integer materialId){ |
| | | List<Map<String, Object>> maps = specificationsService.selectSpecificationIdAndName(materialId); |
| | | return Result.success(maps); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ°å¢æé®-->1ãæ°å¢è¿ç¨æ£éªå-->1ã项ç®åç§°ä¸ææ¡") |
| | | @GetMapping("/list_material") |
| | | public Result<?> selectMaterialIdAndNameAndCode(){ |
| | | public Result<?> selectMaterialIdAndNameAndCode() { |
| | | List<Map<String, Object>> maps = materialService.selectMaterialIdAndNameAndCode(); |
| | | return Result.success(maps); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ°å¢æé®-->3ãæ£éªç»è®º") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "finishedInspectId",value = "æ£éªåId",dataTypeClass = Integer.class,required = true), |
| | | @ApiImplicitParam(name = "result",value = "æ£éªç»è®º",dataTypeClass = Integer.class,required = true), |
| | | @ApiImplicitParam(name = "finishedInspectId", value = "æ£éªåId", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "result", value = "æ£éªç»è®º", dataTypeClass = Integer.class, required = true), |
| | | }) |
| | | @PostMapping("/inspection_conclusion") |
| | | public Result<?> inspectionConclusion(@RequestHeader("token") String token,Integer finishedInspectId, Integer result) throws Exception { |
| | | 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){ |
| | | Integer isInsertSuccess = finishedInspectService.inspectionConclusion(data.get("name").replaceAll("\"", ""), finishedInspectId, result); |
| | | if (isInsertSuccess == 1) { |
| | | return Result.success("䏿¥æåï¼"); |
| | | } |
| | | return Result.fail("䏿¥å¤±è´¥ï¼"); |
| | |
| | | @ApiImplicitParam(name = "inspectUsername", value = "主æºå·¥", dataTypeClass = String.class) |
| | | }) |
| | | @GetMapping("/list_page") |
| | | public Result<?> selectFinishedInspectPage(Integer pageNo, Integer pageSize, Integer inspectResult, String inspectDate, String inspectUsername){ |
| | | 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); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("total", page.getTotal()); |
| | |
| | | return Result.success(map); |
| | | } |
| | | |
| | | @ApiOperation(value = "4ã主页å页-->主æºå·¥æ¡ä»¶æ¥è¯¢ä¸ææ¡") |
| | | @GetMapping("/page_user") |
| | | public Result<?> selectPageUserIdAndName(){ |
| | | List<Map<String, Object>> maps = userService.listUserIdAndName(); |
| | | return Result.success(maps); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | |
| | | |
| | | //è®¡ç®æäº§é |
| | | Long seAllCount(String begin, String end, int type); |
| | | |
| | | //æ°å¢è¿ç¨æ£éªå-->æ ¹æ®è®¢åå·éæ©äº§åä¿¡æ¯ |
| | | List<Map<String, Object>> chooseMater(String orderNumber); |
| | | } |
| | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @NotBlank(message = "订åå·ä¸å
许为空ï¼") |
| | | |
| | | @ApiModelProperty(value = "订åå·", required = true, example = "DDH202308010001") |
| | | private String orderNumber; |
| | | |
| | | @NotBlank(message = "客æ·åç§°ä¸å
许为空ï¼") |
| | | |
| | | @ApiModelProperty(value = "客æ·åç§°", required = true, example = "ææ´æ´") |
| | | private String customerName; |
| | | |
| | | @NotBlank(message = "å·¥ç¨åç§°ä¸å
许为空ï¼") |
| | | |
| | | @ApiModelProperty(value = "å·¥ç¨åç§°", required = true, example = "æ¶²ä½ç¡
æ©¡è¶") |
| | | private String projectName; |
| | | |
| | | @NotBlank(message = "è´¨é追溯å·ä¸å
许为空ï¼") |
| | | |
| | | @ApiModelProperty(value = "è´¨é追溯å·", required = true, example = "ZLZSH202308010001") |
| | | private String qualityTraceability; |
| | | |
| | | @ApiModelProperty(value = "0:æå;1ï¼è¿ç¨;", hidden = true) |
| | | private Integer type; |
| | | |
| | | @NotBlank(message = "åä½ä¸å
许为空ï¼") |
| | | |
| | | @ApiModelProperty(value = "åä½", required = true, example = "å¨") |
| | | private String unit; |
| | | |
| | | @NotNull(message = "请è¾å
¥æ°éï¼") |
| | | |
| | | @ApiModelProperty(value = "æ°é", required = true, example = "50") |
| | | private Integer quantity; |
| | | |
| | | @NotNull(message = "è¯·éæ©è§æ ¼åå·ï¼") |
| | | |
| | | @ApiModelProperty(value = "è§æ ¼åå·æ¼æ¥å符", required = true, example = "8.7/15kV JLS-3.2") |
| | | private String specificationsModel; |
| | | |
| | | @NotNull(message = "è¯·éæ©åå·IDï¼") |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(value = "åå·ID", required = true, example = "1") |
| | | private Integer specificationsId; |
| | | |
| | | @ApiModelProperty(value = "项ç®ç¼ç ", required = true, example = "GX20230807") |
| | | @ApiModelProperty(value = "产åç¼ç ", required = true, example = "GX20230807") |
| | | private String materialCode; |
| | | |
| | | @NotNull(message = "è¯·éæ©é¡¹ç®åç§°ï¼") |
| | | @ApiModelProperty(value = "项ç®åç§°", required = true, example = "å
纤") |
| | | |
| | | @ApiModelProperty(value = "产ååç§°", required = true, example = "å
纤") |
| | | private String material; |
| | | |
| | | @NotNull(message = "è¯·éæ©ä¸»æºå·¥ï¼") |
| | | @ApiModelProperty(value = "主æºå·¥:ç¨æ·id", required = true, example = "1") |
| | | |
| | | @ApiModelProperty(value = "æ¥æ£äºº:ç¨æ·id", required = true, example = "1") |
| | | private Integer userId; |
| | | |
| | | @ApiModelProperty(value = "æ£éªç»è®º", hidden = true, required = true, example = "DDH202308010001") |
| | | private Integer result; |
| | | |
| | | @ApiModelProperty(value = "é»è¾å é¤ æ£å¸¸>=1,å é¤<=0", hidden = true) |
| | | @TableLogic(value = "1", delval = "0") |
| | | private Integer state; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.pojo.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | @Data |
| | | //æ°å¢è¿ç¨æ£éªåæ° |
| | | public class FinishedInspectVo1 { |
| | | |
| | | @NotBlank(message = "订åå·ä¸è½ä¸ºç©º!") |
| | | private String orderNumber; |
| | | |
| | | @NotBlank(message = "产åä¸è½ä¸ºç©º!") |
| | | private String material; |
| | | |
| | | @NotBlank(message = "产åç¼ç ä¸è½ä¸ºç©º!") |
| | | private String materialCode; |
| | | |
| | | @NotBlank(message = "è§æ ¼åå·ä¸è½ä¸ºç©º!") |
| | | private String specificationsModel; |
| | | |
| | | @NotBlank(message = "åä½ä¸è½ä¸ºç©º!") |
| | | private String unit; |
| | | |
| | | @NotBlank(message = "å·¥åºä¸è½ä¸ºç©º!") |
| | | private String techfather; |
| | | |
| | | @NotBlank(message = "å·¥èºä¸è½ä¸ºç©º!") |
| | | private String techname; |
| | | |
| | | @NotNull(message = "å
³èçå·¥èºè·¯çº¿idä¸è½ä¸ºç©º!") |
| | | private Integer technologyId; |
| | | |
| | | //æ£éªå¼ |
| | | private String inspectionValue; |
| | | |
| | | //设å¤id |
| | | private Integer deviceId; |
| | | } |
| | |
| | | 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 org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | | * æå¡ç±» |
| | | * æå¡ç±» |
| | | * </p> |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | Integer addProcessInspectionSheet(FinishedInspect finishedInspect); |
| | | |
| | | Integer inspectionConclusion(String username,Integer finishedInspectId, Integer result); |
| | | 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 |
| | | * @return |
| | | */ |
| | | String addProcess(String userId, FinishedInspectVo1 finishedInspectVo1); |
| | | |
| | | /** |
| | | * æ°å¢è¿ç¨æ£éªå-->éæ©è®¾å¤ |
| | | * @param mtid |
| | | * @param father |
| | | * @param name |
| | | * @return |
| | | */ |
| | | List<Map<String,Object>> chooseDev(Integer technologyId, String father, String name); |
| | | } |
| | |
| | | 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.ImportRepertoryMapper; |
| | | import com.yuanchu.mom.mapper.InspectUnacceptedMapper; |
| | | import com.yuanchu.mom.mapper.RepertoryMapper; |
| | | import com.yuanchu.mom.pojo.FinishedInspect; |
| | | import com.yuanchu.mom.mapper.FinishedInspectMapper; |
| | | import com.yuanchu.mom.pojo.ImportRepertory; |
| | | import com.yuanchu.mom.pojo.InspectUnaccepted; |
| | | import com.yuanchu.mom.pojo.Repertory; |
| | | import com.yuanchu.mom.service.FinishedInspectService; |
| | | import com.yuanchu.mom.mapper.*; |
| | | import com.yuanchu.mom.pojo.*; |
| | | import com.yuanchu.mom.pojo.vo.FinishedInspectVo1; |
| | | import com.yuanchu.mom.service.*; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.yuanchu.mom.service.InspectionItemService; |
| | | import com.yuanchu.mom.service.ProductService; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | 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; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Resource |
| | | private FinishedInspectMapper finishedInspectMapper; |
| | | |
| | | @Resource |
| | | MaterialMapper materialMapper; |
| | | |
| | | @Resource |
| | | StandardService standardService; |
| | | |
| | | @Resource |
| | | SpecificationsService specificationsService; |
| | | |
| | | @Resource |
| | | InspectionItemService inspectionItemService; |
| | | |
| | | @Autowired |
| | | private ProductService productService; |
| | | |
| | | @Autowired |
| | | private InspectionItemService inspectionItemService; |
| | | @Resource |
| | | UserMapper userMapper; |
| | | |
| | | @Resource |
| | | InspectUnacceptedMapper inspectUnacceptedMapper; |
| | |
| | | @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); |
| | | /*List<Map<String, Object>> maps = productService.selectProductList(finishedInspect.getSpecificationsId()); |
| | | inspectionItemService.insertList(finishedInspect.getId(), maps);*/ |
| | | return insert; |
| | | } |
| | | return 0; |
| | |
| | | } |
| | | } |
| | | //妿æ¯è¿ç¨æ£éªåæ ¼,éè¦æ°å¢åæå(1)åºå,æ£éªç»æä¸ºåæ ¼1 |
| | | if (finishedInspect.getType()==1) { |
| | | if (finishedInspect.getType() == 1) { |
| | | /*æ°å¢åæå(1)åºå*/ |
| | | //妿å
¥åºçä¿¡æ¯ä¸æ ·åªæåºåä¸ä¸æ ·,åå¨åæ¥çåºåæ°éä¸å ä¸ç¸åºçæ°é |
| | | LambdaQueryWrapper<Repertory> queryWrapper = new LambdaQueryWrapper<>(); |
| | |
| | | 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) { |
| | | /*æ°å¢è¿ç¨æ£éªå*/ |
| | | FinishedInspect finishedInspect = new FinishedInspect(); |
| | | finishedInspect.setType(1); |
| | | finishedInspect.setUserId(Integer.parseInt(userId)); |
| | | BeanUtils.copyProperties(finishedInspectVo1, finishedInspect); |
| | | finishedInspectMapper.insert(finishedInspect); |
| | | /*æ¹éæ°å¢è¿ç¨æ£éªé¡¹ç®è¡¨*/ |
| | | //è·ååå·id |
| | | Integer specificationId = getSpecificationId(finishedInspectVo1.getMaterial(), finishedInspectVo1.getMaterialCode(), finishedInspectVo1.getSpecificationsModel()); |
| | | //æ¥è¯¢æ åBOMææ¯ææ ä¸è¯¥åå·å·¥èºä¸ææ°çæ¬çæ£éªé¡¹ç® |
| | | Integer ver = productService.selectVerByPro(specificationId).get(0);//该åå·ä¸ææ¯ææ ææ°çæ¬ |
| | | List<Product> productList = productService.selProByVerSpe(finishedInspectVo1.getTechnologyId(), 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()); |
| | | } |
| | | return inspectionItem; |
| | | }).collect(Collectors.toList()); |
| | | inspectionItemService.saveBatch(inspectionItemList); |
| | | 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); |
| | | } |
| | | |
| | | |
| | | /*æ ¹æ®æ ·ååç§°,æ ·åç¼å·,åå·è§æ ¼è·ååå·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; |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | 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"/> |
| | | <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> |
| | | </mapper> |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.mom.pojo.dto.SaleMaterialDto; |
| | | import com.yuanchu.mom.pojo.vo.SaleVo; |
| | | import com.yuanchu.mom.service.RepertoryService; |
| | | import com.yuanchu.mom.utils.JackSonUtil; |
| | |
| | | @Resource |
| | | Jwt jwt; |
| | | |
| | | @Resource |
| | | RepertoryService repertoryService; |
| | | |
| | | @ApiOperation(value = "æ¥è¯¢éå®åå表") |
| | | @ApiImplicitParams(value = { |
| | |
| | | |
| | | @ApiOperation(value = "æ°å¢éå®å") |
| | | @PostMapping("/addSale") |
| | | public Result addSale(@RequestHeader("token") String token,@Validated @RequestBody SaleDto saleDto) throws Exception { |
| | | Map<String, String> data = JackSonUtil.unmarshal(jwt.readJWT(token).get("data"), Map.class); |
| | | saleService.addSale(data.get("name").replaceAll("\"", ""), saleDto); |
| | | public Result addSale(@RequestHeader("token") String token, @Validated @RequestBody SaleDto saleDto) throws Exception { |
| | | //æ ¡éª,åä¸ä¸ªäº§åçè§æ ¼åå·ä¸è½ç¸å |
| | | List<SaleMaterialDto> saleMaterialList = saleDto.getSaleMaterialList(); |
| | | // 使ç¨åå¸é忥夿æ¯å¦åå¨ç¸ååæ®µå¼ç»å |
| | | Set<String> seen = new HashSet<>(); |
| | | for (SaleMaterialDto saleMaterial: saleMaterialList) { |
| | | String key = saleMaterial.getName() + "," + saleMaterial.getSpecifications(); |
| | | if (seen.contains(key)) { |
| | | return Result.fail("åä¸ä¸ªäº§åçè§æ ¼åå·ä¸è½ç¸å"); |
| | | } else { |
| | | seen.add(key); |
| | | } |
| | | } |
| | | Map<String, String> data = JackSonUtil.unmarshal(jwt.readJWT(token).get("data"), Map.class); |
| | | saleService.addSale(data.get("name").replaceAll("\"", ""), saleDto); |
| | | return Result.success("æ°å¢æå!"); |
| | | } |
| | | |
| | |
| | | @ApiImplicitParam(name = "id", value = "jsonæ ¼å¼çéå®åå
容", dataTypeClass = Json.class, required = true) |
| | | }) |
| | | @PostMapping("/updateSaleById") |
| | | public Result updateSaleById(@RequestHeader("token") String token,Integer id, String str) throws Exception { |
| | | public Result updateSaleById(@RequestHeader("token") String token, Integer id, String str) throws Exception { |
| | | SaleVo saleVo = JackSonUtil.unmarshal(str, SaleVo.class); |
| | | Map<String, String> data = JackSonUtil.unmarshal(jwt.readJWT(token).get("data"), Map.class); |
| | | saleService.updateSaleById(data.get("name").replaceAll("\"", ""),id, saleVo); |
| | | saleService.updateSaleById(data.get("name").replaceAll("\"", ""), id, saleVo); |
| | | return Result.success("ä¿®æ¹æå!"); |
| | | } |
| | | |
| | |
| | | |
| | | @ApiOperation(value = "æ¹éå é¤") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "ids", value = "ids", dataTypeClass = Integer.class, dataType = "List",required = true) |
| | | @ApiImplicitParam(name = "ids", value = "ids", dataTypeClass = Integer.class, dataType = "List", required = true) |
| | | }) |
| | | @PostMapping("/delAllSale") |
| | | public Result delAllSale( @RequestParam("ids") List<Integer> ids) { |
| | | public Result delAllSale(@RequestParam("ids") List<Integer> ids) { |
| | | saleService.delAllSale(ids); |
| | | return Result.success(); |
| | | } |
| | |
| | | @ApiImplicitParam(name = "type", value = "ç¶æ", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @PostMapping("/check") |
| | | public Result check(@RequestHeader("token") String token,Integer id,Integer type) throws Exception { |
| | | public Result check(@RequestHeader("token") String token, Integer id, Integer type) throws Exception { |
| | | Map<String, String> data = JackSonUtil.unmarshal(jwt.readJWT(token).get("data"), Map.class); |
| | | saleService.check(data.get("name").replaceAll("\"", ""),id,type); |
| | | saleService.check(data.get("name").replaceAll("\"", ""), id, type); |
| | | return Result.success("å®¡æ ¸æå"); |
| | | } |
| | | |
| | |
| | | import com.yuanchu.mom.mapper.*; |
| | | import com.yuanchu.mom.pojo.*; |
| | | import com.yuanchu.mom.service.OrdersService; |
| | | import com.yuanchu.mom.service.SpecificationsService; |
| | | import com.yuanchu.mom.service.StandardService; |
| | | import com.yuanchu.mom.utils.MyUtil; |
| | | 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; |
| | | |
| | | /** |
| | | * 订å(Order)表æå¡å®ç°ç±» |
| | |
| | | * @since 2023-07-31 11:57:44 |
| | | */ |
| | | @Service("orderService") |
| | | public class OrdersServiceImpl implements OrdersService { |
| | | public class OrdersServiceImpl implements OrdersService { |
| | | |
| | | @Resource |
| | | SaleMapper saleMapper; |
| | | |
| | | @Resource |
| | | MaterialMapper materialMapper; |
| | | |
| | | @Resource |
| | | StandardService standardService; |
| | | |
| | | @Resource |
| | | SpecificationsService specificationsService; |
| | | |
| | | @Resource |
| | | SaleMaterialMapper saleMaterialMapper; |
| | |
| | | TechnologyMapper technologyMapper; |
| | | |
| | | |
| | | |
| | | //æ¥è¯¢ææè®¢åå表 |
| | | @Override |
| | | public IPage<Map<String, Object>> selectAllOrder(Page<Object> page, String orderCode, String name, Integer type , String time) { |
| | | return saleMapper.selectAllOrder(page, orderCode,name,type, time); |
| | | public IPage<Map<String, Object>> selectAllOrder(Page<Object> page, String orderCode, String name, Integer type, String time) { |
| | | return saleMapper.selectAllOrder(page, orderCode, name, type, time); |
| | | } |
| | | |
| | | //ç¼å¶è®¢åBOM |
| | |
| | | .build(); |
| | | //æ°å¢ç产订å |
| | | manufactureOrderMapper.insert(manufactureOrder); |
| | | //æ¥è¯¢äº§åçå·¥åº |
| | | String[] split = manufactureOrder.getSpecifications().split("-"); |
| | | Specifications specifications = specificationsMapper.selectOne(Wrappers.<Specifications>query().eq("name", split[1])); |
| | | List<Technology> technologyList = technologyMapper.selectList(Wrappers.<Technology>query().eq("specifications_id", specifications.getId())); |
| | | //æ¥è¯¢äº§åçææ°å·¥åº |
| | | //产åç¼ç |
| | | String code = materialMapper.selMcode(manufactureOrder.getName()); |
| | | //åå·id |
| | | Integer specificationId = getSpecificationId(manufactureOrder.getName(), code, manufactureOrder.getSpecifications()); |
| | | //é»è®¤ææ°çæ¬ |
| | | Integer version = technologyMapper.selectVerByTec(specificationId).get(0); |
| | | List<Technology> technologyList = technologyMapper.selectList(Wrappers.<Technology>query() |
| | | .eq("specifications_id", specificationId) |
| | | .eq("version", version)); |
| | | for (Technology technology : technologyList) { |
| | | ManualTechnology manualTechnology = ManualTechnology.builder() |
| | | .techname(technology.getName()) |
| | |
| | | .deviceGroup(technology.getDeviceGroup()) |
| | | .manufactureOrderId(manufactureOrder.getId()) |
| | | .productionQuota(technology.getProductionQuota()) |
| | | .technologyId(technology.getId()) |
| | | .build(); |
| | | //æ°å¢ç¼å¶å·¥åºè¡¨ |
| | | manualTechnologyMapper.insert(manualTechnology); |
| | | } |
| | | } |
| | | |
| | | /*æ ¹æ®æ ·ååç§°,æ ·åç¼å·,åå·è§æ ¼è·ååå·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 Integer manufactureOrderId; |
| | | |
| | | /** |
| | | * å
³è æ åBOMå·¥èºè·¯çº¿id |
| | | **/ |
| | | private Integer technologyId; |
| | | |
| | | @ApiModelProperty(value = "é»è¾å é¤ æ£å¸¸>=1,å é¤<=0", hidden = true) |
| | | @TableLogic(value = "1", delval = "0") |
| | | private Integer state; |
| | |
| | | @ApiOperation("(1,2级)æ°å¢-->ç©æ,æ å,åå·") |
| | | @PostMapping("/add") |
| | | public Result<?> addMaterial(@Validated @RequestBody MaterialDto materialDto) { |
| | | materialService.addMaterial(materialDto); |
| | | return Result.success("æ·»å ç©æã" + materialDto.getName() + "ãæå"); |
| | | return Result.success(materialService.addMaterial(materialDto)); |
| | | } |
| | | |
| | | @ApiOperation(value = "å³ä¾§æ°æ®å±ç¤º-->éæ©çæ¬") |
| | |
| | | @ApiOperation("(4级)æ°å¢-->åå·") |
| | | @PostMapping("/add") |
| | | public Result<?> addSpecifications(@Validated @RequestBody SpecificationsDto specificationsDto) { |
| | | specificationsService.addSpecifications(specificationsDto); |
| | | return Result.fail("æ·»å åå·ã"+ specificationsDto.getSpecifications() +"ãæåï¼"); |
| | | return Result.success(specificationsService.addSpecifications(specificationsDto)); |
| | | } |
| | | |
| | | } |
| | |
| | | @ApiOperation("(3级)æ°å¢-->æ å,åå·") |
| | | @PostMapping("/add") |
| | | public Result<?> addStandard(@Validated @RequestBody StandardDto standardDto) { |
| | | standardService.addStandard(standardDto); |
| | | return Result.fail("æ·»å æ åã"+ standardDto.getStandard() +"ãæåï¼"); |
| | | return Result.success(standardService.addStandard(standardDto)); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | //æ ¹æ®æ åidæ¥è¯¢ç©æ |
| | | Material selFath(Integer id); |
| | | |
| | | //æ ¹æ®ç©æåç§°æ¥è¯¢æå产åç¼å· |
| | | String selMcode(String name); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | //æ ¹æ®ææ¯ææ idæ¹éå é¤ |
| | | void delAllPro(String ids); |
| | | |
| | | //æ¥è¯¢æ åBOMææ¯ææ ä¸è¯¥åå·å·¥èºä¸ææ°çæ¬çæ£éªé¡¹ç® |
| | | List<Product> selProByVerSpe(Integer technologyId, Integer ver); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | //æ ¹æ®ç产工èºidæ¹éå é¤ |
| | | void delAllTeq(String ids); |
| | | |
| | | //æ ¹æ®å·¥èºè·¯çº¿idæ¥è¯¢ææçæ¬ |
| | | List<Integer> selectVerByTeId(Integer technologyId); |
| | | |
| | | //æ¥è¯¢è¯¥å·¥èºä¸ææ°çæ¬å¨ä¸ä¸ªæ£éªé¡¹ç®ä¸å¯ä»¥ä½¿ç¨åªäºè®¾å¤ |
| | | List<Map<String, Object>> selDevByVerTecIdFaNam(Integer technologyId, String father, String name, Integer ver); |
| | | } |
| | | |
| | |
| | | |
| | | //æ¹éå é¤ |
| | | void delAllTech(String ids); |
| | | |
| | | //æ¥è¯¢è¯¥åå·å·¥èºä¸ææ°çæ¬çå·¥èºid |
| | | Integer selTech(String techfather, String techname, Integer version, Integer specificationId); |
| | | } |
| | |
| | | * @param materialDto |
| | | * @return |
| | | */ |
| | | void addMaterial(MaterialDto materialDto); |
| | | String addMaterial(MaterialDto materialDto); |
| | | |
| | | |
| | | /** |
| | |
| | | * @param ids |
| | | */ |
| | | void delAllPro(String ids); |
| | | |
| | | /** |
| | | * æ¥è¯¢æ åBOMææ¯ææ ä¸è¯¥åå·å·¥èºä¸ææ°çæ¬çæ£éªé¡¹ç® |
| | | * @param technologyId |
| | | * @param ver |
| | | * @return |
| | | */ |
| | | List<Product> selProByVerSpe(Integer technologyId, Integer ver); |
| | | } |
| | |
| | | * (4级)æ°å¢-->åå· |
| | | * @param specificationsDto |
| | | */ |
| | | void addSpecifications(SpecificationsDto specificationsDto); |
| | | String addSpecifications(SpecificationsDto specificationsDto); |
| | | |
| | | } |
| | |
| | | * (3级)æ°å¢-->æ å,åå· |
| | | * @param standardDto |
| | | */ |
| | | void addStandard(StandardDto standardDto); |
| | | String addStandard(StandardDto standardDto); |
| | | } |
| | |
| | | //(1,2级)æ°å¢-->ç©æ,æ å,åå· |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void addMaterial(MaterialDto materialDto) { |
| | | public String addMaterial(MaterialDto materialDto) { |
| | | //æ ¡éªæ·»å ç©ææ¯å¦éå¤ |
| | | if (materialMapper.selectOne(Wrappers.<Material>query() |
| | | .eq("type", materialDto.getType()) |
| | | .eq("father", materialDto.getFather())).getName().equals(materialDto.getName())) { |
| | | return "该类å产åå¤§ç±»ä¸æè¯¥äº§ååç§°"; |
| | | } |
| | | /*æ°å¢ç©æè¡¨*/ |
| | | Material material = new Material(); |
| | | material.setCode(MyUtil.getTimeSixNumberCode("ML", "ML")); |
| | |
| | | } |
| | | } |
| | | techniqueService.saveBatch(techniqueList); |
| | | return "æ·»å ç©æã" + materialDto.getName() + "ãæå"; |
| | | } |
| | | |
| | | //æ£éªæ¨¡å-->QMS管ç-->æåæ£éª-->æ°å¢(项ç®åç§°ä¸ææ¡ï¼Idä¸åç§°ï¼ç¼ç ) |
| | |
| | | public void delAllPro(String ids) { |
| | | productMapper.delAllPro(ids); |
| | | } |
| | | |
| | | //æ¥è¯¢æ åBOMææ¯ææ ä¸è¯¥åå·å·¥èºä¸ææ°çæ¬çæ£éªé¡¹ç® |
| | | @Override |
| | | public List<Product> selProByVerSpe(Integer technologyId, Integer ver) { |
| | | return productMapper.selProByVerSpe(technologyId,ver); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | //(4级)æ°å¢-->åå· |
| | | @Override |
| | | public void addSpecifications(SpecificationsDto specificationsDto) { |
| | | public String addSpecifications(SpecificationsDto specificationsDto) { |
| | | //æ ¡éªæ·»å 该æ åä¸çåå·æ¯å¦éå¤ |
| | | List<String> specificationsNameList = specificationsMapper.selectList(Wrappers.<Specifications>query().eq("standard_id", specificationsDto.getId())).stream().map(specifications -> { |
| | | String specificationsName = specifications.getName(); |
| | | return specificationsName; |
| | | }).collect(Collectors.toList()); |
| | | if (specificationsNameList.contains(specificationsDto.getSpecifications())){ |
| | | return "该æ åä¸æè¯¥åå·"; |
| | | } |
| | | /*æ°å¢åå·è¡¨*/ |
| | | Specifications specifications = new Specifications(); |
| | | specifications.setStandardId(specificationsDto.getId()); |
| | |
| | | } |
| | | } |
| | | techniqueService.saveBatch(techniqueList); |
| | | return "æ·»å åå·ã"+ specificationsDto.getSpecifications() +"ãæåï¼"; |
| | | } |
| | | |
| | | /** |
| | |
| | | //(3级)æ°å¢-->æ å,åå· |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void addStandard(StandardDto standardDto) { |
| | | public String addStandard(StandardDto standardDto) { |
| | | //æ ¡éªæ·»å è¯¥ç©æä¸çæ 忝å¦éå¤ |
| | | List<String> standNameList = standardMapper.selectList(Wrappers.<Standard>query().eq("material_id", standardDto.getId())).stream().map(standard -> { |
| | | String standardName = standard.getName(); |
| | | return standardName; |
| | | }).collect(Collectors.toList()); |
| | | if (standNameList.contains(standardDto.getStandard())){ |
| | | return "该产åä¸æè¯¥æ å"; |
| | | } |
| | | /*æ°å¢æ å表*/ |
| | | Standard standard = new Standard(); |
| | | standard.setMaterial_id(standardDto.getId()); |
| | |
| | | } |
| | | } |
| | | techniqueService.saveBatch(techniqueList); |
| | | return "æ·»å æ åã"+ standardDto.getStandard() +"ãæåï¼"; |
| | | } |
| | | } |
| | | |
| | |
| | | where standard.state = 1 |
| | | and standard.id = #{id}) |
| | | </select> |
| | | <!--æ ¹æ®ç©æåç§°æ¥è¯¢æå产åç¼å·--> |
| | | <select id="selMcode" resultType="java.lang.String"> |
| | | select code |
| | | from mom_ocean.material |
| | | where state = 1 |
| | | and type = 1 |
| | | and name = #{name} |
| | | </select> |
| | | </mapper> |
| | |
| | | where technology.state = 1 |
| | | and specifications_id = #{specificationsId}) |
| | | </select> |
| | | <!--æ¥è¯¢æ åBOMææ¯ææ ä¸è¯¥åå·å·¥èºä¸ææ°çæ¬çæ£éªé¡¹ç®--> |
| | | <select id="selProByVerSpe" resultType="com.yuanchu.mom.pojo.Product"> |
| | | select * |
| | | from mom_ocean.product |
| | | where state = 1 |
| | | and version = #{ver} |
| | | and technology_id = #{technologyId} |
| | | </select> |
| | | |
| | | <!--æ ¹æ®å·¥èºè·¯çº¿idå é¤--> |
| | | <update id="delProByTecId"> |
| | |
| | | where technology.state = 1 |
| | | and specifications_id = #{specificationsId}) |
| | | </select> |
| | | <!--æ ¹æ®å·¥èºè·¯çº¿idæ¥è¯¢ææçæ¬--> |
| | | <select id="selectVerByTeId" resultType="java.lang.Integer"> |
| | | select distinct version |
| | | from mom_ocean.technique |
| | | where state = 1 |
| | | and technology_id = #{technologyId} |
| | | </select> |
| | | |
| | | <!--æ¥è¯¢è¯¥å·¥èºä¸ææ°çæ¬å¨ä¸ä¸ªæ£éªé¡¹ç®ä¸å¯ä»¥ä½¿ç¨åªäºè®¾å¤--> |
| | | <select id="selDevByVerTecIdFaNam" resultType="java.util.Map"> |
| | | select device.id, device |
| | | from mom_ocean.technique |
| | | left join mom_ocean.device on name = device |
| | | where technique.state = 1 |
| | | and technology_id = #{technologyId} |
| | | and product_father = #{father} |
| | | and product = #{name} |
| | | and version = #{ver} |
| | | </select> |
| | | |
| | | <!--æ ¹æ®å·¥èºè·¯çº¿idå é¤ç产工èº--> |
| | | <update id="delTeqByTecId"> |
| | |
| | | where state = 1 |
| | | and specifications_id = #{specificationsId} |
| | | </select> |
| | | <!--æ¥è¯¢è¯¥åå·å·¥èºä¸ææ°çæ¬çå·¥èºid--> |
| | | <select id="selTech" resultType="java.lang.Integer"> |
| | | select id |
| | | from mom_ocean.technology |
| | | where state = 1 |
| | | and father = #{techfather} |
| | | and name = #{techname} |
| | | and specifications_id = #{specificationId} |
| | | and version = #{version} |
| | | </select> |
| | | |
| | | <!--æ¹éå é¤--> |
| | | <update id="delAllTech"> |
| | |
| | | datasource: |
| | | type: com.alibaba.druid.pool.DruidDataSource |
| | | driverClassName: com.mysql.cj.jdbc.Driver |
| | | url: jdbc:mysql://192.168.73.113:3306/mom_ocean?useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8 |
| | | url: jdbc:mysql://192.168.65.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.73.113 |
| | | host: 192.168.65.113 |
| | | # redis端å£ï¼é»è®¤ä¸º6379ï¼ |
| | | port: 6379 |
| | | # redis访é®å¯ç ï¼é»è®¤ä¸ºç©ºï¼ |
| | |
| | | /*夿æ¯å¦ç»å½æå*/ |
| | | User selectUserByPwd(String account, String password); |
| | | |
| | | //æ ¹æ®ç¨æ·idæ¥è¯¢ç¨æ·å |
| | | String selectNameById(Integer id); |
| | | |
| | | |
| | | /** |
| | | * æ£éªæ¨¡å-->QMS管ç-->æåæ£éª-->æ°å¢(éè¦ç¨æ·Idä¸åç§°) |
| | |
| | | return list.size()>0?list.get(0):null; |
| | | } |
| | | |
| | | //æ ¹æ®ç¨æ·idæ¥è¯¢ç¨æ·å |
| | | @Override |
| | | public String selectNameById(Integer id) { |
| | | User user = userMapper.selectById(id); |
| | | return user.getName(); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> listUserIdAndName() { |
| | | LambdaQueryWrapper<User> wrapper = new LambdaQueryWrapper<>(); |