已修改16个文件
已重命名2个文件
已删除13个文件
已添加4个文件
| | |
| | | list.forEach(a-> { |
| | | InspectionProductList inspectionProductList = new InspectionProductList(); |
| | | inspectionProductList.setName(a.getName()) |
| | | .setMethod(a.getMethod()) |
| | | .setUnit(a.getUnit()) |
| | | .setRequired(a.getRequired()) |
| | | .setInternal(a.getInternal()) |
| | |
| | | |
| | | |
| | | import com.yuanchu.limslaboratory.pojo.Material; |
| | | import com.yuanchu.limslaboratory.pojo.dto.UpdateMaterialInformation; |
| | | import com.yuanchu.limslaboratory.service.MaterialService; |
| | | import com.yuanchu.limslaboratory.utils.JackSonUtil; |
| | | import com.yuanchu.limslaboratory.utils.RedisUtil; |
| | | import com.yuanchu.limslaboratory.vo.Result; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2023-07-17 |
| | | */ |
| | | @Api(tags = "æ ååº-->4ãè§æ ¼-->æ¥ç-->ç¶æ¨¡å") |
| | | @Api(tags = "æ ååº-->1ãç©æ") |
| | | @RestController |
| | | @RequestMapping("/material") |
| | | public class MaterialController { |
| | |
| | | @ApiOperation("æ·»å ç©æ") |
| | | @PostMapping("/add") |
| | | public Result<?> addMaterialInformation(@RequestBody Material material) { |
| | | Integer isMaterialSuccess = materialService.addMaterialInformation(material); |
| | | Integer isMaterialSuccess = null; |
| | | if (isMaterialSuccess == 1) { |
| | | return Result.success("æ·»å ç©æã"+ material.getName() +"ãæåï¼"); |
| | | } |
| | | return Result.fail("æ·»å ç©æã"+ material.getName() +"ã失败ï¼"); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®è§æ ¼IDæ¥è¯¢ææç©æ") |
| | | @GetMapping("/list") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(value = "è§æ ¼ID", name = "specificationsId", dataTypeClass = String.class) |
| | | }) |
| | | public Result<?> getListMaterialInformation(String specificationsId) { |
| | | List<Map<String, Object>> listMaterialInformation = materialService.getListMaterialInformation(specificationsId); |
| | | return Result.success(listMaterialInformation); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®ç©æIDæ¥è¯¢ç©æè¯¦æ
") |
| | | @GetMapping("/list_id") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(value = "ç©æID", name = "materialId", dataTypeClass = String.class) |
| | | }) |
| | | public Result<?> getListIdMaterialInformation(String materialId) throws Exception { |
| | | Material listIdMaterialInformation = materialService.ListIdMaterialInformation(materialId); |
| | | return Result.success(listIdMaterialInformation); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®ç©æIDå é¤ç©æ") |
| | |
| | | return Result.success("å 餿åï¼"); |
| | | } |
| | | return Result.fail("å é¤å¤±è´¥ï¼"); |
| | | } |
| | | |
| | | @ApiOperation("ä¿®æ¹ç©æ") |
| | | @PutMapping("/update") |
| | | public Result<?> updateMaterialInformation(@RequestBody UpdateMaterialInformation updateMaterialInformation) throws Exception { |
| | | Material material = JackSonUtil.unmarshal(JackSonUtil.marshal(updateMaterialInformation), Material.class); |
| | | Integer isUpdateMaterialSuccess = materialService.updateMaterialInformation(material); |
| | | if (isUpdateMaterialSuccess == 1) { |
| | | return Result.success("ä¿®æ¹ç©æã"+ material.getName() +"ãæåï¼"); |
| | | } |
| | | return Result.fail("ä¿®æ¹ç©æã"+ material.getName() +"ã失败ï¼"); |
| | | } |
| | | } |
| | |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2023-07-17 |
| | | */ |
| | | @Api(tags = "æ ååº-->5ãè§æ ¼-->æ¥ç-->忍¡å") |
| | | @Api(tags = "æ ååº-->4ã项ç®") |
| | | @RestController |
| | | @RequestMapping("/product") |
| | | public class ProductController { |
| | | |
| | | @Autowired |
| | | private ProductService productService; |
| | | |
| | | @ApiOperation("æ·»å æµè¯æ å") |
| | | @PostMapping("/add") |
| | | public Result<?> addProductInformation(@RequestHeader("X-Token") String token, @RequestBody Product product) throws Exception { |
| | | Object userMessage = RedisUtil.get(token); |
| | | if (!ObjectUtils.isEmpty(userMessage)){ |
| | | Map<String, Object> unmarshal = JackSonUtil.unmarshal(JackSonUtil.marshal(userMessage), Map.class); |
| | | product.setUserId(Integer.parseInt(unmarshal.get("id").toString())); |
| | | } else { |
| | | return Result.fail("对ä¸èµ·ï¼Tokené误!"); |
| | | } |
| | | Integer isProductSuccess = productService.addProductInformation(product); |
| | | if (isProductSuccess == 1) { |
| | | return Result.success("æ·»å ç©æã"+ product.getName() +"ãæåï¼"); |
| | | } |
| | | return Result.fail("æ·»å ç©æã"+ product.getName() +"ã失败ï¼"); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®ç©æIDæ¥è¯¢æææµè¯æ å") |
| | | @GetMapping("/list") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(value = "ç©æID", name = "materialId", dataTypeClass = String.class) |
| | | }) |
| | | public Result<?> getListProductInformation(String materialId) { |
| | | List<Map<String, Object>> listMaterialInformation = productService.getListProductInformation(materialId); |
| | | return Result.success(listMaterialInformation); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®æµè¯æ åIDæ¥è¯¢åºæ¬ä¿¡æ¯") |
| | | @GetMapping("/productId") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(value = "æµè¯æ åID", name = "productId", dataTypeClass = String.class) |
| | | }) |
| | | public Result<?> getProductInformation(Integer productId) { |
| | | Map<String, Object> productInformation = productService.getProductInformation(productId); |
| | | return Result.success(productInformation); |
| | | } |
| | | |
| | | @ApiOperation("å 餿µè¯æ 忍¡åæ°æ®") |
| | | @DeleteMapping("/delete") |
| | |
| | | return Result.success("å 餿åï¼"); |
| | | } |
| | | return Result.fail("å é¤å¤±è´¥ï¼"); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®æµè¯æ åIdä¿®æ¹æ°æ®") |
| | | @PutMapping("/update") |
| | | public Result<?> updateMaterialInformation(@RequestBody Product product) { |
| | | Integer isUpdateMaterialSuccess = productService.updateMaterialInformation(product); |
| | | if (isUpdateMaterialSuccess == 1) { |
| | | return Result.success("ä¿®æ¹ã"+ product.getName() +"ãæåï¼"); |
| | | } |
| | | return Result.fail("ä¿®æ¹ã"+ product.getName() +"ã失败ï¼"); |
| | | } |
| | | } |
| | |
| | | package com.yuanchu.limslaboratory.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.limslaboratory.pojo.Specifications; |
| | | import com.yuanchu.limslaboratory.service.SpecificationsService; |
| | | import com.yuanchu.limslaboratory.utils.JackSonUtil; |
| | | import com.yuanchu.limslaboratory.utils.RedisUtil; |
| | | import com.yuanchu.limslaboratory.vo.Result; |
| | | import com.yuanchu.limslaboratory.pojo.dto.UpdateSpeStateSpecificationsDto; |
| | | import com.yuanchu.limslaboratory.pojo.dto.UpdateSpecificationsInformationDto; |
| | | 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.util.ObjectUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2023-07-11 |
| | | */ |
| | | @Api(tags = "æ ååº-->3ãåå·-->产åè§æ ¼") |
| | | @Api(tags = "æ ååº-->3ã产åè§æ ¼") |
| | | @RestController |
| | | @RequestMapping("/specifications") |
| | | public class SpecificationsController { |
| | | |
| | | @Autowired |
| | | private SpecificationsService specificationsService; |
| | | |
| | | @ApiOperation("æ·»å 产åè§æ ¼") |
| | | @PostMapping("/add") |
| | | public Result<?> addSpecificationsInformation(@RequestHeader("X-Token") String token,@RequestBody Specifications specifications) throws Exception { |
| | | Object object = RedisUtil.get(token); |
| | | Map<String, Object> unmarshal = JackSonUtil.unmarshal(JackSonUtil.marshal(object), Map.class); |
| | | specifications.setUserId((Integer) unmarshal.get("id")); |
| | | Integer isStandardsSuccess = specificationsService.addSpecificationsInformation(specifications); |
| | | if (isStandardsSuccess == 1) { |
| | | return Result.success("æ·»å ã"+ specifications.getName() +"ãæåï¼"); |
| | | } |
| | | return Result.fail("æ·»å ã"+ specifications.getName() +"ã失败ï¼"); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®åå·æ¥è¯¢äº§åè§æ ¼") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "pageNo", value = "èµ·å§é¡µ", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "pageSize", value = "æ¯ä¸é¡µæ°é", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "specificationsName", value = "è§æ ¼åç§°", dataTypeClass = String.class), |
| | | @ApiImplicitParam(name = "serialNumberId", value = "åå·ID", dataTypeClass = String.class,required = true) |
| | | }) |
| | | @GetMapping("/list") |
| | | public Result<?> listSpecificationsInformation(Integer pageNo, |
| | | Integer pageSize, |
| | | String specificationsName, |
| | | String serialNumberId){ |
| | | IPage<Map<String, Objects>> pageList= specificationsService.listSpecificationsInformation(specificationsName,serialNumberId,new Page<Objects>(pageNo, pageSize)); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("row", pageList.getRecords()); |
| | | map.put("total", pageList.getTotal()); |
| | | return Result.success(map); |
| | | } |
| | | |
| | | @ApiOperation("ç¼è¾äº§åè§æ ¼") |
| | | @PutMapping("/update") |
| | | public Result<?> updateSpecificationsInformation(@RequestHeader("X-Token") String token, @RequestBody UpdateSpecificationsInformationDto updateSpecificationsInformationDto) throws Exception { |
| | | Object object = RedisUtil.get(token); |
| | | if (ObjectUtils.isEmpty(object)){ |
| | | return Result.fail("对ä¸èµ·ï¼è¯·æºå¸¦Token!"); |
| | | } |
| | | Map<String, Object> unmarshal = JackSonUtil.unmarshal(JackSonUtil.marshal(object), Map.class); |
| | | updateSpecificationsInformationDto.setUserId((Integer) unmarshal.get("id")); |
| | | Specifications specifications = JackSonUtil.unmarshal(JackSonUtil.marshal(updateSpecificationsInformationDto), Specifications.class); |
| | | Integer isStandardsSuccess = specificationsService.updateSpecificationsInformation(specifications); |
| | | if (isStandardsSuccess == 1) { |
| | | return Result.success("æ´æ°ã"+ specifications.getName() +"ãæåï¼"); |
| | | } |
| | | return Result.fail("æ´æ°ã"+ specifications.getName() +"ã失败ï¼"); |
| | | } |
| | | |
| | | @ApiOperation("å é¤äº§åè§æ ¼") |
| | | @ApiImplicitParams(value = { |
| | |
| | | return Result.success("å 餿åï¼"); |
| | | } |
| | | return Result.fail("å é¤å¤±è´¥ï¼"); |
| | | } |
| | | |
| | | @ApiOperation("æ´æ°è§æ ¼ç¶æ") |
| | | @PutMapping("/update_spe_state") |
| | | public Result<?> updateSpeStateSpecifications(@RequestBody UpdateSpeStateSpecificationsDto updateSpeStateSpecificationsDto) { |
| | | Integer isStandardsSuccess = specificationsService.updateSpeStateSpecifications(updateSpeStateSpecificationsDto); |
| | | if (isStandardsSuccess == 1) { |
| | | return Result.success("æä½æåï¼"); |
| | | } |
| | | return Result.fail("æä½å¤±è´¥ï¼"); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.controller; |
| | | |
| | | |
| | | import com.yuanchu.limslaboratory.service.StandardService; |
| | | import com.yuanchu.limslaboratory.vo.Result; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * <p> |
| | | * å端æ§å¶å¨ |
| | | * </p> |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2023-07-11 |
| | | */ |
| | | @Api(tags = "æ ååº-->2ãæ å") |
| | | @RestController |
| | | @RequestMapping("/standards") |
| | | public class StandardController { |
| | | |
| | | @Autowired |
| | | private StandardService standardService; |
| | | |
| | | @ApiOperation("æ ¹æ®IDå 餿°æ®") |
| | | @DeleteMapping("/delete") |
| | | public Result<?> deleteStandardsInformation(String standardsId) { |
| | | Integer isDeleteSuccess = standardService.deleteStandardsInformation(standardsId); |
| | | if (isDeleteSuccess == 1){ |
| | | return Result.success("å 餿åï¼"); |
| | | } |
| | | return Result.fail("å é¤å¤±è´¥ï¼"); |
| | | } |
| | | } |
ÎļþÃû´Ó standard-server/src/main/java/com/yuanchu/limslaboratory/mapper/StandardsMapper.java ÐÞ¸Ä |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.limslaboratory.pojo.Standards; |
| | | import com.yuanchu.limslaboratory.pojo.Standard; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2023-07-11 |
| | | */ |
| | | public interface StandardsMapper extends BaseMapper<Standards> { |
| | | public interface StandardMapper extends BaseMapper<Standard> { |
| | | |
| | | IPage<Map<String, Object>> listPageStandardsInformation(Page<Object> page, String idOrNameOfStandards); |
| | | } |
| | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.FieldFill; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "ç©æid", example = "152453211563212", required = true) |
| | | @ApiModelProperty(value = "ç©æid", hidden = true) |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private String id; |
| | | |
| | | @ApiModelProperty(value = "ç©æç¼ç ", example = "152453211563212", required = true) |
| | | private String code; |
| | | |
| | | @ApiModelProperty(value = "ç©æåç§°", example = "ç³å¤´", required = true) |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "ä¾åºå", example = "ç¾åº¦", required = true) |
| | | private String supplier; |
| | | |
| | | @ApiModelProperty(value = "ç©æåæ¾å°", example = "ä»åºä¸ï¼äºå·æ¶", required = true) |
| | | private String location; |
| | | |
| | | @ApiModelProperty(value = "ç©ææ°é", example = "200", required = true) |
| | | private Integer num; |
| | | |
| | | @ApiModelProperty(value = "æ¹æ¬¡", example = "1", required = true) |
| | | private String batch; |
| | | |
| | | @ApiModelProperty(value = "çå·", example = "152453211563212", required = true) |
| | | private String reelNumber; |
| | | @ApiModelProperty(value = "0ï¼åææï¼1ï¼æåï¼2ï¼åæå", example = "1", required = true) |
| | | private Integer type; |
| | | |
| | | @TableLogic(value = "1", delval = "0") |
| | | @ApiModelProperty(value = "é»è¾å é¤ æ£å¸¸>=1,å é¤<=0", hidden = true) |
| | |
| | | |
| | | @ApiModelProperty(value = "ä¹è§é", hidden = true) |
| | | private Integer version; |
| | | |
| | | @ApiModelProperty(value = "å
³è è§æ ¼id", example = "1", required = true) |
| | | private Integer specificationsId; |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "æµè¯æ ååç§°", example = "åä½é¿åº¦è´¨é", required = true) |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "è¯éªæ¹æ³", example = "--", required = true) |
| | | private String method; |
| | | |
| | | @ApiModelProperty(value = "æµè¯æ åç¶ç±»", example = "éå
é¢è¯éç»çº¿") |
| | | private String father; |
| | | |
| | | @ApiModelProperty(value = "åä½", example = "km", required = true) |
| | | private String unit; |
| | | |
| | | @ApiModelProperty(value = "ææ äººè¦æ±å¼", example = "<=0.3458", required = true) |
| | | @ApiModelProperty(value = "æ åå¼", example = "<=0.3458", required = true) |
| | | private String required; |
| | | |
| | | @ApiModelProperty(value = "å
æ§å¼", example = "<=0.3458", required = true) |
| | |
| | | @ApiModelProperty(value = "ä¹è§é", hidden = true) |
| | | private Integer version; |
| | | |
| | | @ApiModelProperty(value = "å
³è ç¨æ·id", hidden = true) |
| | | private Integer userId; |
| | | |
| | | @ApiModelProperty(value = "å
³è ç©æid", example = "152453211563212", required = true) |
| | | private String materialId; |
| | | @ApiModelProperty(value = "å
³è ç©æid", example = "1", hidden = true) |
| | | private Integer specifications_id; |
| | | |
| | | |
| | | } |
| | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "è§æ ¼ç¼å·", example = "modelId", required = true) |
| | | private String number; |
| | | |
| | | @ApiModelProperty(value = "产åè§æ ¼åç§°", example = "AB", required = true) |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "ç产æä»¤å·", example = "test", required = true) |
| | | private String instruct; |
| | | |
| | | @ApiModelProperty(value = "çµåç级", example = "test", required = true) |
| | | private String voltageLevel; |
| | | |
| | | @ApiModelProperty(value = "ä¸»çº¿å¿æªé¢", example = "test", required = true) |
| | | private String crossSection; |
| | | |
| | | @ApiModelProperty(value = "主线è¯è¯æ°", example = "test", required = true) |
| | | private String numberOfCores; |
| | | |
| | | @ApiModelProperty(value = "è§æ ¼ç¶æ 0ï¼åç¨ï¼1ï¼æ£å¸¸ï¼-1ï¼è稿", hidden = true) |
| | | private Integer spe_state; |
| | | |
| | | @ApiModelProperty(value = "é»è¾å é¤ æ£å¸¸>=1,å é¤<=0", hidden = true) |
| | | @TableLogic(value = "1", delval = "0") |
| | |
| | | @Version |
| | | private Integer version; |
| | | |
| | | @ApiModelProperty(value = "å
³èåæ®µ åå·id", hidden = true) |
| | | private String vel; |
| | | |
| | | @ApiModelProperty(value = "å
³èåæ®µ åå·id", example = "230711000002", required = true) |
| | | private String serialId; |
| | | |
| | | @ApiModelProperty(value = "å
³èåæ®µ ç¨æ·id", hidden = true) |
| | | private Integer userId; |
| | | private Integer standardId; |
| | | |
| | | } |
ÎļþÃû´Ó standard-server/src/main/java/com/yuanchu/limslaboratory/pojo/Standards.java ÐÞ¸Ä |
| | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @ApiModel(value="Standards对象", description="æ å") |
| | | public class Standards implements Serializable { |
| | | public class Standard implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "æ åç¼å· yyMMdd000001(000001++)", example = "230711000001", required = true) |
| | | @TableId(value = "id", type = IdType.INPUT) |
| | | private String id; |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "æ ååç§°", example = "å
纤", required = true) |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "è±æåç§°", example = "OpticalFibre", required = true) |
| | | private String engName; |
| | | |
| | | @ApiModelProperty(value = "0ï¼åææï¼1ï¼çµçº¿çµç¼", example = "1", required = true) |
| | | private Integer type; |
| | | |
| | | @TableLogic(value = "1", delval = "0") |
| | | @ApiModelProperty(value = "é»è¾å é¤ æ£å¸¸>=1,å é¤<=0", hidden = true) |
| | |
| | | @Version |
| | | private Integer version; |
| | | |
| | | @ApiModelProperty(value = "å
³èåæ®µ æ´æ°äººid", hidden = true) |
| | | private Integer userId; |
| | | |
| | | @ApiModelProperty(value = "ç©æId", hidden = true) |
| | | private Integer materialId; |
| | | |
| | | } |
| | |
| | | |
| | | import com.yuanchu.limslaboratory.pojo.Material; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yuanchu.limslaboratory.pojo.dto.UpdateMaterialInformation; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | * @since 2023-07-17 |
| | | */ |
| | | public interface MaterialService extends IService<Material> { |
| | | |
| | | List<Material> selectMaterialLimit(int pageSize,int countSize); |
| | | |
| | | Integer addMaterialInformation(Material material); |
| | | |
| | | /** |
| | | * ä¾§è¾¹æ ç©ææ°æ® |
| | | * @param specificationsId |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> getListMaterialInformation(String specificationsId); |
| | | Map selectMaterialById(String materialId); |
| | | |
| | | /** |
| | | * å é¤çäºMaterialIdçæ°æ® |
| | |
| | | Integer deleteMaterialInformation(String materialId); |
| | | |
| | | /** |
| | | * æ´æ°Materialçæ°æ® |
| | | * @param material |
| | | * @return |
| | | */ |
| | | Integer updateMaterialInformation(Material material); |
| | | |
| | | /** |
| | | * å é¤çäºSpecificationsIdçç©ææ°æ® |
| | | * @param deleteSpecificationsId |
| | | * @return |
| | | */ |
| | | List<String> specificationsIdDeleteMaterial(List<Integer> deleteSpecificationsId); |
| | | |
| | | Map selectMaterialById(String materialId); |
| | | |
| | | /** |
| | | * æ ¹æ®Idæ¥è¯¢è§æ ¼è¯¦æ
|
| | | * @param materialId |
| | | * @return |
| | | */ |
| | | Material ListIdMaterialInformation(String materialId) throws Exception; |
| | | } |
| | |
| | | * @since 2023-07-17 |
| | | */ |
| | | public interface ProductService extends IService<Product> { |
| | | |
| | | /*éè¿ç©æidè·åç©æä¿¡åä¸å±ç项ç®å表*/ |
| | | List<Product> selectProductByMaterialId(String materialId); |
| | | |
| | | Integer addProductInformation(Product product); |
| | | |
| | | List<Map<String, Object>> getListProductInformation(String materialId); |
| | | |
| | | Map<String, Object> getProductInformation(Integer productId); |
| | | |
| | | Integer deleteProductInformation(Integer productId); |
| | | |
| | | void MaterialIdDeleteProduct(List<String> deleteMaterialId); |
| | | |
| | | Integer updateMaterialInformation(Product product); |
| | | } |
| | |
| | | package com.yuanchu.limslaboratory.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.limslaboratory.pojo.Specifications; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yuanchu.limslaboratory.pojo.dto.UpdateSpeStateSpecificationsDto; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @since 2023-07-11 |
| | | */ |
| | | public interface SpecificationsService extends IService<Specifications> { |
| | | |
| | | Integer addSpecificationsInformation(Specifications specifications); |
| | | |
| | | Map<String,Object> selectSNameSNName(int materialId); |
| | | |
| | | IPage<Map<String, Objects>> listSpecificationsInformation(String specificationsName, String serialNumberId, Page<Objects> page); |
| | | |
| | | Integer updateSpecificationsInformation(Specifications specifications); |
| | | |
| | | /** |
| | | * å¤è¡¨å é¤ï¼è¡¨æ ¼å嫿ï¼Specification --> Material --> Product |
| | | * @param specificationsId |
| | |
| | | Integer deleteSpecifications(Integer specificationsId); |
| | | |
| | | List<Integer> SerialNumberIdDeleteSpecifications(List<String> deleteSerialNumberId); |
| | | |
| | | Integer updateSpeStateSpecifications(UpdateSpeStateSpecificationsDto updateSpeStateSpecificationsDto); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.service; |
| | | |
| | | import com.yuanchu.limslaboratory.pojo.Standard; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | /** |
| | | * <p> |
| | | * æå¡ç±» |
| | | * </p> |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2023-07-11 |
| | | */ |
| | | public interface StandardService extends IService<Standard> { |
| | | |
| | | /** |
| | | * æ ¹æ®æ åIdå 餿°æ® |
| | | * @param standardsId |
| | | * @return |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | Integer deleteStandardsInformation(String standardsId); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.yuanchu.limslaboratory.pojo.Material; |
| | | import com.yuanchu.limslaboratory.mapper.MaterialMapper; |
| | | import com.yuanchu.limslaboratory.pojo.Specifications; |
| | | import com.yuanchu.limslaboratory.pojo.dto.UpdateMaterialInformation; |
| | | import com.yuanchu.limslaboratory.service.MaterialService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.yuanchu.limslaboratory.service.ProductService; |
| | | import com.yuanchu.limslaboratory.utils.JackSonUtil; |
| | | import com.yuanchu.limslaboratory.utils.MyUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.ObjectUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | |
| | | return materialMapper.selectMaterialById(materialId); |
| | | } |
| | | |
| | | @Override |
| | | public Material ListIdMaterialInformation(String materialId) { |
| | | LambdaQueryWrapper<Material> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(Material::getId, materialId); |
| | | wrapper.select(Material::getId, Material::getName, Material::getSupplier, Material::getLocation, Material::getNum, Material::getBatch, |
| | | Material::getReelNumber); |
| | | return materialMapper.selectOne(wrapper); |
| | | } |
| | | |
| | | @Autowired |
| | | private ProductService productService; |
| | | |
| | | @Override |
| | | public Integer addMaterialInformation(Material material) { |
| | | return materialMapper.insert(material); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> getListMaterialInformation(String specificationsId) { |
| | | LambdaQueryWrapper<Material> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(Material::getSpecificationsId, specificationsId); |
| | | wrapper.select(Material::getId, Material::getName); |
| | | return materialMapper.selectMaps(wrapper); |
| | | } |
| | | |
| | | @Override |
| | | public Integer deleteMaterialInformation(String materialId) { |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Integer updateMaterialInformation(Material material) { |
| | | LambdaUpdateWrapper<Material> updateWrapper = new LambdaUpdateWrapper<>(); |
| | | updateWrapper.eq(Material::getId, material.getId()); |
| | | materialMapper.updateById(material); |
| | | return materialMapper.update(material, updateWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public List<String> specificationsIdDeleteMaterial(List<Integer> deleteSpecificationsId) { |
| | | List<String> list = new ArrayList<>(); |
| | | for (Integer serialNumberId:deleteSpecificationsId){ |
| | | LambdaQueryWrapper<Material> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(Material::getSpecificationsId, serialNumberId); |
| | | wrapper.select(Material::getId); |
| | | List<Material> maps1 = materialMapper.selectList(wrapper); |
| | | for (Material material:maps1){ |
| | |
| | | private ProductMapper productMapper; |
| | | |
| | | @Override |
| | | public List<Product> selectProductByMaterialId(String materialId) { |
| | | return productMapper.selectProductByMaterialId(materialId); |
| | | } |
| | | |
| | | @Autowired |
| | | private UserService userService; |
| | | |
| | | @Override |
| | | public Integer addProductInformation(Product product) { |
| | | return productMapper.insert(product); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> getListProductInformation(String materialId) { |
| | | LambdaQueryWrapper<Product> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(Product::getMaterialId, materialId); |
| | | wrapper.select(Product::getId, Product::getName, Product::getFather); |
| | | wrapper.groupBy(Product::getFather); |
| | | List<Map<String, Object>> products = productMapper.selectMaps(wrapper); |
| | | for (Map<String, Object> product:products){ |
| | | if (!ObjectUtils.isEmpty(product.get("father"))){ |
| | | product.remove("name"); |
| | | product.remove("id"); |
| | | LambdaQueryWrapper<Product> wrapper1 = new LambdaQueryWrapper<>(); |
| | | wrapper1.eq(Product::getFather, product.get("father")); |
| | | wrapper1.select(Product::getId, Product::getName); |
| | | List<Map<String, Object>> maps = productMapper.selectMaps(wrapper1); |
| | | product.put("sonProduct", maps); |
| | | } |
| | | } |
| | | for (Map<String, Object> product:products){ |
| | | System.out.println(product); |
| | | } |
| | | return products; |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, Object> getProductInformation(Integer productId) { |
| | | Map<String, Object> productMap = productMapper.getProductInformation(productId); |
| | | String userName = userService.selectByUserId((Integer) productMap.get("user_id")); |
| | | productMap.remove("user_id"); |
| | | productMap.put("userName", userName); |
| | | return productMap; |
| | | } |
| | | |
| | | @Override |
| | | public Integer deleteProductInformation(Integer productId) { |
| | | LambdaUpdateWrapper<Product> wrapper = new LambdaUpdateWrapper<>(); |
| | | wrapper.eq(Product::getId, productId); |
| | |
| | | public void MaterialIdDeleteProduct(List<String> deleteMaterialId) { |
| | | for (String materialId : deleteMaterialId){ |
| | | LambdaUpdateWrapper<Product> wrapper = new LambdaUpdateWrapper<>(); |
| | | wrapper.eq(Product::getMaterialId, materialId); |
| | | wrapper.eq(Product::getId, materialId); |
| | | wrapper.set(Product::getState, 0); |
| | | productMapper.update(new Product(), wrapper); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public Integer updateMaterialInformation(Product product) { |
| | | LambdaUpdateWrapper<Product> updateWrapper = new LambdaUpdateWrapper<>(); |
| | | updateWrapper.eq(Product::getId, product.getId()); |
| | | return productMapper.update(product, updateWrapper); |
| | | } |
| | | } |
| | |
| | | |
| | | 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.extension.plugins.pagination.Page; |
| | | import com.yuanchu.limslaboratory.pojo.Specifications; |
| | | import com.yuanchu.limslaboratory.mapper.SpecificationsMapper; |
| | | import com.yuanchu.limslaboratory.service.*; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.yuanchu.limslaboratory.pojo.dto.UpdateSpeStateSpecificationsDto; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.ObjectUtils; |
| | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | private SpecificationsMapper specificationsMapper; |
| | | |
| | | @Autowired |
| | | private StandardsService standardsService; |
| | | |
| | | @Autowired |
| | | private UserService userService; |
| | | |
| | | @Autowired |
| | | private MaterialService materialService; |
| | | |
| | | @Autowired |
| | | private ProductService productService; |
| | | |
| | | @Override |
| | | public Integer addSpecificationsInformation(Specifications specifications) { |
| | | Boolean userIsNull = userService.userIsNull(specifications.getUserId()); |
| | | if (userIsNull){ |
| | | Boolean standardsIsNull = standardsService.standardsIsNull(specifications.getSerialId()); |
| | | if (!ObjectUtils.isEmpty(standardsIsNull)){ |
| | | LambdaQueryWrapper<Specifications> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(Specifications::getNumber, specifications.getNumber()); |
| | | Specifications specificationsNumberIsNull = specificationsMapper.selectOne(wrapper); |
| | | if (ObjectUtils.isEmpty(specificationsNumberIsNull)){ |
| | | return specificationsMapper.insert(specifications); |
| | | } |
| | | } |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | @Override |
| | | public IPage<Map<String, Objects>> listSpecificationsInformation(String specificationsName, String serialNumberId, Page<Objects> page) { |
| | | return specificationsMapper.listSpecificationsInformation(specificationsName,serialNumberId,page); |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, Object> selectSNameSNName(int materialId) { |
| | | return specificationsMapper.selectSNameSNName(materialId); |
| | | } |
| | | |
| | | @Override |
| | | public Integer updateSpecificationsInformation(Specifications specifications) { |
| | | LambdaQueryWrapper<Specifications> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(Specifications::getId, specifications.getId()); |
| | | return specificationsMapper.update(specifications, wrapper); |
| | | } |
| | | |
| | | @Override |
| | | public Integer deleteSpecifications(Integer specificationsId) { |
| | |
| | | List<Integer> list = new ArrayList<>(); |
| | | for (String serialNumberId:deleteSerialNumberId){ |
| | | LambdaQueryWrapper<Specifications> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(Specifications::getSerialId, serialNumberId); |
| | | wrapper.eq(Specifications::getId, serialNumberId); |
| | | wrapper.select(Specifications::getId); |
| | | List<Specifications> maps1 = specificationsMapper.selectList(wrapper); |
| | | for (Specifications specifications:maps1){ |
| | |
| | | } |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | @Override |
| | | public Integer updateSpeStateSpecifications(UpdateSpeStateSpecificationsDto updateSpeStateSpecificationsDto) { |
| | | LambdaUpdateWrapper<Specifications> updateWrapper = new LambdaUpdateWrapper<>(); |
| | | updateWrapper.eq(Specifications::getId, updateSpeStateSpecificationsDto.getId()); |
| | | updateWrapper.set(Specifications::getSpe_state, updateSpeStateSpecificationsDto.getSpe_state()); |
| | | return specificationsMapper.update(new Specifications(), updateWrapper); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.yuanchu.limslaboratory.mapper.StandardMapper; |
| | | import com.yuanchu.limslaboratory.pojo.Standard; |
| | | import com.yuanchu.limslaboratory.service.*; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.ObjectUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * æå¡å®ç°ç±» |
| | | * </p> |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2023-07-11 |
| | | */ |
| | | @Service |
| | | public class StandardServiceImpl extends ServiceImpl<StandardMapper, Standard> implements StandardService { |
| | | |
| | | @Resource |
| | | private StandardMapper standardMapper; |
| | | |
| | | @Autowired |
| | | private UserService userService; |
| | | |
| | | @Lazy |
| | | @Autowired |
| | | private SpecificationsService specificationsService; |
| | | |
| | | @Autowired |
| | | private MaterialService materialService; |
| | | |
| | | @Autowired |
| | | private ProductService productService; |
| | | |
| | | |
| | | @Override |
| | | public Integer deleteStandardsInformation(String standardsId) { |
| | | LambdaUpdateWrapper<Standard> updateWrapper = new LambdaUpdateWrapper<>(); |
| | | updateWrapper.eq(Standard::getId, standardsId); |
| | | updateWrapper.set(Standard::getState, 0); |
| | | int isDeleteSuccess = standardMapper.update(new Standard(), updateWrapper); |
| | | if (isDeleteSuccess == 1){ |
| | | List<Integer> deleteSpecificationsId = specificationsService.SerialNumberIdDeleteSpecifications(null); |
| | | if (!ObjectUtils.isEmpty(deleteSpecificationsId)){ |
| | | List<String> deleteMaterialId = materialService.specificationsIdDeleteMaterial(deleteSpecificationsId); |
| | | if (!ObjectUtils.isEmpty(deleteMaterialId)){ |
| | | productService.MaterialIdDeleteProduct(deleteMaterialId); |
| | | } |
| | | } |
| | | return 1; |
| | | } |
| | | return 0; |
| | | } |
| | | } |
| | |
| | | from material |
| | | where state = 1 |
| | | order by create_time desc |
| | | limit #{num1},#{num2} |
| | | limit #{num1},#{num2} |
| | | </select> |
| | | <select id="selectMaterialById" resultType="java.util.Map"> |
| | | select m.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.limslaboratory.mapper.ProductMapper"> |
| | | <select id="selectProductByMaterialId" resultType="Product"> |
| | | select id, name, method, father, unit, required, internal |
| | | from product |
| | | where material_id = #{material_id} |
| | | and state = 1 |
| | | </select> |
| | | |
| | | <select id="getProductInformation" parameterType="integer" resultType="map"> |
| | | SELECT p.method, ifnull(null, p.father) projectClassification, p.user_id, date_format(p.update_time, '%Y-%m-%d %H:%i:%s') updateTime, |
| | | p.unit, p.required, p.internal |
| | | FROM product p |
| | | where p.id = #{productId} |
| | | </select> |
| | | </mapper> |
| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.yuanchu.limslaboratory.mapper.SpecificationsMapper"> |
| | | |
| | | <select id="listSpecificationsInformation" resultType="map"> |
| | | SELECT s.`id`,s.`name`,DATE_FORMAT(s.`update_time`, '%Y-%m-%d %H:%i') updateTime,u.`name` username,s.`vel`,s.`spe_state` |
| | | FROM specifications s,`user` u |
| | | WHERE s.`user_id` = u.`id` |
| | | AND s.`serial_id` = #{serialNumberId} |
| | | <if test="specificationsName != null"> |
| | | AND s.`name` = #{specificationsName} |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="selectSNameSNName" resultType="Map"> |
| | | select m.num,m.supplier,m.name m_name,m.location,m.batch,m.reel_number,concat(s.name,'/',sn.name) ss_name,s.voltage_level,s.cross_section,s.number_of_cores,s.instruct |
| | | from material m,specifications s,serial_number sn |
| | | where m.specifications_id = s.id |
| | | and s.serial_id = sn.id |
| | | and m.id = #{materialId} |
| | | order by s.create_time desc |
| | | limit 1 |
| | | </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.limslaboratory.mapper.StandardMapper"> |
| | | |
| | | </mapper> |