| | |
| | | import com.ld.igds.check.dto.CheckItemData; |
| | | import com.ld.igds.check.dto.CheckUpdateResult; |
| | | import com.ld.igds.check.service.CoreCheckStandardService; |
| | | import com.ld.igds.inout.InoutConstant; |
| | | import com.ld.igds.util.ContextUtil; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | * |
| | | * @param checkId |
| | | * @param companyId |
| | | * @param deptId |
| | | * @param foodVariety |
| | | * @return |
| | | */ |
| | | public List<CheckItemData> listCheckItem(String checkId, String companyId, |
| | | String deptId, String foodVariety) { |
| | | public List<CheckItemData> listCheckItem(String checkId, String companyId, String foodVariety) { |
| | | if (StringUtils.isEmpty(companyId)) { |
| | | companyId = ContextUtil.getCompanyId(); |
| | | } |
| | | if (StringUtils.isEmpty(deptId)) { |
| | | deptId = ContextUtil.subDeptId(ContextUtil.getLoginUser()); |
| | | } |
| | | |
| | | List<CheckItemData> list = checkStandardService.getCheckItemById(checkId, companyId); |
| | | |
| | | if (list == null || list.isEmpty()) { |
| | | list = checkStandardService.getCheckItemByStandard(checkId, companyId, deptId, foodVariety); |
| | | list = checkStandardService.getCheckItemByStandard(checkId, companyId, foodVariety); |
| | | } |
| | | return list; |
| | | } |
| | |
| | | item.setUpperLimit(0.0); |
| | | } |
| | | |
| | | //水分信息回填 |
| | | if (InoutConstant.CHECK_ITEM_C01.equals(item.getStandardId()) || InoutConstant.CHECK_ITEM_C020101.equals(item.getStandardId())) { |
| | | if(null != item.getValue()) result.setWet(Double.valueOf(item.getValue())); |
| | | |
| | | if (item.getDeNum() > 0) { |
| | | result.setDeSum(result.getDeSum() + item.getDeNum()); |
| | | } |
| | | //杂质信息回填 |
| | | if (InoutConstant.CHECK_ITEM_C02.equals(item.getStandardId()) || InoutConstant.CHECK_ITEM_C01010301.equals(item.getStandardId())) { |
| | | if(null != item.getValue()) result.setImpurity(Double.valueOf(item.getValue())); |
| | | if (item.getAddNum() > 0) { |
| | | result.setAddSum(result.getAddSum() + item.getAddNum()); |
| | | } |
| | | |
| | | if (item.getAddPrice() > 0) { |
| | | result.setAddPriceSum(result.getAddPriceSum() + item.getAddPrice()); |
| | | } |
| | | |
| | | if (item.getDePrice() > 0) { |
| | | result.setDePriceSum(result.getDePriceSum() + item.getDePrice()); |
| | | } |
| | | |
| | | //先更新,更新失败则新增 |
| | | int i = checkStandardService.updateCheckItem(item); |
| | | if (i < 1) { |