| | |
| | | package com.yuanchu.mom.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.FieldFill; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty("主键ID") |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty("创建人") |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.mom.pojo.InformationNotification; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yuanchu.mom.pojo.InformationNotification; |
| | | import com.yuanchu.mom.pojo.InformationNotificationDto; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | Boolean checkForUnreadData(); |
| | | |
| | | void triggerModificationStatusToRead(Integer id); |
| | | |
| | | int addInformationNotification(InformationNotification informationNotification); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.yuanchu.mom.common.GetLook; |
| | | import com.yuanchu.mom.pojo.InformationNotification; |
| | | import com.yuanchu.mom.mapper.InformationNotificationMapper; |
| | | import com.yuanchu.mom.pojo.InformationNotification; |
| | | import com.yuanchu.mom.pojo.InformationNotificationDto; |
| | | import com.yuanchu.mom.service.InformationNotificationService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | @Service |
| | | public class InformationNotificationServiceImpl extends ServiceImpl<InformationNotificationMapper, InformationNotification> implements InformationNotificationService { |
| | | |
| | | @Autowired |
| | | @Resource |
| | | private GetLook getLook; |
| | | |
| | | @Override |
| | | public IPage<InformationNotificationDto> getPage(Page page, String messageType) { |
| | | Map<String, Integer> map1 = getLook.selectPowerByMethodAndUserId("selectInsOrderParameter"); |
| | | Map<String, Integer> map1 = getLook.selectPowerByMethodAndUserId(null); |
| | | return baseMapper.getPage(page, messageType, map1.get("userId")); |
| | | } |
| | | |
| | |
| | | .eq(InformationNotification::getId, id) |
| | | .set(InformationNotification::getViewStatus, true)); |
| | | } |
| | | |
| | | @Override |
| | | public int addInformationNotification(InformationNotification informationNotification) { |
| | | return baseMapper.insert(informationNotification); |
| | | } |
| | | } |
| | |
| | | @ValueClassify("检验任务") |
| | | @ApiOperation(value = "检验任务提交") |
| | | @PostMapping("/submitPlan") |
| | | public Result<?> submitPlan(Integer orderId, String laboratory) { |
| | | int num = insOrderPlanService.submitPlan(orderId, laboratory); |
| | | public Result<?> submitPlan(Integer orderId, String laboratory, Integer verifyUser) { |
| | | int num = insOrderPlanService.submitPlan(orderId, laboratory, verifyUser); |
| | | return num==1?Result.success():Result.fail("提交失败,部分项目还未进行检验"); |
| | | } |
| | | |
| | |
| | | |
| | | @TableField(exist = false) |
| | | private String templateName; |
| | | |
| | | private String dic; |
| | | } |
| | |
| | | |
| | | int verifyPlan(Integer orderId, String laboratory, Integer type, String tell); |
| | | |
| | | int submitPlan(Integer orderId, String laboratory); |
| | | int submitPlan(Integer orderId, String laboratory, Integer verifyUser); |
| | | } |
| | |
| | | import com.yuanchu.mom.exception.ErrorException; |
| | | import com.yuanchu.mom.mapper.*; |
| | | import com.yuanchu.mom.pojo.*; |
| | | import com.yuanchu.mom.service.InformationNotificationService; |
| | | import com.yuanchu.mom.service.InsOrderPlanService; |
| | | import com.yuanchu.mom.service.InsOrderService; |
| | | import com.yuanchu.mom.service.StandardTemplateService; |
| | |
| | | |
| | | @Resource |
| | | private InsProductUserMapper insProductUserMapper; |
| | | |
| | | @Resource |
| | | private InformationNotificationService informationNotificationService; |
| | | |
| | | @Override |
| | | public Map<String, Object> selectInsOrderPlanList(Page page, InsOrderPlanDTO insOrderPlanDTO) { |
| | |
| | | } |
| | | |
| | | @Override |
| | | public int submitPlan(Integer orderId, String laboratory) { |
| | | public int submitPlan(Integer orderId, String laboratory, Integer verifyUser) { |
| | | List<InsSample> insSamples = insSampleMapper.selectList(Wrappers.<InsSample>lambdaQuery().eq(InsSample::getInsOrderId, orderId).select(InsSample::getId)); |
| | | List<Integer> ids = insSamples.stream().map(a -> a.getId()).collect(Collectors.toList()); |
| | | List<InsProduct> insProducts = insProductMapper.selectList(Wrappers.<InsProduct>lambdaQuery().in(InsProduct::getInsSampleId, ids).eq(InsProduct::getSonLaboratory, laboratory).eq(InsProduct::getState, 1).isNull(InsProduct::getInsResult)); |
| | |
| | | } |
| | | throw new ErrorException("以下是未检验的项目:" + str); |
| | | } |
| | | insOrderStateMapper.update(null, Wrappers.<InsOrderState>lambdaUpdate().eq(InsOrderState::getInsOrderId, orderId).eq(InsOrderState::getLaboratory, laboratory).set(InsOrderState::getInsTime, LocalDateTime.now()).set(InsOrderState::getInsState, 3)); |
| | | insOrderStateMapper.update(null, Wrappers.<InsOrderState>lambdaUpdate().eq(InsOrderState::getInsOrderId, orderId).eq(InsOrderState::getLaboratory, laboratory).set(InsOrderState::getInsTime, LocalDateTime.now()).set(InsOrderState::getInsState, 3).set(InsOrderState::getVerifyUser, verifyUser)); |
| | | Integer userId = getLook.selectPowerByMethodAndUserId(null).get("userId"); |
| | | InformationNotification info = new InformationNotification(); |
| | | info.setCreateUser(insProductMapper.selectUserById(userId).get("name")); |
| | | info.setMessageType("2"); |
| | | info.setTheme("复核通知"); |
| | | info.setContent("您有一条检验任务待复核消息"); |
| | | info.setSenderId(userId); |
| | | info.setConsigneeId(verifyUser); |
| | | info.setViewStatus(false); |
| | | info.setJumpPath("b1-inspect-order-plan"); |
| | | informationNotificationService.addInformationNotification(info); |
| | | upPlanUser(userId, orderId); |
| | | return 1; |
| | | } |
| | | |
| | |
| | | product.setUpdateTime(null); |
| | | product.setUpdateUser(null); |
| | | product.setInsSampleId(a.getId()); |
| | | if(product.getInspectionItemSubclass() == null){ |
| | | product.setInspectionItemSubclass(""); |
| | | } |
| | | insProductMapper.insert(product); |
| | | } |
| | | } |
| | |
| | | |
| | | @Override |
| | | public List<StandardProductList> selectStandardProductList(InsSample insSample) { |
| | | String[] models = insSample.getModel().split("-"); |
| | | String[] models = insSample.getModel().split("-(?=[^-]*$)");//拆分最后一个【-】 |
| | | List<StandardProductList> list = standardProductListMapper.selectList(Wrappers.<StandardProductList>lambdaQuery().eq(StandardProductList::getStandardMethodListId, insSample.getStandardMethodListId()).eq(StandardProductList::getState, 1).eq(StandardProductList::getModel, models[0])); |
| | | list = list.stream().filter(a -> { |
| | | try { |
| | |
| | | |
| | | private Integer orderUserId; |
| | | |
| | | private Integer verifyUser; |
| | | |
| | | } |
| | |
| | | <select id="findInsSampleAndOrder" resultType="com.yuanchu.mom.vo.InsOrderPlanVO"> |
| | | select * from( |
| | | SELECT |
| | | a.*,ios.ins_state,ios.verify_tell,isu2.order_user_id |
| | | a.*,ios.ins_state,ios.verify_tell,isu2.order_user_id,(ios.verify_user = #{userId}) verify_user |
| | | FROM |
| | | ( |
| | | SELECT |
| | |
| | | ipr.equip_value, |
| | | ipr.equip_name, |
| | | ip.method_s, |
| | | ip.tell |
| | | ip.tell, |
| | | ip.dic |
| | | from ins_sample isa |
| | | left join ins_product ip on isa.id = ip.ins_sample_id |
| | | left join ins_product_result ipr on ip.id = ipr.ins_product_id |
| | |
| | | <result property="templateId" column="template_id" jdbcType="INTEGER"/> |
| | | <result property="methodS" column="method_s"/> |
| | | <result property="tell" column="tell"/> |
| | | <result property="dic" column="dic"/> |
| | | <collection property="insProductResult" resultMap="insProductResult"/> |
| | | </resultMap> |
| | | |
| | |
| | | @ApiModelProperty(value = "单位") |
| | | private String company; |
| | | |
| | | @ValueTableShow(8) |
| | | @ValueTableShow(14) |
| | | @ApiModelProperty(value = "单位地址") |
| | | private String address; |
| | | |