| | |
| | | @ApiModelProperty(value = "æ£éªé¡¹") |
| | | private String inspectionItem; |
| | | |
| | | @ValueTableShow(2) |
| | | @ApiModelProperty(value = "æ£éªé¡¹åç±»") |
| | | private String inspectionItemClassify; |
| | | // @ValueTableShow(2) |
| | | // @ApiModelProperty(value = "æ£éªå项") |
| | | // private String inspectionItemClassify; |
| | | |
| | | @ValueTableShow(3) |
| | | @ApiModelProperty(value = "æ£éªé¡¹å°ç±»") |
| | | @ApiModelProperty(value = "æ£éªé¡¹å项") |
| | | private String inspectionItemSubclass; |
| | | |
| | | @ValueTableShow(4) |
| | |
| | | @ApiModelProperty(value = "ç¹æ®æ è¯") |
| | | private String bsm; |
| | | |
| | | @ValueTableShow(5) |
| | | @ApiModelProperty(value = "æ ·ååç§°") |
| | | private String sample; |
| | | |
| | | @ApiModelProperty(value = "å建人id") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | |
| | | method, |
| | | man_day, |
| | | bsm, |
| | | sample, |
| | | inspection_value_type |
| | | from structure_item_parameter |
| | | <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.controller; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.mom.pojo.StandardTemplate; |
| | | import com.yuanchu.mom.service.StandardTemplateService; |
| | | import com.yuanchu.mom.utils.JackSonUtil; |
| | | import com.yuanchu.mom.vo.Result; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.Map; |
| | | |
| | | @RequestMapping("/StandardTemplate") |
| | | @RestController |
| | | @AllArgsConstructor |
| | | public class StandardTemplateController { |
| | | |
| | | private StandardTemplateService standardTemplateService; |
| | | |
| | | @ApiOperation(value = "è·åæ£éªæ¨¡æ¿å表") |
| | | @PostMapping("/selectStandardTemplatePageList") |
| | | public Result selectStandardTemplatePageList(@RequestBody Map<String, Object> data) throws Exception { |
| | | Page page = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("page")), Page.class); |
| | | StandardTemplate standardTemplate = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("entity")), StandardTemplate.class); |
| | | return Result.success(standardTemplateService.selectStandardTemplatePageList(page, standardTemplate)); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ·»å æ£éªæ¨¡æ¿") |
| | | @PostMapping("/addStandardTemplate") |
| | | public Result addStandardTemplate(@RequestBody StandardTemplate standardTemplate) { |
| | | return Result.success(standardTemplateService.addStandardTemplate(standardTemplate)); |
| | | } |
| | | |
| | | @ApiOperation(value = "ä¿®æ¹æ£éªæ¨¡æ¿") |
| | | @PostMapping("/upStandardTemplate") |
| | | public Result<?> upStandardTemplate(@RequestBody StandardTemplate standardTemplate) { |
| | | return Result.success(standardTemplateService.upStandardTemplate(standardTemplate)); |
| | | } |
| | | |
| | | @ApiOperation(value = "å 餿£éªæ¨¡æ¿") |
| | | @PostMapping("/delStandardTemplate") |
| | | public Result<?> delStandardTemplate(Integer id) { |
| | | return Result.success(standardTemplateService.delStandardTemplate(id)); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.yuanchu.mom.pojo.StandardTemplate; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description é对表ãstandard_template(æ 忍¡æ¿)ãçæ°æ®åºæä½Mapper |
| | | * @createDate 2024-03-11 13:47:52 |
| | | * @Entity com.yuanchu.mom.pojo.StandardTemplate |
| | | */ |
| | | public interface StandardTemplateMapper extends BaseMapper<StandardTemplate> { |
| | | |
| | | IPage<StandardTemplate> selectStandardTemplatePageList(IPage<StandardTemplate> page, QueryWrapper<StandardTemplate> ew); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | |
| | | |
| | | StandardProductList selectStandardProductById(Integer id); |
| | | |
| | | List<StandardProductList> getStandardProductListBySample(String sample); |
| | | |
| | | } |
| | | |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Date; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.yuanchu.mom.annotation.ValueTableShow; |
| | | import com.yuanchu.mom.common.OrderBy; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * æ 忍¡æ¿ |
| | | * @TableName standard_template |
| | | */ |
| | | @TableName(value ="standard_template") |
| | | @Data |
| | | public class StandardTemplate extends OrderBy implements Serializable { |
| | | /** |
| | | * |
| | | */ |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | /** |
| | | * 模æ¿åç§° |
| | | */ |
| | | @ApiModelProperty("模æ¿åç§°") |
| | | @ValueTableShow(1) |
| | | private String name; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | @ApiModelProperty("夿³¨") |
| | | @ValueTableShow(2) |
| | | private String remark; |
| | | |
| | | /** |
| | | * 模æ¿ç»æ |
| | | */ |
| | | private String thing; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | /** |
| | | * |
| | | */ |
| | | @ApiModelProperty("å建æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @ValueTableShow(4) |
| | | private LocalDateTime createTime; |
| | | /** |
| | | * |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | /** |
| | | * |
| | | */ |
| | | @ApiModelProperty("ä¿®æ¹æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @ValueTableShow(6) |
| | | private LocalDateTime updateTime; |
| | | |
| | | @ApiModelProperty("åå»ºç¨æ·") |
| | | @ValueTableShow(3) |
| | | private String createUserName; |
| | | |
| | | @ApiModelProperty("æ´æ°ç¨æ·") |
| | | @ValueTableShow(5) |
| | | private String updateUserName; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.yuanchu.mom.pojo.StandardTemplate; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description é对表ãstandard_template(æ 忍¡æ¿)ãçæ°æ®åºæä½Service |
| | | * @createDate 2024-03-11 13:47:52 |
| | | */ |
| | | public interface StandardTemplateService extends IService<StandardTemplate> { |
| | | |
| | | Map<String, Object> selectStandardTemplatePageList(IPage<StandardTemplate> page, StandardTemplate standardTemplate); |
| | | |
| | | int addStandardTemplate(StandardTemplate standardTemplate); |
| | | |
| | | int upStandardTemplate(StandardTemplate standardTemplate); |
| | | |
| | | int delStandardTemplate(Integer id); |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.yuanchu.mom.common.GetLook; |
| | | import com.yuanchu.mom.common.PrintChina; |
| | | import com.yuanchu.mom.pojo.StandardTemplate; |
| | | import com.yuanchu.mom.service.StandardTemplateService; |
| | | import com.yuanchu.mom.mapper.StandardTemplateMapper; |
| | | import com.yuanchu.mom.utils.QueryWrappers; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description é对表ãstandard_template(æ 忍¡æ¿)ãçæ°æ®åºæä½Serviceå®ç° |
| | | * @createDate 2024-03-11 13:47:52 |
| | | */ |
| | | @Service |
| | | @AllArgsConstructor |
| | | public class StandardTemplateServiceImpl extends ServiceImpl<StandardTemplateMapper, StandardTemplate> |
| | | implements StandardTemplateService{ |
| | | |
| | | private GetLook getLook; |
| | | |
| | | private StandardTemplateMapper standardTemplateMapper; |
| | | |
| | | @Override |
| | | public Map<String, Object> selectStandardTemplatePageList(IPage<StandardTemplate> page, StandardTemplate standardTemplate) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("head", PrintChina.printChina(StandardTemplate.class)); |
| | | Map<String, Integer> map1 = getLook.selectPowerByMethodAndUserId("selectStandardTemplatePageList"); |
| | | if(map1.get("look")==1) standardTemplate.setCreateUser(map1.get("userId")); |
| | | map.put("body", standardTemplateMapper.selectStandardTemplatePageList(page, QueryWrappers.queryWrappers(standardTemplate))); |
| | | return map; |
| | | } |
| | | |
| | | @Override |
| | | public int addStandardTemplate(StandardTemplate standardTemplate) { |
| | | return standardTemplateMapper.insert(standardTemplate); |
| | | } |
| | | |
| | | @Override |
| | | public int upStandardTemplate(StandardTemplate standardTemplate) { |
| | | return standardTemplateMapper.updateById(standardTemplate); |
| | | } |
| | | |
| | | @Override |
| | | public int delStandardTemplate(Integer id) { |
| | | return standardTemplateMapper.deleteById(id); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public int addStandardTree(StandardTree standardTree) { |
| | | if(standardTree.getSample()!=null){ |
| | | List<StandardProductList> list = standardTreeMapper.getStandardProductListBySample(standardTree.getSample()); |
| | | for (StandardProductList standardProductList : list) { |
| | | standardProductList.setFactory(standardTree.getFactory()); |
| | | standardProductList.setLaboratory(standardTree.getLaboratory()); |
| | | standardProductList.setSampleType(standardTree.getSampleType()); |
| | | standardProductList.setSample(standardTree.getSample()); |
| | | standardProductList.setModel(standardTree.getModel()); |
| | | standardProductListMapper.insert(standardProductList); |
| | | } |
| | | } |
| | | return standardTreeMapper.insert(standardTree); |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.yuanchu.mom.mapper.StandardTemplateMapper"> |
| | | |
| | | <resultMap id="BaseResultMap" type="com.yuanchu.mom.pojo.StandardTemplate"> |
| | | <id property="id" column="id" jdbcType="INTEGER"/> |
| | | <result property="name" column="name" jdbcType="VARCHAR"/> |
| | | <result property="remark" column="remark" jdbcType="VARCHAR"/> |
| | | <result property="thing" column="thing" jdbcType="VARCHAR"/> |
| | | <result property="createUser" column="create_user" jdbcType="INTEGER"/> |
| | | <result property="updateUser" column="update_user" jdbcType="INTEGER"/> |
| | | <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> |
| | | <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/> |
| | | </resultMap> |
| | | |
| | | <sql id="Base_Column_List"> |
| | | id,name,remark, |
| | | thing,create_user,update_user, |
| | | create_time,update_time |
| | | </sql> |
| | | <select id="selectStandardTemplatePageList" resultType="com.yuanchu.mom.pojo.StandardTemplate"> |
| | | select * from ( |
| | | select st.id, st.name, remark, thing, u2.name create_user_name, u3.name update_user_name, st.create_time, st.update_time |
| | | from standard_template st |
| | | left join user u2 on u2.id = st.create_user |
| | | left join user u3 on u3.id = st.update_user |
| | | ) a |
| | | <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> |
| | | ${ew.customSqlSegment} |
| | | </if> |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
| | |
| | | <mapper namespace="com.yuanchu.mom.mapper.StandardTreeMapper"> |
| | | |
| | | <resultMap id="BaseResultMap" type="com.yuanchu.mom.pojo.StandardTree"> |
| | | <id property="id" column="id" jdbcType="INTEGER"/> |
| | | <result property="factory" column="factory" jdbcType="VARCHAR"/> |
| | | <result property="laboratory" column="laboratory" jdbcType="VARCHAR"/> |
| | | <result property="sampleType" column="sample_type" jdbcType="VARCHAR"/> |
| | | <result property="sample" column="sample" jdbcType="VARCHAR"/> |
| | | <result property="model" column="model" jdbcType="VARCHAR"/> |
| | | <result property="createUser" column="create_user" jdbcType="INTEGER"/> |
| | | <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> |
| | | <result property="updateUser" column="update_user" jdbcType="INTEGER"/> |
| | | <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/> |
| | | <id property="id" column="id" jdbcType="INTEGER"/> |
| | | <result property="factory" column="factory" jdbcType="VARCHAR"/> |
| | | <result property="laboratory" column="laboratory" jdbcType="VARCHAR"/> |
| | | <result property="sampleType" column="sample_type" jdbcType="VARCHAR"/> |
| | | <result property="sample" column="sample" jdbcType="VARCHAR"/> |
| | | <result property="model" column="model" jdbcType="VARCHAR"/> |
| | | <result property="createUser" column="create_user" jdbcType="INTEGER"/> |
| | | <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> |
| | | <result property="updateUser" column="update_user" jdbcType="INTEGER"/> |
| | | <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/> |
| | | </resultMap> |
| | | |
| | | <resultMap id="FactoryDto" type="com.yuanchu.mom.dto.FactoryDto"> |
| | |
| | | </resultMap> |
| | | |
| | | <select id="selectStandardTreeList" resultMap="FactoryDto"> |
| | | select factory,laboratory,sample_type,sample,model from standard_tree |
| | | select factory, laboratory, sample_type, sample, model |
| | | from standard_tree |
| | | </select> |
| | | |
| | | <select id="selectStandardProductById" resultType="com.yuanchu.mom.pojo.StandardProductList"> |
| | | select |
| | | inspection_item, |
| | | inspection_item_classify, |
| | | inspection_item_subclass, |
| | | laboratory, |
| | | unit, |
| | | price, |
| | | man_hour, |
| | | man_hour_group, |
| | | inspection_item_type, |
| | | inspection_value_type, |
| | | device_group, |
| | | checkout_number, |
| | | section, |
| | | value_type, |
| | | method, |
| | | man_day, |
| | | bsm |
| | | select inspection_item, |
| | | inspection_item_classify, |
| | | inspection_item_subclass, |
| | | laboratory, |
| | | unit, |
| | | price, |
| | | man_hour, |
| | | man_hour_group, |
| | | inspection_item_type, |
| | | inspection_value_type, |
| | | device_group, |
| | | checkout_number, |
| | | section, |
| | | value_type, |
| | | method, |
| | | man_day, |
| | | bsm |
| | | from structure_item_parameter |
| | | where id = #{id} |
| | | </select> |
| | | <select id="getStandardProductListBySample" resultType="com.yuanchu.mom.pojo.StandardProductList"> |
| | | select inspection_item, |
| | | inspection_item_classify, |
| | | inspection_item_subclass, |
| | | laboratory, |
| | | unit, |
| | | price, |
| | | man_hour, |
| | | man_hour_group, |
| | | inspection_item_type, |
| | | inspection_value_type, |
| | | device_group, |
| | | checkout_number, |
| | | section, |
| | | value_type, |
| | | method, |
| | | man_day, |
| | | sample, |
| | | bsm |
| | | from structure_item_parameter |
| | | where sample = #{sample} |
| | | </select> |
| | | </mapper> |