| | |
| | | @ApiModelProperty(value = "å页å¤å°æ¡", example = "10", required = true) |
| | | private Long pageNum; |
| | | |
| | | @ApiModelProperty(value = "è°æ¥æ¥æ", example = "2020-01-02", required = true) |
| | | @ApiModelProperty(value = "è°æ¥æ¥æ", example = "2020-01-02") |
| | | private Date surveyDate; |
| | | |
| | | @ApiModelProperty(value = "å½å
¥æ¥æ", example = "2025-06-08", required = true) |
| | | @ApiModelProperty(value = "å½å
¥æ¥æ", example = "2025-06-08") |
| | | private Date entryDate; |
| | | |
| | | } |
| | |
| | | return sb.toString(); |
| | | } |
| | | |
| | | public static String getTimeSixNumberCode(String prefix){ |
| | | public static String getTimeSixNumberCode(String prefix,String name){ |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); |
| | | String format = simpleDateFormat.format(new Date()); |
| | | String timeStr = format.replace("-", ""); |
| | | long incrNum = RedisUtil.incr("num", 1); |
| | | long incrNum = RedisUtil.incr(name, 1); |
| | | if(incrNum == 1){ |
| | | RedisUtil.expire("num", 60 * 60 * 24); |
| | | RedisUtil.expire(name, 60 * 60 * 24); |
| | | } |
| | | String sixIncr = String.format("%06d", incrNum); |
| | | return prefix + timeStr + sixIncr; |
| | |
| | | //çææ¥åå |
| | | Report report = new Report(); |
| | | //çææ¥ååå· |
| | | String code = MyUtil.getTimeSixNumberCode("BG"); |
| | | String code = MyUtil.getTimeSixNumberCode("BG","BG"); |
| | | //è·åæ£éªç»è®º |
| | | String conclusion = ""; |
| | | Inspection inspection1 = inspectionMapper.selectById(id); |
| | |
| | | |
| | | @Override |
| | | public String addLinkBasicInformation(LinkBasicInformation linkBasicInformation) { |
| | | String code = MyUtil.getTimeSixNumberCode("SL"); |
| | | String code = MyUtil.getTimeSixNumberCode("SL","SL"); |
| | | linkBasicInformation.setEntrustCoding(code); |
| | | int insert = linkBasicInformationMapper.insert(linkBasicInformation); |
| | | if (insert == 1) { |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.limslaboratory.pojo.Instrument; |
| | | import com.yuanchu.limslaboratory.pojo.MeteringPlan; |
| | | import com.yuanchu.limslaboratory.pojo.dto.SelectMeasurementLedgerDto; |
| | | import com.yuanchu.limslaboratory.service.MeteringPlanService; |
| | | import com.yuanchu.limslaboratory.utils.JackSonUtil; |
| | | import com.yuanchu.limslaboratory.utils.RedisUtil; |
| | |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "pageNo", value = "èµ·å§é¡µ", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "pageSize", value = "æ¯ä¸é¡µæ°é", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "measureCodeOrNameOrUnit", value = "æ¯ä¸é¡µæ°é", dataTypeClass = Integer.class, required = true) |
| | | @ApiImplicitParam(name = "measureCodeOrNameOrUnit", value = "æµéç¼ç /åç§°/åä½", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @GetMapping("/plan_page_list") |
| | | public Result<?> pagingQueryOfMeteringPlan(Integer pageNo, Integer pageSize, String measureCodeOrNameOrUnit) { |
| | |
| | | } |
| | | |
| | | @ApiOperation("计éå°è´¦å页æ¥è¯¢") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "pageNo", value = "èµ·å§é¡µ", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "pageSize", value = "æ¯ä¸é¡µæ°é", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @GetMapping("/standing_page_list") |
| | | public Result<?> pagingQueryOfMeasurementLedger(Integer pageNo, Integer pageSize) { |
| | | IPage<Map<String, Object>> page = meteringPlanService.pagingQueryOfMeasurementLedger(new Page<Objects>(pageNo, pageSize)); |
| | | public Result<?> pagingQueryOfMeasurementLedger(SelectMeasurementLedgerDto selectMeasurementLedgerDto) { |
| | | IPage<Map<String, Object>> page = meteringPlanService.pagingQueryOfMeasurementLedger(selectMeasurementLedgerDto); |
| | | return Result.success(page); |
| | | } |
| | | } |
| | |
| | | import com.yuanchu.limslaboratory.pojo.Classify; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper æ¥å£ |
| | |
| | | */ |
| | | public interface ClassifyMapper extends BaseMapper<Classify> { |
| | | |
| | | Classify selectOneByName(Classify classify); |
| | | List<Classify> selectOneByName(Classify classify); |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.limslaboratory.pojo.MeteringPlan; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yuanchu.limslaboratory.pojo.dto.SelectMeasurementLedgerDto; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | |
| | | */ |
| | | public interface MeteringPlanMapper extends BaseMapper<MeteringPlan> { |
| | | |
| | | IPage<Map<String, Object>> pagingQueryOfMeasurementLedger(Page<Objects> page); |
| | | IPage<Map<String, Object>> pagingQueryOfMeasurementLedger(Page<Objects> page,@Param("dto") SelectMeasurementLedgerDto dto); |
| | | } |
| | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "计éç¼å·", example = "1", required = true) |
| | | private String code; |
| | | |
| | | @ApiModelProperty(value = "ç¨æ·å
³èId", example = "7", required = true) |
| | | private Integer userId; |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.pojo.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * @Author å¼ å®¾ |
| | | * @Date 2023/8/16 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @ApiModel(value = "selectMeasurementLedgerDto对象", description = "") |
| | | public class SelectMeasurementLedgerDto implements Serializable { |
| | | @ApiModelProperty(value = "å½å页", example = "1", required = true) |
| | | private Long currentPage; |
| | | @ApiModelProperty(value = "æ¯é¡µå¤å°æ¡", example = "10", required = true) |
| | | private Long pageSize; |
| | | @ApiModelProperty(value = "仪å¨ç¼ç ", required = false) |
| | | private String code; |
| | | @ApiModelProperty(value = "仪å¨åç§°", required = false) |
| | | private String name; |
| | | @ApiModelProperty(value = "计éåä½", required = false) |
| | | private String unit; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.pojo.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * @Author å¼ å®¾ |
| | | * @Date 2023/8/16 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @ApiModel(value = "SelectMeteringPlanDto", description = "") |
| | | public class SelectMeteringPlanDto implements Serializable { |
| | | |
| | | @ApiModelProperty(value = "å½å页", example = "1", required = true) |
| | | private Long currentPage; |
| | | @ApiModelProperty(value = "æ¯é¡µå¤å°æ¡", example = "10", required = true) |
| | | private Long pageSize; |
| | | @ApiModelProperty(value = "仪å¨ç¼ç ", required = false) |
| | | private String code; |
| | | @ApiModelProperty(value = "仪å¨åç§°", required = false) |
| | | private String name; |
| | | @ApiModelProperty(value = "计éåä½", required = false) |
| | | private String unit; |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.limslaboratory.pojo.MeteringPlan; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yuanchu.limslaboratory.pojo.dto.SelectMeasurementLedgerDto; |
| | | |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | |
| | | |
| | | IPage<Map<String, Object>> pagingQueryOfMeteringPlan(String measureCodeOrNameOrUnit, Page<Objects> page); |
| | | |
| | | IPage<Map<String, Object>> pagingQueryOfMeasurementLedger(Page<Objects> page); |
| | | IPage<Map<String, Object>> pagingQueryOfMeasurementLedger(SelectMeasurementLedgerDto selectMeasurementLedgerDto); |
| | | } |
| | |
| | | |
| | | @Override |
| | | public Integer addClassifyInformation(Classify classify) { |
| | | //LambdaQueryWrapper<Classify> wrapper = new LambdaQueryWrapper<>(); |
| | | //wrapper.eq(Classify::getFatherName, classify.getFatherName()); |
| | | //wrapper.eq(Classify::getSonName, classify.getSonName()); |
| | | //wrapper.eq(Classify::getState, 1); |
| | | Classify classify1 = classifyMapper.selectOneByName(classify); |
| | | if (ObjectUtils.isEmpty(classify1)){ |
| | | List<Classify> classify1 = classifyMapper.selectOneByName(classify); |
| | | if (classify1.size()>0){ |
| | | return 2; |
| | | } else { |
| | | classify.setCreateTime(DateUtil.date()); |
| | | return classifyMapper.insert(classify); |
| | | } else { |
| | | return 2; |
| | | } |
| | | } |
| | | |
| | |
| | | import com.yuanchu.limslaboratory.pojo.Instrument; |
| | | import com.yuanchu.limslaboratory.pojo.MeteringPlan; |
| | | import com.yuanchu.limslaboratory.mapper.MeteringPlanMapper; |
| | | import com.yuanchu.limslaboratory.pojo.dto.SelectMeasurementLedgerDto; |
| | | import com.yuanchu.limslaboratory.service.MeteringPlanService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.yuanchu.limslaboratory.utils.MyUtil; |
| | |
| | | |
| | | @Override |
| | | public Integer addMeteringPlanInformation(MeteringPlan meteringPlan) { |
| | | String timeSixNumber = MyUtil.getTimeSixNumberCode("P"); |
| | | String timeSixNumber = MyUtil.getTimeSixNumberCode("P","P"); |
| | | meteringPlan.setPlannedOrderNumber(timeSixNumber); |
| | | return meteringPlanMapper.insert(meteringPlan); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<Map<String, Object>> pagingQueryOfMeteringPlan(String measureCodeOrNameOrUnit, Page<Objects> page) { |
| | | |
| | | |
| | | |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public IPage<Map<String, Object>> pagingQueryOfMeasurementLedger(Page<Objects> page) { |
| | | return meteringPlanMapper.pagingQueryOfMeasurementLedger(page); |
| | | public IPage<Map<String, Object>> pagingQueryOfMeasurementLedger(SelectMeasurementLedgerDto dto) { |
| | | return meteringPlanMapper.pagingQueryOfMeasurementLedger(new Page<>(dto.getCurrentPage(),dto.getPageSize(),true),dto); |
| | | } |
| | | } |
| | |
| | | String fileName = FileSaveUtil.StoreFile(file); |
| | | metricalInformation.setFilePath(fileName); |
| | | } |
| | | metricalInformation.setCode(MyUtil.getTimeSixNumberCode("METRICALCODE","METRICALCODE")); |
| | | return metricalInformationMapper.insert(metricalInformation); |
| | | } |
| | | |
| | |
| | | <mapper namespace="com.yuanchu.limslaboratory.mapper.ClassifyMapper"> |
| | | |
| | | <select id="selectOneByName" resultType="com.yuanchu.limslaboratory.pojo.Classify"> |
| | | SELECT id, |
| | | father_name, |
| | | son_name, |
| | | state, |
| | | create_time, |
| | | update_time, |
| | | version |
| | | SELECT id |
| | | FROM classify |
| | | WHERE state = 1 |
| | | <if test="fatherName!=null and fatherName!=''"> |
| | | AND father_name = #{fatherName} |
| | | </if> |
| | | <if test="sonName!=null and sonName!=''"> |
| | | and son_name =#{sonName} |
| | | </if> |
| | | </select> |
| | | </mapper> |
| | |
| | | <mapper namespace="com.yuanchu.limslaboratory.mapper.MeteringPlanMapper"> |
| | | |
| | | <select id="pagingQueryOfMeasurementLedger" resultType="map"> |
| | | SELECT i.`equipment_code`, i.`equipment_name`, i.`specifications_models`, m.`create_time`, m.`uncertainty`, |
| | | m.`end_date`, i.`term_validity`, i.`storage_place`, i.`conditions` |
| | | FROM instrument i, metrical_information m |
| | | WHERE i.`id` = m.`instrument_id` |
| | | SELECT |
| | | i.`equipment_code` equipmentCode, |
| | | i.`equipment_name` equipmentName, |
| | | m.measurement_unit measurementUnit, |
| | | i.measuring_range measuringRange, |
| | | i.term_validity termValidity, |
| | | m.result result, |
| | | m.end_date endDate, |
| | | u.NAME name , |
| | | m.`create_time` createTime, |
| | | m.code code |
| | | FROM |
| | | metrical_information m |
| | | LEFT JOIN `user` u ON u.id = m.user_id |
| | | LEFT JOIN instrument i ON i.`id` = m.`instrument_id` |
| | | WHERE 1=1 |
| | | and (m.state=1 and i.state=1) |
| | | <if test="dto.code!=null and dto.code!=''"> |
| | | and i.`equipment_code` like concat('%',#{dto.code},'%') |
| | | </if> |
| | | <if test="dto.name!=null and dto.name!=''"> |
| | | and i.`equipment_name` like concat('%',#{dto.name},'%') |
| | | </if> |
| | | <if test="dto.name!=null and dto.name!=''"> |
| | | and i.measurement_unit like concat('%',#{dto.unit},'%') |
| | | </if> |
| | | </select> |
| | | </mapper> |
| | |
| | | import com.yuanchu.limslaboratory.pojo.vo.PlanVo; |
| | | import com.yuanchu.limslaboratory.service.PlanService; |
| | | import com.yuanchu.limslaboratory.service.UserService; |
| | | import com.yuanchu.limslaboratory.utils.MyUtil; |
| | | import org.apache.poi.hwpf.HWPFDocument; |
| | | import org.apache.poi.hwpf.extractor.WordExtractor; |
| | | import org.apache.poi.xwpf.extractor.XWPFWordExtractor; |
| | | import org.apache.poi.xwpf.usermodel.XWPFDocument; |
| | | import org.apache.poi.xwpf.usermodel.XWPFParagraph; |
| | | import org.junit.jupiter.api.Test; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.boot.test.context.SpringBootTest; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @SpringBootTest |
| | | class SysApplicationTests { |
| | |
| | | } |
| | | } |
| | | } |
| | | @Test |
| | | void testRedis(){ |
| | | boolean b=true; |
| | | if (b) { |
| | | this.contextLoads(); |
| | | } else { |
| | | this.TT(); |
| | | } |
| | | System.out.println(2024%100); |
| | | new Thread(()->{ |
| | | String timeSixNumberCode = MyUtil.getTimeSixNumberCode("CS", "number"); |
| | | System.out.println(timeSixNumberCode); |
| | | }).start(); |
| | | //new Thread(()->{ |
| | | // String timeSixNumberCode = MyUtil.getTimeSixNumberCode("CS", "number"); |
| | | // System.out.println(timeSixNumberCode); |
| | | //}).start(); |
| | | //new Thread(()->{ |
| | | // String timeSixNumberCode = MyUtil.getTimeSixNumberCode("CS", "number"); |
| | | // System.out.println(timeSixNumberCode); |
| | | //}).start(); |
| | | } |
| | | } |
| | | |
| | | |