已修改8个文件
已重命名3个文件
已删除1个文件
已添加2个文件
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | | import com.yuanchu.limslaboratory.pojo.Inspection; |
| | | import com.yuanchu.limslaboratory.pojo.Report; |
| | | import com.yuanchu.limslaboratory.pojo.vo.InspectionVo; |
| | | import com.yuanchu.limslaboratory.service.LinkBasicInformationService; |
| | | import com.yuanchu.limslaboratory.service.RawMaterialService; |
| | |
| | | } |
| | | return Result.success(inspectionService.updateInspectsById(id)); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
ÎļþÃû´Ó inspection-server/src/main/java/com/yuanchu/limslaboratory/controller/ReportCheckController.java ÐÞ¸Ä |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.limslaboratory.pojo.vo.ReportCheckVo; |
| | | import com.yuanchu.limslaboratory.service.ReportCheckService; |
| | | import com.yuanchu.limslaboratory.pojo.vo.ReportAuditingVo; |
| | | import com.yuanchu.limslaboratory.service.ReportAuditingService; |
| | | 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.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | |
| | | */ |
| | | @Api(tags = "æ£éªæ¨¡å-->æ¥åå®¡æ ¸") |
| | | @RestController |
| | | @RequestMapping("/reportCheck") |
| | | public class ReportCheckController { |
| | | @RequestMapping("/reportAuditing") |
| | | public class ReportAuditingController { |
| | | /** |
| | | * æå¡å¯¹è±¡ |
| | | */ |
| | | @Autowired |
| | | private ReportCheckService reportCheckService; |
| | | @Resource |
| | | private ReportAuditingService reportAuditingService; |
| | | |
| | | @ApiOperation("æ¥è¯¢æ¥åå®¡æ ¸å
容") |
| | | @ApiImplicitParams(value = { |
| | |
| | | @ApiImplicitParam(name = "status", value = "ç¶æ(为空=å
¨é¨)", dataTypeClass = Integer.class), |
| | | @ApiImplicitParam(name = "name", value = "æç´¢ä¿¡æ¯", dataTypeClass = String.class) |
| | | }) |
| | | @GetMapping("/selectAllReportCheck") |
| | | @GetMapping("/selectAllReportAuditing") |
| | | public Result selectAllReportCheck(Integer page, Integer pageSize, Integer status, String name) { |
| | | IPage<ReportCheckVo> reportPage = reportCheckService.selectAllReportCheck(new Page<Object>(page, pageSize), status, name); |
| | | IPage<ReportAuditingVo> reportPage = reportAuditingService.selectAllReportAuditing(new Page<Object>(page, pageSize), status, name); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("total", reportPage.getTotal()); |
| | | map.put("row", reportPage.getRecords()); |
| | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | |
| | | /** |
| | | * æå¡å¯¹è±¡ |
| | | */ |
| | | @Autowired |
| | | @Resource |
| | | private ReportService reportService; |
| | | |
| | | @ApiOperation("æ¥è¯¢æ£éªæ¥å") |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.limslaboratory.pojo.Report; |
| | | import com.yuanchu.limslaboratory.pojo.vo.ReportCheckVo; |
| | | import com.yuanchu.limslaboratory.pojo.vo.ReportAuditingVo; |
| | | import com.yuanchu.limslaboratory.pojo.vo.ReportVo; |
| | | |
| | | /** |
| | |
| | | * æ¥è¯¢æ¥åå®¡æ ¸ |
| | | * @return |
| | | */ |
| | | IPage<ReportCheckVo> selectAllReportCheck(Page<Object> page, Integer status, String name); |
| | | IPage<ReportAuditingVo> selectAllReportAuditing(Page<Object> page, Integer status, String name); |
| | | } |
| | | |
| | |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @ApiModel(value="InspectionReport对象", description="") |
| | | @TableName("inspection_report") |
| | | @ApiModel(value="Report对象", description="") |
| | | @TableName("report") |
| | | public class Report implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | |
| | | @ApiModelProperty(value = "å®¡æ ¸ç»è®º") |
| | | private String conclusion; |
| | | |
| | | @ApiModelProperty(value = "å®¡æ ¸äººid") |
| | | private Integer userId; |
| | | @ApiModelProperty(value = "å®¡æ ¸äºº") |
| | | private String approver; |
| | | |
| | | @ApiModelProperty(value = "å
³è ç³è¯·è¡¨id") |
| | | private Integer inspectionId; |
ÎļþÃû´Ó inspection-server/src/main/java/com/yuanchu/limslaboratory/pojo/vo/ReportCheckVo.java ÐÞ¸Ä |
| | |
| | | * æ¥åå®¡æ ¸ |
| | | */ |
| | | @Data |
| | | public class ReportCheckVo { |
| | | public class ReportAuditingVo { |
| | | @ApiModelProperty(value = "æ ·åç¼å·") |
| | | @JsonSerialize |
| | | private String materialCode; |
| | |
| | | @JsonSerialize |
| | | private Integer approver; |
| | | @ApiModelProperty(value = "æäº¤æ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date submitTime; |
| | | @ApiModelProperty(value = "å®¡æ ¸æ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date checkTime; |
| | | } |
| | |
| | | @ApiModelProperty(value = "审æ¹äºº") |
| | | @JsonSerialize |
| | | private Integer approver; |
| | | @ApiModelProperty(value = "审æ¹ç¶æ 0ï¼å¾
æäº¤ 1ï¼å¾
å®¡æ ¸ï¼2ï¼å¾
ç¾åï¼3ï¼å·²å®æ") |
| | | @ApiModelProperty(value = "审æ¹ç¶æ 0ï¼å¾
æäº¤ 1ï¼å¾
å®¡æ ¸ï¼2ï¼å·²å®¡æ ¸") |
| | | @JsonSerialize |
| | | private Integer status; |
| | | @ApiModelProperty(value = "æ£éªç»è®º") |
| | |
| | | private String conclusion; |
| | | @ApiModelProperty(value = "ç¼å¶äºº") |
| | | @JsonSerialize |
| | | private Integer userId; |
| | | private String name; |
| | | } |
ÎļþÃû´Ó inspection-server/src/main/java/com/yuanchu/limslaboratory/service/ReportCheckService.java ÐÞ¸Ä |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yuanchu.limslaboratory.pojo.Report; |
| | | import com.yuanchu.limslaboratory.pojo.vo.ReportCheckVo; |
| | | import com.yuanchu.limslaboratory.pojo.vo.ReportAuditingVo; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2023-08-07 |
| | | */ |
| | | public interface ReportCheckService extends IService<Report> { |
| | | public interface ReportAuditingService extends IService<Report> { |
| | | |
| | | /** |
| | | * 项ç®å®¡æ ¸è¡¨æ¥è¯¢ |
| | | * @return |
| | | */ |
| | | IPage<ReportCheckVo> selectAllReportCheck(Page<Object> page, Integer status, String name); |
| | | IPage<ReportAuditingVo> selectAllReportAuditing(Page<Object> page, Integer status, String name); |
| | | } |
| | | |
| | |
| | | import com.yuanchu.limslaboratory.pojo.vo.InspectDetailVo; |
| | | import com.yuanchu.limslaboratory.pojo.vo.InspectionVo; |
| | | import com.yuanchu.limslaboratory.service.*; |
| | | import com.yuanchu.limslaboratory.utils.MyUtil; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | |
| | | @Resource |
| | | UserMapper userMapper; |
| | | |
| | | @Resource |
| | | ReportMapper reportMapper; |
| | | |
| | | /** |
| | | * æ¥è¯¢æ£éªç³è¯·åå表 |
| | |
| | | .build(); |
| | | inspectionMapper.updateById(inspection); |
| | | //çææ¥åå |
| | | Report report = new Report(); |
| | | //çææ¥ååå· |
| | | String code = MyUtil.getTimeSixNumberCode("BG"); |
| | | //è·åæ£éªç»è®º |
| | | String conclusion = ""; |
| | | Inspection inspection1 = inspectionMapper.selectById(id); |
| | | if (inspection1.getInspectionStatus().equals(1)) { |
| | | conclusion = "åæ ¼"; |
| | | }else { |
| | | conclusion = "ä¸åæ ¼"; |
| | | } |
| | | report.setCode(code); |
| | | report.setStatus(0); |
| | | report.setConclusion(conclusion); |
| | | report.setInspectionId(id); |
| | | reportMapper.insert(report); |
| | | |
| | | return true; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.yuanchu.limslaboratory.mapper.ReportMapper; |
| | | import com.yuanchu.limslaboratory.pojo.Report; |
| | | import com.yuanchu.limslaboratory.pojo.vo.ReportAuditingVo; |
| | | import com.yuanchu.limslaboratory.service.ReportAuditingService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * <p> |
| | | * æå¡å®ç°ç±» |
| | | * </p> |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2023-08-07 |
| | | */ |
| | | @Service |
| | | public class ReportAuditingServiceImpl extends ServiceImpl<ReportMapper, Report> implements ReportAuditingService { |
| | | |
| | | @Resource |
| | | private ReportMapper reportMapper; |
| | | |
| | | /** |
| | | * 项ç®å®¡æ ¸è¡¨æ¥è¯¢ |
| | | * @return |
| | | */ |
| | | @Override |
| | | public IPage<ReportAuditingVo> selectAllReportAuditing(Page<Object> page, Integer status, String name) { |
| | | return reportMapper.selectAllReportAuditing(page, status, name); |
| | | } |
| | | } |
| | | |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * <p> |
| | | * æå¡å®ç°ç±» |
| | |
| | | @Service |
| | | public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> implements ReportService { |
| | | |
| | | @Autowired |
| | | @Resource |
| | | private ReportMapper reportMapper; |
| | | |
| | | /** |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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.ReportMapper"> |
| | | |
| | | <!--æ¥è¯¢æ£éªæ¥å--> |
| | | <select id="selectAllReport" resultType="com.yuanchu.limslaboratory.pojo.vo.ReportVo">select im.code materialCode, |
| | | r.code reportCode, |
| | | i.code inspectionCode, |
| | | r.approver approver, |
| | | r.status status, |
| | | r.conclusion conclusion, |
| | | u.name name |
| | | from report r |
| | | join inspection i on r.inspection_id = i.id |
| | | join user u on i.user_id = u.id |
| | | join inspection_material im on i.id = im.inspection_id |
| | | <where> |
| | | <if test="status != null"> |
| | | and r.status = #{status} |
| | | </if> |
| | | <if test="name != null and name != ''"> |
| | | and im.code like concat('%', #{name}, '%') |
| | | or i.code like concat('%', #{name}, '%') |
| | | or r.code like concat('%', #{name}, '%') |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <!--æ¥è¯¢æ¥åå®¡æ ¸--> |
| | | <select id="selectAllReportAuditing" resultType="com.yuanchu.limslaboratory.pojo.vo.ReportAuditingVo"> |
| | | select im.code materialCode, |
| | | r.code reportCode, |
| | | im.name materialName, |
| | | r.status status, |
| | | r.approver approver, |
| | | DATE_FORMAT(r.`create_time`, '%Y-%m-%d') submitTime, |
| | | DATE_FORMAT(r.`check_time`, '%Y-%m-%d') checkTime |
| | | from report r |
| | | join inspection i on r.inspection_id = i.id |
| | | join inspection_material im on i.id = im.inspection_id |
| | | <where> |
| | | <if test="status != null"> |
| | | and r.status = #{status} |
| | | </if> |
| | | <if test="name != null and name != ''"> |
| | | and im.code like concat('%', #{name}, '%') |
| | | or i.code like concat('%', #{name}, '%') |
| | | or im.name like concat('%', #{name}, '%') |
| | | </if> |
| | | </where> |
| | | </select> |
| | | </mapper> |
| | |
| | | package com.yuanchu.limslaboratory; |
| | | import com.yuanchu.limslaboratory.utils.MyUtil; |
| | | import org.junit.jupiter.api.Test; |
| | | import org.springframework.boot.test.context.SpringBootTest; |
| | | |
| | |
| | | System.out.println("newString === " + newString); |
| | | |
| | | } |
| | | @Test |
| | | void TT() { |
| | | System.out.println(MyUtil.getTimeSixNumberCode("BG")); |
| | | |
| | | } |
| | | } |
| | | |
| | | |