| | |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "éæ©åæææ¥æ£") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "åæææ¥æ£åid", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "startTime", value = "æ£éªå¼å§æ¥æ", dataTypeClass = String.class, required = true), |
| | | @ApiImplicitParam(name = "endTime", value = "æ£éªç»ææ¥æ", dataTypeClass = String.class, required = true) |
| | | }) |
| | | @GetMapping("/selectRawmaById") |
| | | public Result selectRawmaById(Integer id, String startTime, String endTime) throws ParseException { |
| | | return Result.success(rawMaterialService.selectRawmaById(id, startTime, endTime)); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "éæ©å§ææ¥æ£åæ ·å") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "bid", value = "å§ææ¥æ£åid", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "did", value = "å§ææ¥æ£æ ·åid", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | |
| | | |
| | | @GetMapping("/selectLinkByid") |
| | | public Result selectLinkByid(Integer bid, Integer did) { |
| | | return Result.success(linkBasicInformationService.selectLinkByid(bid, did)); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "æ°å¢æ£éªå") |
| | | @PostMapping("/addInspect") |
| | | public Result addInspect(@RequestHeader("token") String token, @RequestBody InspectionVo inspectionVo) throws Exception { |
| | |
| | | */ |
| | | List<Map<String, Object>> selectLinkAll(); |
| | | |
| | | /** |
| | | * 鿩姿ç³è¯·åæ ·å |
| | | * @param bid |
| | | * @param did |
| | | * @return |
| | | */ |
| | | InspectionVo selectLinkByid(Integer bid, Integer did); |
| | | |
| | | } |
| | |
| | | |
| | | List<RawMaterial> selectRawmaAll(); |
| | | |
| | | InspectionVo selectRawmaById(Integer id); |
| | | |
| | | } |
| | |
| | | */ |
| | | List<Map<String, Object>> selectLinkAll(); |
| | | |
| | | /** |
| | | * æ ¹æ®å§ææ£éªidåæ ·åidæ¥è¯¢å§ææ£éªåæ ·å |
| | | * @param bid |
| | | * @param did |
| | | * @return |
| | | */ |
| | | InspectionVo selectLinkByid(Integer bid, Integer did); |
| | | |
| | | } |
| | |
| | | */ |
| | | List<RawMaterial> selectRawmaAll(); |
| | | |
| | | /** |
| | | * éæ©åæææ¥æ£ |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | InspectionVo selectRawmaById(Integer id, String startTime, String endTime) throws ParseException; |
| | | |
| | | } |
| | |
| | | return linkBasicInformationMapper.selectLinkAll(); |
| | | } |
| | | |
| | | //æ ¹æ®å§ææ£éªidåæ ·åidæ¥è¯¢å§ææ£éªåæ ·å |
| | | @Override |
| | | public InspectionVo selectLinkByid(Integer bid, Integer did) { |
| | | InspectionVo inspectionVo = linkBasicInformationMapper.selectLinkByid(bid, did); |
| | | inspectionVo.setType(1); |
| | | return inspectionVo; |
| | | } |
| | | |
| | | } |
| | |
| | | return rawMaterialMapper.selectRawmaAll(); |
| | | } |
| | | |
| | | /** |
| | | * éæ©åæææ¥æ£ |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @Override |
| | | public InspectionVo selectRawmaById(Integer id, String startTime, String endTime) throws ParseException { |
| | | InspectionVo inspectionVo = rawMaterialMapper.selectRawmaById(id); |
| | | SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); |
| | | inspectionVo.setStartTime(formatter.parse(startTime)); |
| | | inspectionVo.setEndTime(formatter.parse(endTime)); |
| | | inspectionVo.setType(0); |
| | | return inspectionVo; |
| | | } |
| | | |
| | | } |
| | |
| | | <?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.LinkBasicInformationMapper"> |
| | | |
| | | <select id="getLinkBasicPage" resultType="map"> |
| | | SELECT l.`id`, l.`entrust_coding`, l.`entrusted`, d.`samples_number`, d.`sample_name`, d.`specifications_models`, |
| | | DATE_FORMAT(l.`inspection_time`,'%Y-%m-%d') inspectionTime, DATE_FORMAT(l.`completion_deadline`,'%Y-%m-%d') completionDeadline, l.`contacts`, |
| | | DATE_FORMAT(d.`date_survey`,'%Y-%m-%d') dateSurvey, d.`inspection_status` |
| | | SELECT l.`id`, l.`entrust_coding`, l.`entrusted`, d.`samples_number`, d.`sample_name`, |
| | | d.`specifications_models`, |
| | | DATE_FORMAT(l.`inspection_time`,'%Y-%m-%d') inspectionTime, DATE_FORMAT(l.`completion_deadline`,'%Y-%m-%d') |
| | | completionDeadline, l.`contacts`, |
| | | DATE_FORMAT(d.`date_survey`,'%Y-%m-%d') dateSurvey, d.`inspection_status` |
| | | FROM link_basic_information l, link_detection d |
| | | WHERE l.`id` = d.`link_basic_id` |
| | | AND l.`state` = 1 |
| | |
| | | </select> |
| | | |
| | | <select id="selectLinkAll" resultType="java.util.Map"> |
| | | SELECT l.`id`, l.`entrust_coding`, l.`entrusted`, d.`samples_number`, d.`sample_name`, d.`specifications_models`, |
| | | DATE_FORMAT(l.`inspection_time`,'%Y-%m-%d') inspectionTime, l.`completion_deadline`, l.`contacts`, d.`date_survey`, d.`inspection_status` |
| | | FROM lims_laboratory.link_basic_information l, lims_laboratory.link_detection d |
| | | WHERE l.`id` = d.`link_basic_id` |
| | | AND l.`state` = 1 |
| | | </select> |
| | | |
| | | <select id="selectLinkByid" resultType="com.yuanchu.limslaboratory.pojo.vo.InspectionVo"> |
| | | SELECT l.`inspection_time` formTime, |
| | | l.`entrusted` supplier, |
| | | d.`sample_number` mcode, |
| | | d.`sample_name` name, |
| | | d.`specifications_models` specifications, |
| | | d.`unit`, |
| | | d.`samples_number` num, |
| | | d.date_survey startTime, |
| | | l.completion_deadline endTime |
| | | FROM lims_laboratory.link_basic_information l, lims_laboratory.link_detection d |
| | | SELECT DATE_FORMAT(l.`inspection_time`,'%Y-%m-%d') formTime, |
| | | l.`entrusted` supplier, |
| | | d.`sample_number` mcode, |
| | | d.`sample_name` name, |
| | | d.`specifications_models` specifications, |
| | | d.`unit`, |
| | | d.`samples_number` num, |
| | | DATE_FORMAT(date_survey,'%Y-%m-%d') startTime, |
| | | DATE_FORMAT(completion_deadline,'%Y-%m-%d') endTime |
| | | FROM lims_laboratory.link_basic_information l, |
| | | lims_laboratory.link_detection d |
| | | WHERE l.`id` = d.`link_basic_id` |
| | | AND l.`state` = 1 |
| | | <if test="bid!=null"> |
| | | and l.id=#{bid} |
| | | </if> |
| | | <if test="did!=null"> |
| | | and d.id=#{did} |
| | | </if> |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | select * from lims_laboratory.raw_material where state=1 |
| | | </select> |
| | | |
| | | <select id="selectRawmaById" resultType="com.yuanchu.limslaboratory.pojo.vo.InspectionVo"> |
| | | select create_time formTime, |
| | | supplier_name supplier, |
| | | material_coding mcode, |
| | | material_name name, |
| | | specifications_models specifications, |
| | | unit , |
| | | quantity num |
| | | from lims_laboratory.raw_material |
| | | where id=#{id} |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | @Autowired |
| | | private MaterialService materialService; |
| | | |
| | | @ApiOperation("æ·»å ç©æ") |
| | | @ApiOperation(value = "æ·»å ææ -->éæ©æ ·ååç§°") |
| | | @GetMapping("/selectmater") |
| | | public Result selectmater() { |
| | | return Result.success(materialService.selectmater()); |
| | | } |
| | | |
| | | @ApiOperation("æ·»å ææ ") |
| | | @PostMapping("/add") |
| | | public Result<?> addMaterialInformation(@Validated @RequestBody AddMaterialDto addMaterialDto) { |
| | | Integer isMaterialSuccess = materialService.addMaterialInformation(addMaterialDto); |
| | |
| | | |
| | | /** |
| | | * <p> |
| | | * å端æ§å¶å¨ |
| | | * å端æ§å¶å¨ |
| | | * </p> |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | |
| | | @Autowired |
| | | private ProductService productService; |
| | | |
| | | @ApiOperation("1ãå页æ¥è¯¢é¡¹ç®") |
| | | @ApiOperation("æ¥è¯¢è¯¥åå·ä¸ç项ç®") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "pageNo", value = "èµ·å§é¡µ", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "pageSize", value = "æ¯ä¸é¡µæ°é", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "specificationsId", value = "è§æ ¼åå·ID", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(value = "åææç¼ç /åææåç§°", name = "productCodeOrName", dataTypeClass = String.class) |
| | | @ApiImplicitParam(name = "specificationsId", value = "åå·ID", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @GetMapping("/page") |
| | | public Result<?> pageProductInformation(Integer pageNo, Integer pageSize, Integer specificationsId, String productCodeOrName) { |
| | | IPage<Map<String, Object>> maps = productService.pageProductInformation(productCodeOrName, specificationsId, new Page<Objects>(pageNo, pageSize)); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("row", maps.getRecords()); |
| | | map.put("total", maps.getTotal()); |
| | | return Result.success(map); |
| | | public Result<?> pageProductInformation(Integer specificationsId) { |
| | | return Result.success(productService.pageProductInformation(specificationsId)); |
| | | } |
| | | |
| | | @ApiOperation("2ãæ ¹æ®ç¶ç±»æ¥åç±»") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(value = "ç¶ç±»åç§°", name = "fatherName", dataTypeClass = String.class) |
| | | }) |
| | | @GetMapping("/father") |
| | | public Result<?> pageFatherNameProductInformation(String fatherName) { |
| | | List<Map<String, Object>> maps = productService.pageFatherNameProductInformation(fatherName); |
| | | return Result.success(maps); |
| | | } |
| | | //@ApiOperation("å¡«åæ åå¼ä¸å
æ§å¼,é¼ æ ç§»å¼ä¿å") |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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.dto.AddMaterialDto; |
| | | import com.yuanchu.limslaboratory.pojo.dto.ProductModelDto; |
| | | import com.yuanchu.limslaboratory.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.limslaboratory.service.ProductModelService; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | |
| | | /** |
| | | * åºç¡é¡¹ç®æ¨¡ç表(ProductModel)表æ§å¶å± |
| | | * |
| | | * @author zss |
| | | * @since 2023-08-19 11:00:39 |
| | | */ |
| | | @Api(tags = "åºç¡æ°æ®-->æ åç»´æ¤") |
| | | @RestController |
| | | @RequestMapping("/productModel") |
| | | public class ProductModelController { |
| | | |
| | | @Autowired |
| | | private ProductModelService productModelService; |
| | | |
| | | @ApiOperation(value = "éæ©æ ·ååç§°") |
| | | @GetMapping("/selectmater") |
| | | public Result selectmater() { |
| | | return Result.success(productModelService.selectmater()); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ·»å æ å-->鿩项ç®åç»") |
| | | @GetMapping("/selectfather") |
| | | public Result selectfather() { |
| | | return Result.success(productModelService.selectfather()); |
| | | } |
| | | |
| | | @ApiOperation("æ·»å æ å") |
| | | @PostMapping("/addproductModel") |
| | | public Result<?> addproductModel(@Validated @RequestBody ProductModelDto productModelDto) { |
| | | productModelService.addproductModel(productModelDto); |
| | | return Result.success("æ·»å æ å项ç®ã" + productModelDto.getName() + "ãæåï¼"); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ¥è¯¢æ 忍¡çå表") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "name", value = "项ç®åç§°", dataTypeClass = String.class), |
| | | @ApiImplicitParam(name = "father", value = "项ç®åç»", dataTypeClass = String.class), |
| | | @ApiImplicitParam(name = "material", value = "æ ·ååç§°", dataTypeClass = String.class, required = true) |
| | | }) |
| | | @GetMapping("/selectproductModel") |
| | | public Result selectproductModel(String name, String father, String material) { |
| | | return Result.success(productModelService.selectproductModel(name, father, material)); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ ¹æ®idæ¥è¯¢") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "æ 忍¡çid", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @GetMapping("/selectproductModelById") |
| | | public Result selectproductModelById(Integer id) { |
| | | return Result.success(productModelService.selectproductModelById(id)); |
| | | } |
| | | |
| | | @ApiOperation("ç¼è¾") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "æ 忍¡çid", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @PostMapping("/writeproductModel") |
| | | public Result<?> writeproductModel(Integer id, @Validated @RequestBody ProductModelDto productModelDto) { |
| | | productModelService.writeproductModel(id,productModelDto); |
| | | return Result.success("ä¿®æ¹æ å项ç®ã" + productModelDto.getName() + "ãæåï¼"); |
| | | } |
| | | |
| | | @ApiOperation("å é¤") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "æ 忍¡çid", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @PostMapping("/delproductModel") |
| | | public Result<?> delproductModel(Integer id) { |
| | | productModelService.delproductModel(id); |
| | | return Result.success("å 餿 åé¡¹ç®æåï¼"); |
| | | } |
| | | |
| | | @ApiOperation("æ¹éå é¤") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "ids", value = "æ 忍¡çid", dataTypeClass = String.class, required = true) |
| | | }) |
| | | @PostMapping("/delAllproductModel") |
| | | public Result<?> delAllproductModel(String ids) { |
| | | productModelService.delAllproductModel(ids); |
| | | return Result.success("æ¹éå 餿 åé¡¹ç®æåï¼"); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | return Result.fail("æ·»å ç©æã"+ addSpecifications.getSpecificationsName() +"ã失败ï¼"); |
| | | } |
| | | |
| | | @ApiOperation("å é¤äº§åè§æ ¼") |
| | | @ApiOperation("å é¤äº§ååå·") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "specificationsId", value = "è§æ ¼Id", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | |
| | | return Result.fail("æ·»å ç©æã"+ addStandardDto.getStandardName() +"ã失败ï¼"); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDå 餿°æ®") |
| | | @ApiOperation("æ ¹æ®IDå è§æ ¼") |
| | | @DeleteMapping("/delete") |
| | | public Result<?> deleteStandardsInformation(Integer standardsId) { |
| | | Integer isDeleteMaterialSuccess = standardService.deleteStandardInformation(standardsId); |
| | |
| | | */ |
| | | public interface MaterialMapper extends BaseMapper<Material> { |
| | | |
| | | |
| | | //æ¥è¯¢ç©æä¿¡æ¯ |
| | | List<Map> selectMaterialLimit(int num1,int num2, int type); |
| | | |
| | |
| | | |
| | | // å级æ |
| | | List<Map<String, Object>> FourTree(String specificationsName); |
| | | |
| | | //éæ©æ ·ååç§° |
| | | List<String> selectmater(); |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | //æ ¹æ®ç©æidæ¥è¯¢æ£éªé¡¹ç® |
| | | List<Map> selectProductByMaterialId(int materialId); |
| | | |
| | | IPage<Map<String, Object>> pageProductInformation(String productCodeOrName, Integer specificationsId, Page<Objects> page); |
| | | //å±ç¤ºè¯¥åå·ä¸çæ£éªé¡¹ç®è¦æ± |
| | | List<Map<String, Object>> pageProductInformation(Integer specificationsId); |
| | | |
| | | Map<String, Object> selectOneChildren(Object father); |
| | | |
| | | Map<String, Object> getProductInformation(Integer productId); |
| | | |
| | | //éè¿é¡¹ç®åæ¥è¯¢é¡¹ç®çè¯éªæ¹æ³ |
| | | List<Map> selectInstrumentByProname(String name); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yuanchu.limslaboratory.pojo.ProductModel; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * åºç¡é¡¹ç®æ¨¡ç表(ProductModel)è¡¨æ°æ®åºè®¿é®å± |
| | | * |
| | | * @author zss |
| | | * @since 2023-08-19 11:00:39 |
| | | */ |
| | | public interface ProductModelMapper extends BaseMapper<ProductModel> { |
| | | |
| | | //æ¥è¯¢æ 忍¡çå表 |
| | | List<Map<String, Object>> selectproductModel(String name, String father, String material); |
| | | |
| | | //æ¹éå é¤ |
| | | void delAllproductModel(String ids); |
| | | |
| | | //æ·»å æ å-->鿩项ç®åç» |
| | | List<String> selectfather(); |
| | | |
| | | |
| | | |
| | | |
| | | //æ¥è¯¢é¡¹ç®æ¨¡çæ ¹æ®æ ·åå |
| | | List<Map<String, Object>> seleMode(String name); |
| | | } |
| | | |
| | |
| | | Map<String, Object> selectSNameSNName(int materialId); |
| | | |
| | | IPage<Map<String, Objects>> listSpecificationsInformation(String specificationsName, String serialNumberId, Page<Objects> page); |
| | | |
| | | |
| | | //æ ¹æ®åå·idæ¥è¯¢ç©æåç§° |
| | | String selMateName(Integer standardId); |
| | | } |
| | |
| | | @ApiModelProperty(value = "ç©æåç§°", example = "ç³å¤´", required = true) |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "0ï¼åææï¼1ï¼æåï¼2ï¼åæå", example = "1", required = true) |
| | | @ApiModelProperty(value = "0ï¼åææï¼1ï¼æåï¼2ï¼åæå", example = "1") |
| | | private Integer type; |
| | | |
| | | @TableLogic(value = "1", delval = "0") |
| | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "项ç®åç§°", example = "åä½é¿åº¦è´¨é", required = true) |
| | | @ApiModelProperty(value = "项ç®åç§°", example = "éå
é¢è¯éç»çº¿", required = true) |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "项ç®ç¶ç±»", example = "éå
é¢è¯éç»çº¿") |
| | | @ApiModelProperty(value = "项ç®ç¶ç±»", example = "åä½é¿åº¦è´¨é") |
| | | private String father; |
| | | |
| | | @ApiModelProperty(value = "åä½", example = "km", required = true) |
| | | @ApiModelProperty(value = "åä½", example = "km") |
| | | private String unit; |
| | | |
| | | @ApiModelProperty(value = "æ åå¼", example = "<=0.3458", required = true) |
| | | @ApiModelProperty(value = "æ åå¼", example = "<=0.3458") |
| | | private String required; |
| | | |
| | | @ApiModelProperty(value = "å
æ§å¼", example = "<=0.3458", required = true) |
| | | @ApiModelProperty(value = "å
æ§å¼", example = "<=0.3458") |
| | | private String internal; |
| | | |
| | | @TableLogic(value = "1", delval = "0") |
| | | |
| | | @ApiModelProperty(value = "é»è¾å é¤ æ£å¸¸>=1,å é¤<=0", hidden = true) |
| | | private Integer state; |
| | | |
| | |
| | | @ApiModelProperty(value = "ä¹è§é", hidden = true) |
| | | private Integer version; |
| | | |
| | | @ApiModelProperty(value = "å
³è ç©æid", example = "1", hidden = true) |
| | | @ApiModelProperty(value = "å
³è åå·id", example = "1", hidden = true) |
| | | private Integer specifications_id; |
| | | |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.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 java.util.Date; |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * åºç¡é¡¹ç®æ¨¡ç表(ProductModel)表å®ä½ç±» |
| | | * |
| | | * @author zss |
| | | * @since 2023-08-19 11:00:40 |
| | | */ |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("product_model") |
| | | public class ProductModel implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * id |
| | | **/ |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | /** |
| | | * 项ç®åç§° |
| | | **/ |
| | | private String name; |
| | | |
| | | /** |
| | | * 项ç®ç¶ç±» |
| | | **/ |
| | | private String father; |
| | | |
| | | /** |
| | | * åä½ |
| | | **/ |
| | | private String unit; |
| | | |
| | | @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") |
| | | private Date createTime; |
| | | |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @ApiModelProperty(value = "æ´æ°æ¶é´", hidden = true) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date updateTime; |
| | | |
| | | /** |
| | | * æ ·ååç§° |
| | | **/ |
| | | private String material; |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.pojo.dto; |
| | | |
| | | |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | |
| | | @Data |
| | | //æ·»å æ ååæ° |
| | | public class ProductModelDto { |
| | | |
| | | /** |
| | | * 项ç®åç§° |
| | | **/ |
| | | @NotBlank(message = "项ç®åç§°ä¸è½ä¸ºç©º") |
| | | private String name; |
| | | |
| | | /** |
| | | * 项ç®ç¶ç±» |
| | | **/ |
| | | private String father; |
| | | |
| | | /** |
| | | * åä½ |
| | | **/ |
| | | private String unit; |
| | | |
| | | /** |
| | | * æ ·ååç§° |
| | | **/ |
| | | @NotBlank(message = "æ ·ååç§°ä¸è½ä¸ºç©º") |
| | | private String material; |
| | | } |
| | |
| | | * å级å屿¾ç¤º |
| | | */ |
| | | List<Map<String, Object>> getFourLevelInformation(String specificationName); |
| | | |
| | | |
| | | /** |
| | | * æ·»å ææ -->éæ©æ ·ååç§° |
| | | * @return |
| | | */ |
| | | List<String> selectmater(); |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.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.limslaboratory.pojo.ProductModel; |
| | | import com.yuanchu.limslaboratory.pojo.dto.ProductModelDto; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * åºç¡é¡¹ç®æ¨¡ç表(ProductModel)表æå¡æ¥å£ |
| | | * |
| | | * @author zss |
| | | * @since 2023-08-19 11:00:39 |
| | | */ |
| | | public interface ProductModelService extends IService<ProductModel> { |
| | | |
| | | /** |
| | | * éæ©æ ·ååç§° |
| | | * @return |
| | | */ |
| | | List<String> selectmater(); |
| | | |
| | | /** |
| | | * æ·»å æ å-->鿩项ç®åç» |
| | | * @return |
| | | */ |
| | | List<String> selectfather(); |
| | | |
| | | /** |
| | | * æ·»å æ å |
| | | * @param productModelDto |
| | | */ |
| | | void addproductModel(ProductModelDto productModelDto); |
| | | |
| | | |
| | | /** |
| | | * æ¥è¯¢æ 忍¡çå表 |
| | | * @param name |
| | | * @param father |
| | | * @param material |
| | | * @return |
| | | */ |
| | | List<Map<String,Object>> selectproductModel(String name, String father, String material); |
| | | |
| | | /** |
| | | * æ ¹æ®idæ¥è¯¢ |
| | | * @param id |
| | | * @return |
| | | */ |
| | | ProductModelDto selectproductModelById(Integer id); |
| | | |
| | | /** |
| | | * ç¼è¾ |
| | | * @param id |
| | | * @param productModelDto |
| | | */ |
| | | void writeproductModel(Integer id, ProductModelDto productModelDto); |
| | | |
| | | /** |
| | | * å é¤ |
| | | * @param id |
| | | */ |
| | | void delproductModel(Integer id); |
| | | |
| | | /** |
| | | * æ¹éå é¤ |
| | | * @param ids |
| | | */ |
| | | void delAllproductModel(String ids); |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | public interface ProductService extends IService<Product> { |
| | | void deleteProductInformation(List<Integer> SpecificationsId); |
| | | |
| | | IPage<Map<String, Object>> pageProductInformation(String productCodeOrName, Integer specificationsId, Page<Objects> page); |
| | | |
| | | List<Map<String, Object>> pageFatherNameProductInformation(String fatherName); |
| | | |
| | | /** |
| | | * éè¿é¡¹ç®åæ¥è¯¢é¡¹ç®çè¯éªæ¹æ³ |
| | | * @param name |
| | | * å±ç¤ºè¯¥åå·ä¸çæ£éªé¡¹ç®è¦æ± |
| | | * @param specificationsId |
| | | * @return |
| | | */ |
| | | List<Map> selectInstrumentByProname(String name); |
| | | List<Map<String,Object>> pageProductInformation(Integer specificationsId); |
| | | } |
| | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | Integer deleteStandardInformation(Integer standardsId); |
| | | |
| | | //äºçº§æ°å¢ |
| | | Integer addStandardInformation(AddStandardDto addStandardDto); |
| | | |
| | | List<Map<String, Object>> getSpecificationIdAndName(String materialId); |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.IdWorker; |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.yuanchu.limslaboratory.mapper.ProductModelMapper; |
| | | import com.yuanchu.limslaboratory.pojo.Material; |
| | | import com.yuanchu.limslaboratory.mapper.MaterialMapper; |
| | | import com.yuanchu.limslaboratory.pojo.Product; |
| | | import com.yuanchu.limslaboratory.pojo.Specifications; |
| | | import com.yuanchu.limslaboratory.pojo.Standard; |
| | | import com.yuanchu.limslaboratory.pojo.dto.AddMaterialDto; |
| | |
| | | import com.yuanchu.limslaboratory.service.SpecificationsService; |
| | | import com.yuanchu.limslaboratory.service.StandardService; |
| | | import com.yuanchu.limslaboratory.utils.MyUtil; |
| | | 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.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | | * æå¡å®ç°ç±» |
| | | * æå¡å®ç°ç±» |
| | | * </p> |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | |
| | | @Autowired |
| | | private ProductService productService; |
| | | |
| | | @Resource |
| | | ProductModelMapper productModelMapper; |
| | | |
| | | //æ¥è¯¢ç©æä¿¡æ¯ |
| | | @Override |
| | | public List<Map> selectMaterialLimit(int pageSize, int countSize, int type) { |
| | | return materialMapper.selectMaterialLimit((pageSize - 1) * countSize,pageSize * countSize, type); |
| | | return materialMapper.selectMaterialLimit((pageSize - 1) * countSize, pageSize * countSize, type); |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | |
| | | updateWrapper.eq(Material::getId, materialId); |
| | | updateWrapper.set(Material::getState, 0); |
| | | int isDeleteSuccess = materialMapper.update(new Material(), updateWrapper); |
| | | if (isDeleteSuccess == 1){ |
| | | if (isDeleteSuccess == 1) { |
| | | List<Integer> isDeleteStandard = standardService.deleteStandardsInformation(materialId); |
| | | if (!ObjectUtils.isEmpty(isDeleteStandard)){ |
| | | if (!ObjectUtils.isEmpty(isDeleteStandard)) { |
| | | List<Integer> idDeleteSpecifications = specificationsService.StandardIdDeleteSpecifications(isDeleteStandard); |
| | | if (!ObjectUtils.isEmpty(idDeleteSpecifications)){ |
| | | if (!ObjectUtils.isEmpty(idDeleteSpecifications)) { |
| | | productService.deleteProductInformation(idDeleteSpecifications); |
| | | } |
| | | } |
| | |
| | | return 0; |
| | | } |
| | | |
| | | //ä¸çº§æ°å¢ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Integer addMaterialInformation(AddMaterialDto addMaterialDto) { |
| | | Material material = new Material() |
| | | .setCode("BZ" + IdWorker.getIdStr()) |
| | | .setName(addMaterialDto.getMaterialName()) |
| | | .setType(addMaterialDto.getType()); |
| | | int isInsertSuccess = materialMapper.insert(material); |
| | | if (isInsertSuccess > 0){ |
| | | Material material = materialMapper.selectOne(Wrappers.<Material>query().eq("name", addMaterialDto.getMaterialName())); |
| | | material.setType(addMaterialDto.getType()); |
| | | int isInsertSuccess = materialMapper.updateById(material); |
| | | if (isInsertSuccess > 0) { |
| | | Standard standard = new Standard() |
| | | .setMaterialId(material.getId()) |
| | | .setName(addMaterialDto.getStandardName()); |
| | | boolean save = standardService.save(standard); |
| | | if (save){ |
| | | if (save) { |
| | | Specifications specifications = new Specifications() |
| | | .setName(addMaterialDto.getSpecificationsName()) |
| | | .setStandardId(standard.getId()); |
| | | boolean save1 = specificationsService.save(specifications); |
| | | if (save1) |
| | | if (save1) { |
| | | //æ·»å åå·ä¹åæ·»å é¡¹ç® |
| | | List<Map<String, Object>> productModel = productModelMapper.seleMode(addMaterialDto.getMaterialName()); |
| | | List<Product> productList = productModel.stream().map(stringObjectMap -> { |
| | | Product product = new Product(); |
| | | product.setName(stringObjectMap.get("name").toString()); |
| | | product.setFather(stringObjectMap.get("father").toString()); |
| | | product.setUnit(stringObjectMap.get("unit").toString()); |
| | | product.setSpecifications_id(specifications.getId()); |
| | | return product; |
| | | }).collect(Collectors.toList()); |
| | | productService.saveBatch(productList); |
| | | return 1; |
| | | } |
| | | } |
| | | } |
| | | return 0; |
| | |
| | | public List<Map<String, Object>> getFourLevelInformation(String specificationName) { |
| | | return materialMapper.FourTree(specificationName); |
| | | } |
| | | |
| | | //æ·»å ææ -->éæ©æ ·ååç§° |
| | | @Override |
| | | public List<String> selectmater() { |
| | | return materialMapper.selectmater(); |
| | | } |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.yuanchu.limslaboratory.mapper.MaterialMapper; |
| | | import com.yuanchu.limslaboratory.mapper.ProductModelMapper; |
| | | import com.yuanchu.limslaboratory.pojo.Material; |
| | | import com.yuanchu.limslaboratory.pojo.ProductModel; |
| | | import com.yuanchu.limslaboratory.pojo.dto.ProductModelDto; |
| | | import com.yuanchu.limslaboratory.service.ProductModelService; |
| | | import com.yuanchu.limslaboratory.utils.MyUtil; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * åºç¡é¡¹ç®æ¨¡ç表(ProductModel)表æå¡å®ç°ç±» |
| | | * |
| | | * @author zss |
| | | * @since 2023-08-19 11:00:40 |
| | | */ |
| | | @Service |
| | | public class ProductModelServiceImpl extends ServiceImpl<ProductModelMapper, ProductModel> implements ProductModelService { |
| | | |
| | | @Resource |
| | | ProductModelMapper productModelMapper; |
| | | |
| | | @Resource |
| | | MaterialMapper materialMapper; |
| | | |
| | | //éæ©æ ·å |
| | | @Override |
| | | public List<String> selectmater() { |
| | | return materialMapper.selectmater(); |
| | | } |
| | | |
| | | //æ·»å æ å-->鿩项ç®åç» |
| | | @Override |
| | | public List<String> selectfather() { |
| | | return productModelMapper.selectfather(); |
| | | } |
| | | |
| | | //æ·»å æ å |
| | | @Override |
| | | public void addproductModel(ProductModelDto productModelDto) { |
| | | ProductModel productModel = new ProductModel(); |
| | | BeanUtils.copyProperties(productModelDto,productModel); |
| | | productModelMapper.insert(productModel); |
| | | //æ·»å ç©æäº§ååº |
| | | Material material = new Material(); |
| | | material.setName(productModelDto.getName()).setCode(MyUtil.getTimeSixNumberCode("CP","CP")); |
| | | materialMapper.insert(material); |
| | | } |
| | | |
| | | //æ¥è¯¢æ 忍¡çå表 |
| | | @Override |
| | | public List<Map<String, Object>> selectproductModel(String name, String father, String material) { |
| | | return productModelMapper.selectproductModel(name,father,material); |
| | | } |
| | | |
| | | //æ ¹æ®idæ¥è¯¢è¯¦æ
|
| | | @Override |
| | | public ProductModelDto selectproductModelById(Integer id) { |
| | | ProductModel productModel = productModelMapper.selectById(id); |
| | | ProductModelDto productModelDto = new ProductModelDto(); |
| | | BeanUtils.copyProperties(productModel,productModelDto); |
| | | return productModelDto; |
| | | } |
| | | |
| | | //ç¼è¾ |
| | | @Override |
| | | public void writeproductModel(Integer id, ProductModelDto productModelDto) { |
| | | ProductModel productModel = new ProductModel(); |
| | | BeanUtils.copyProperties(productModelDto,productModel); |
| | | productModel.setId(id); |
| | | productModelMapper.updateById(productModel); |
| | | } |
| | | |
| | | //å é¤ |
| | | @Override |
| | | public void delproductModel(Integer id) { |
| | | ProductModel productModel = new ProductModel(); |
| | | productModel.setId(id).setState(0); |
| | | productModelMapper.updateById(productModel); |
| | | } |
| | | |
| | | //æ¹éå é¤ |
| | | @Override |
| | | public void delAllproductModel(String ids) { |
| | | productModelMapper.delAllproductModel(ids); |
| | | } |
| | | } |
| | | |
| | |
| | | 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.mapper.ProductModelMapper; |
| | | import com.yuanchu.limslaboratory.mapper.SpecificationsMapper; |
| | | import com.yuanchu.limslaboratory.pojo.Product; |
| | | import com.yuanchu.limslaboratory.mapper.ProductMapper; |
| | | import com.yuanchu.limslaboratory.pojo.ProductModel; |
| | | import com.yuanchu.limslaboratory.service.ProductService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.yuanchu.limslaboratory.utils.MyUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import com.yuanchu.limslaboratory.service.UserService; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.ObjectUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | @Resource |
| | | private ProductMapper productMapper; |
| | | |
| | | @Resource |
| | | ProductModelMapper productModelMapper; |
| | | |
| | | |
| | | @Override |
| | | public void deleteProductInformation(List<Integer> SpecificationsId) { |
| | | for (Integer materialId : SpecificationsId){ |
| | |
| | | } |
| | | } |
| | | |
| | | //å±ç¤ºè¯¥åå·ä¸çæ£éªé¡¹ç®è¦æ± |
| | | @Override |
| | | public IPage<Map<String, Object>> pageProductInformation(String productCodeOrName, Integer specificationsId, Page<Objects> page) { |
| | | IPage<Map<String, Object>> iPage = productMapper.pageProductInformation(productCodeOrName, specificationsId, page); |
| | | List<Map<String, Object>> maps = iPage.getRecords(); |
| | | maps.forEach(map -> { |
| | | int num = Integer.parseInt(map.get("num").toString()); |
| | | boolean children = false; |
| | | if (num > 1){ |
| | | children = true; |
| | | } else { |
| | | Map<String, Object> product = productMapper.selectOneChildren(map.get("father")); |
| | | map.putAll(product); |
| | | } |
| | | map.put("children", children); |
| | | map.remove("num"); |
| | | }); |
| | | return iPage; |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public List<Map<String, Object>> pageProductInformation(Integer specificationsId) { |
| | | return productMapper.pageProductInformation(specificationsId); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> pageFatherNameProductInformation(String fatherName) { |
| | | LambdaQueryWrapper<Product> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(Product::getFather, fatherName); |
| | | wrapper.select(Product::getId, Product::getName, Product::getUnit, Product::getRequired, Product::getInternal); |
| | | return productMapper.selectMaps(wrapper); |
| | | } |
| | | |
| | | //éè¿é¡¹ç®åæ¥è¯¢é¡¹ç®çè¯éªæ¹æ³ |
| | | @Override |
| | | public List<Map> selectInstrumentByProname(String name) { |
| | | return productMapper.selectInstrumentByProname(name); |
| | | } |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.yuanchu.limslaboratory.mapper.ProductModelMapper; |
| | | import com.yuanchu.limslaboratory.pojo.Product; |
| | | import com.yuanchu.limslaboratory.pojo.Specifications; |
| | | import com.yuanchu.limslaboratory.mapper.SpecificationsMapper; |
| | | import com.yuanchu.limslaboratory.pojo.dto.AddSpecifications; |
| | | import com.yuanchu.limslaboratory.pojo.dto.AddStandardDto; |
| | | import com.yuanchu.limslaboratory.service.*; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | |
| | | @Autowired |
| | | private ProductService productService; |
| | | |
| | | @Resource |
| | | ProductModelMapper productModelMapper; |
| | | |
| | | @Override |
| | | public Integer deleteSpecifications(Integer specificationsId) { |
| | |
| | | Specifications specifications = new Specifications() |
| | | .setName(addStandardDto.getSpecificationsName()) |
| | | .setStandardId(addStandardDto.getStandardId()); |
| | | return specificationsMapper.insert(specifications); |
| | | specificationsMapper.insert(specifications); |
| | | //æ·»å åå·ä¹åæ·»å é¡¹ç® |
| | | List<Map<String, Object>> productModel=productModelMapper.seleMode(specificationsMapper.selMateName(addStandardDto.getStandardId())); |
| | | List<Product> productList = productModel.stream().map(stringObjectMap -> { |
| | | Product product = new Product(); |
| | | product.setName(stringObjectMap.get("name").toString()); |
| | | product.setFather(stringObjectMap.get("father").toString()); |
| | | product.setUnit(stringObjectMap.get("unit").toString()); |
| | | product.setSpecifications_id(specifications.getId()); |
| | | return product; |
| | | }).collect(Collectors.toList()); |
| | | productService.saveBatch(productList); |
| | | return 1; |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | | import com.yuanchu.limslaboratory.mapper.MaterialMapper; |
| | | import com.yuanchu.limslaboratory.mapper.ProductModelMapper; |
| | | import com.yuanchu.limslaboratory.mapper.StandardMapper; |
| | | import com.yuanchu.limslaboratory.pojo.Material; |
| | | import com.yuanchu.limslaboratory.pojo.Product; |
| | | import com.yuanchu.limslaboratory.pojo.Specifications; |
| | | import com.yuanchu.limslaboratory.pojo.Standard; |
| | | import com.yuanchu.limslaboratory.pojo.dto.AddStandardDto; |
| | | import com.yuanchu.limslaboratory.service.*; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | |
| | | @Autowired |
| | | private ProductService productService; |
| | | |
| | | @Resource |
| | | ProductModelMapper productModelMapper; |
| | | |
| | | @Resource |
| | | MaterialMapper materialMapper; |
| | | |
| | | |
| | | @Override |
| | |
| | | return 0; |
| | | } |
| | | |
| | | //äºçº§æ°å¢ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Integer addStandardInformation(AddStandardDto addStandardDto) { |
| | | Standard standard = new Standard() |
| | | .setMaterialId(addStandardDto.getMaterialId()) |
| | |
| | | .setName(addStandardDto.getSpecificationsName()) |
| | | .setStandardId(standard.getId()); |
| | | boolean save1 = specificationsService.save(specifications); |
| | | if (save1) |
| | | if (save1){ |
| | | //æ·»å åå·ä¹åæ·»å é¡¹ç® |
| | | List<Map<String, Object>> productModel=productModelMapper.seleMode(materialMapper.selectById(addStandardDto.getMaterialId()).getName()); |
| | | List<Product> productList = productModel.stream().map(stringObjectMap -> { |
| | | Product product = new Product(); |
| | | product.setName(stringObjectMap.get("name").toString()); |
| | | product.setFather(stringObjectMap.get("father").toString()); |
| | | product.setUnit(stringObjectMap.get("unit").toString()); |
| | | product.setSpecifications_id(specifications.getId()); |
| | | return product; |
| | | }).collect(Collectors.toList()); |
| | | productService.saveBatch(productList); |
| | | return 1; |
| | | } |
| | | } |
| | | return 0; |
| | | } |
| | |
| | | <?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.MaterialMapper"> |
| | | |
| | | <select id="selectMaterialLimit" resultType="Map"> |
| | | select id, code, name |
| | | from lims_laboratory.material |
| | | where state = 1 |
| | | and type = #{type} |
| | | order by create_time desc |
| | | limit #{num1}, #{num2} |
| | | limit #{num1}, #{num2} |
| | | </select> |
| | | <select id="selectMaterialById" resultType="Map"> |
| | | select m.id, |
| | |
| | | <select id="FourTree" resultMap="OneLevelTreeMap"> |
| | | SELECT m.`id` materialId, m.`name` materialName, s.`id` standardId, s.`name` standardName, |
| | | f.`id` specificationsId, f.`name` specificationsName, p.`id` productId, p.`name` productName |
| | | FROM material m |
| | | LEFT JOIN (SELECT s.`id`, s.`name`, s.`material_id` FROM standard s WHERE s.`state` = 1) s ON m.id = |
| | | FROM lims_laboratory.material m |
| | | LEFT JOIN (SELECT s.`id`, s.`name`, s.`material_id` FROM lims_laboratory.standard s WHERE s.`state` = 1) s ON m.id = |
| | | s.`material_id` |
| | | LEFT JOIN (SELECT f.`id`, f.`name`, f.`standard_id` FROM specifications f WHERE f.`state` = 1 |
| | | LEFT JOIN (SELECT f.`id`, f.`name`, f.`standard_id` FROM lims_laboratory.specifications f WHERE f.`state` = 1 |
| | | <if test="specificationsName != null and specificationsName != ''"> |
| | | AND f.`name` = #{specificationsName} |
| | | </if> |
| | | ) f ON s.`id` = f.`standard_id` |
| | | LEFT JOIN (SELECT p.`id`, p.`name`, p.`specifications_id` FROM product p WHERE p.`state` = 1) p ON f.`id` = |
| | | LEFT JOIN (SELECT p.`id`, p.`name`, p.`specifications_id` FROM lims_laboratory.product p WHERE p.`state` = 1) p ON f.`id` = |
| | | p.`specifications_id` |
| | | WHERE m.`state` = 1 |
| | | </select> |
| | | <!--æ·»å æ åéæ©æ ·ååç§°--> |
| | | <select id="selectmater" resultType="java.lang.String"> |
| | | select name |
| | | from lims_laboratory.material |
| | | where state = 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.ProductMapper"> |
| | | |
| | | <select id="pageProductInformation" resultType="map"> |
| | | SELECT COUNT(1) num, p.`father` |
| | | FROM product p |
| | | WHERE p.`specifications_id` = #{specificationsId} |
| | | <if test="productCodeOrName != null and productCodeOrName != ''"> |
| | | AND p.`father` = #{productCodeOrName} |
| | | </if> |
| | | GROUP BY p.`father` |
| | | </select> |
| | | |
| | | <select id="selectOneChildren" resultType="map"> |
| | | SELECT p.`id`, p.`name`, p.`unit`, p.`required`, p.`internal` |
| | | FROM product p |
| | | WHERE p.`father` = #{father} |
| | | </select> |
| | | <select id="selectProductByMaterialId" resultType="Map"> |
| | | select p.name,unit,required,internal |
| | | select p.name, unit, required, internal |
| | | from lims_laboratory.product p, |
| | | lims_laboratory.specifications sp, |
| | | lims_laboratory.standard st |
| | | where specifications_id=sp.id |
| | | and standard=st.id |
| | | and material_id=#{materialId} |
| | | where specifications_id = sp.id |
| | | and standard_id = st.id |
| | | and material_id = #{materialId} |
| | | </select> |
| | | |
| | | <!--å±ç¤ºè¯¥åå·ä¸çæ£éªé¡¹ç®è¦æ±--> |
| | | <select id="pageProductInformation" resultType="java.util.Map"> |
| | | select name, |
| | | father, |
| | | unit, |
| | | required, |
| | | internal |
| | | from lims_laboratory.product |
| | | where state=1 |
| | | and specifications_id=#{specificationsId} |
| | | </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.ProductModelMapper"> |
| | | <!--æ¥è¯¢æ 忍¡çå表--> |
| | | <select id="selectproductModel" resultType="java.util.Map"> |
| | | select id, |
| | | father, |
| | | name, |
| | | unit |
| | | from lims_laboratory.product_model |
| | | where state=1 |
| | | and material=#{material} |
| | | <if test="name!=null and name!=''"> |
| | | and name like concat('%',#{name},'%') |
| | | </if> |
| | | <if test="father!=null and father!=''"> |
| | | and father like concat('%',#{father},'%') |
| | | </if> |
| | | order by father |
| | | </select> |
| | | |
| | | <update id="delAllproductModel"> |
| | | update lims_laboratory.product_model |
| | | set state=0 |
| | | where id in (${ids}) |
| | | </update> |
| | | <!--æ·»å æ å鿩项ç®åç»--> |
| | | <select id="selectfather" resultType="java.lang.String"> |
| | | select distinct father |
| | | from lims_laboratory.product_model |
| | | where state = 1 |
| | | </select> |
| | | |
| | | <!--æ¥è¯¢é¡¹ç®æ¨¡çæ ¹æ®æ ·åå--> |
| | | <select id="seleMode" resultType="java.util.Map"> |
| | | select name, |
| | | father, |
| | | unit |
| | | from lims_laboratory.product_model |
| | | where state = 1 |
| | | and material =#{name} |
| | | </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.SpecificationsMapper"> |
| | | |
| | | <!--æ ¹æ®è§æ ¼idæ¥è¯¢ç©æåç§°--> |
| | | <select id="selMateName" resultType="java.lang.String"> |
| | | select name |
| | | from lims_laboratory.material |
| | | where state = 1 |
| | | and id = (select material_id |
| | | from lims_laboratory.standard |
| | | where standard.state = 1 |
| | | and standard.id=#{standardId}); |
| | | </select> |
| | | </mapper> |
| | |
| | | # redisæå¡å¨å°åï¼é»è®¤ä¸ºlocalhostï¼ |
| | | host: 192.168.110.209 |
| | | # redis端å£ï¼é»è®¤ä¸º6379ï¼ |
| | | port: 6379 |
| | | port: 6380 |
| | | # redis访é®å¯ç ï¼é»è®¤ä¸ºç©ºï¼ |
| | | password: null |
| | | # redisè¿æ¥è¶
æ¶æ¶é´ï¼å使¯«ç§ï¼ |