| | |
| | | public Result selectSampleDefects(Integer size, Integer current, String inspectionItems, String orderNumber) { |
| | | return Result.success(insOrderService.selectSampleDefects(new Page<>(current, size),inspectionItems, orderNumber)); |
| | | } |
| | | } |
| | | |
| | | @ValueClassify("检验下单") |
| | | @ApiOperation(value = "更新状态") |
| | | @PutMapping("/updateStatus") |
| | | public Result<?> updateStatus(Integer id) { |
| | | insOrderService.updateStatus(id); |
| | | return Result.success(); |
| | | } |
| | | @ValueClassify("检验下单") |
| | | @ApiOperation("将待检验的的撤销更改") |
| | | @PutMapping("/updateInspected") |
| | | public Result<?> updateInspected(Integer id){ |
| | | insProductService.updateInspected(id); |
| | | return Result.success(); |
| | | } |
| | | } |
| | |
| | | import com.yuanchu.mom.dto.SampleProductDto2; |
| | | import com.yuanchu.mom.pojo.InsOrder; |
| | | import com.yuanchu.mom.vo.SampleDefectsFatherVo; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | String getEnumLabelByValue(String value); |
| | | |
| | | String getStandardMethodCode(Integer id); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | int updateStatus( Integer id); |
| | | } |
| | |
| | | import com.yuanchu.mom.dto.ProductResultDto2; |
| | | import com.yuanchu.mom.pojo.InsProduct; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | |
| | | List<ProductResultDto2> getProductAndResult(Integer sampleId); |
| | | |
| | | int updateInspected(@Param("id") Integer id); |
| | | } |
| | | |
| | | |
| | |
| | | Map<String, Object> costStatistics(IPage<CostStatisticsDto> page, CostStatisticsDto costStatisticsDto); |
| | | |
| | | Map<String, Object> selectSampleDefects(Page page, String inspectionItems, String orderNumber); |
| | | |
| | | int updateStatus(Integer id); |
| | | } |
| | |
| | | |
| | | int selectOrderManDay(Integer orderId); |
| | | |
| | | int updateInspected(Integer id); |
| | | } |
| | |
| | | map.put("total", aLong); |
| | | return map; |
| | | } |
| | | |
| | | @Override |
| | | public int updateStatus(Integer id) { |
| | | return insOrderMapper.updateStatus(id); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | @Service |
| | | @AllArgsConstructor |
| | | public class InsProductServiceImpl extends ServiceImpl<InsProductMapper, InsProduct> |
| | | implements InsProductService { |
| | | implements InsProductService { |
| | | |
| | | private InsProductMapper insProductMapper; |
| | | private InsProductMapper insProductMapper; |
| | | |
| | | @Override |
| | | public int selectOrderManDay(Integer orderId) { |
| | | return insProductMapper.selectOrderManDay(orderId); |
| | | } |
| | | @Override |
| | | public int selectOrderManDay(Integer orderId) { |
| | | return insProductMapper.selectOrderManDay(orderId); |
| | | } |
| | | |
| | | @Override |
| | | public int updateInspected(Integer id) { |
| | | insProductMapper.updateInspected(id); |
| | | return 0; |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | id=#{id} |
| | | </where> |
| | | </update> |
| | | <update id="updateStatus"> |
| | | update ins_order set state=3 where id=#{id} |
| | | </update> |
| | | |
| | | <select id="selectSampleDefects" resultMap="selectSampleDefectsMap"> |
| | | SELECT io.entrust_code,sam.sample,ip.inspection_item,u.name,b.create_time, sam.id |
| | |
| | | <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/> |
| | | <result property="templateId" column="template_id" jdbcType="INTEGER"/> |
| | | </resultMap> |
| | | <update id="updateInspected"> |
| | | UPDATE ins_product p |
| | | SET p.state=0 |
| | | WHERE EXISTS( |
| | | SELECT 1 |
| | | FROM ins_sample s |
| | | WHERE s.ins_order_id IN ( |
| | | SELECT o.id |
| | | FROM ins_order o |
| | | WHERE o.id = #{id} |
| | | ) |
| | | AND p.ins_sample_id = s.id |
| | | AND p.state = 1 |
| | | AND p.ins_result IS NULL |
| | | ); |
| | | </update> |
| | | |
| | | <select id="selectOrderManDay" resultType="java.lang.Integer"> |
| | | select coalesce(max(ip.man_day), 0) from ins_order io |
| | | left join ins_sample isa on io.id = isa.ins_order_id |
| | | left join ins_product ip on isa.id = ip.ins_sample_id |
| | | select coalesce(max(ip.man_day), 0) |
| | | from ins_order io |
| | | left join ins_sample isa on io.id = isa.ins_order_id |
| | | left join ins_product ip on isa.id = ip.ins_sample_id |
| | | where io.id = #{orderId} |
| | | </select> |
| | | <select id="selectUserById" resultType="java.util.Map"> |
| | | select name,company,phone,address,name_en from user where id = #{userId} |
| | | select name, company, phone, address, name_en |
| | | from user |
| | | where id = #{userId} |
| | | </select> |
| | | <select id="getProductAndResult" resultType="com.yuanchu.mom.dto.ProductResultDto2"> |
| | | select ip.id,ip.inspection_item,ip.inspection_item_subclass,ip.laboratory,ip.unit,ipr.equip_value,io.entrust_code,ipr.update_time,ip.ins_result,u.name updateUserName |
| | | select ip.id, |
| | | ip.inspection_item, |
| | | ip.inspection_item_subclass, |
| | | ip.laboratory, |
| | | ip.unit, |
| | | ipr.equip_value, |
| | | io.entrust_code, |
| | | ipr.update_time, |
| | | ip.ins_result, |
| | | u.name updateUserName |
| | | from ins_product ip |
| | | left join ins_product_result ipr on ip.id = ipr.ins_product_id |
| | | left join ins_sample isa on isa.id = ip.ins_sample_id |
| | | left join ins_order io on io.id = isa.ins_order_id |
| | | left join user u on u.id = ipr.update_user |
| | | left join ins_product_result ipr on ip.id = ipr.ins_product_id |
| | | left join ins_sample isa on isa.id = ip.ins_sample_id |
| | | left join ins_order io on io.id = isa.ins_order_id |
| | | left join user u on u.id = ipr.update_user |
| | | where ip.ins_sample_id = #{sampleId} |
| | | and ip.ins_result is not null |
| | | and ip.ins_result is not null |
| | | </select> |
| | | </mapper> |