| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.yuanchu.mom.mapper.InspectUnacceptedMapper; |
| | | import com.yuanchu.mom.pojo.InspectUnaccepted; |
| | | import com.yuanchu.mom.service.InspectUnacceptedService; |
| | | import com.yuanchu.mom.pojo.RawInspect; |
| | | import com.yuanchu.mom.pojo.vo.RawInspectVo; |
| | | import com.yuanchu.mom.service.*; |
| | | import com.yuanchu.mom.utils.MyUtil; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | @Resource |
| | | InspectUnacceptedMapper inspectUnacceptedMapper; |
| | | |
| | | // 原材料检验 |
| | | @Autowired |
| | | private RawInspectService rawInspectService; |
| | | |
| | | // // 原材料检验子数据 |
| | | @Autowired |
| | | private RawInsProductService rawInsProductService; |
| | | |
| | | // 半成品检验 |
| | | @Autowired |
| | | private FinishedInspectService finishedInspectService; |
| | | |
| | | // 在制品检验 |
| | | @Autowired |
| | | private ProcessInspectService processInspectService; |
| | | |
| | | //查询成品不合格品检验单列表 |
| | | @Override |
| | | public IPage<Map<String, Object>> selectUnRawInspectsList(Page<Object> page, String formTime, Integer dealState) { |
| | | return inspectUnacceptedMapper.selectInsList(page, formTime, dealState); |
| | | public IPage<Map<String, Object>> selectUnRawInspectsList(Page<Object> page, String formTime, Integer dealState, Integer productCategories) { |
| | | return inspectUnacceptedMapper.selectInsList(page, formTime, dealState, productCategories); |
| | | } |
| | | |
| | | @Override |
| | |
| | | .set(InspectUnaccepted::getTell, tell); |
| | | return inspectUnacceptedMapper.update(new InspectUnaccepted(), updateWrapper); |
| | | } |
| | | } |
| | | |
| | | //评审 |
| | | @Override |
| | | public Integer rawEvaluate(Integer rawId, Integer passOrNo) { |
| | | LambdaUpdateWrapper<InspectUnaccepted> updateWrapper = Wrappers.<InspectUnaccepted>lambdaUpdate() |
| | | .eq(InspectUnaccepted::getId, rawId) |
| | | .set(InspectUnaccepted::getDealReasult, passOrNo); |
| | | return inspectUnacceptedMapper.update(new InspectUnaccepted(), updateWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public Integer editDisposalOpinionConfirmation(Integer rawUnacceptedId, String opinionTell, Integer way, Integer type) { |
| | | LambdaUpdateWrapper<InspectUnaccepted> updateWrapper = Wrappers.<InspectUnaccepted>lambdaUpdate() |
| | | .eq(InspectUnaccepted::getId, rawUnacceptedId) |
| | | .set(InspectUnaccepted::getWay, way) |
| | | .set(InspectUnaccepted::getOpinionTell, opinionTell); |
| | | if (way == 1){ |
| | | // 等于0:原材料 |
| | | if (type == 0){ |
| | | // 根据Id查询原材料检验信息信息 |
| | | RawInspectVo map = inspectUnacceptedMapper.editDisposalOpinionConfirmation(rawUnacceptedId); |
| | | RawInspect rawInspect = new RawInspect(); |
| | | BeanUtils.copyProperties(map, rawInspect); |
| | | // 保存父级 |
| | | rawInspectService.save(rawInspect); |
| | | // 批量保存子级 |
| | | rawInsProductService.batchAddInsProduct(rawInspect.getId(), map.getRawInsProducts()); |
| | | } |
| | | // 等于1:半成品 |
| | | else if (type == 1) { |
| | | // TODO 该接口只剩余这两处 |
| | | } |
| | | // 等于2:在制品 |
| | | else if (type == 2) { |
| | | // TODO 该接口只剩余这两处 |
| | | } |
| | | } else if (way == 2 || way == 3 || way == 4){ |
| | | updateWrapper.set(InspectUnaccepted::getFaultyMaterials, 1); |
| | | } |
| | | return inspectUnacceptedMapper.update(new InspectUnaccepted(), updateWrapper); |
| | | } |
| | | } |