| | |
| | | import org.springblade.modules.farm.entity.FarmingRecord; |
| | | import org.springblade.modules.farm.service.FarmingRecordService; |
| | | import org.springblade.modules.farm.vo.FarmingRecordVO; |
| | | import org.springblade.modules.farmplant.entity.Strain; |
| | | import org.springblade.modules.farmplant.service.StrainService; |
| | | import org.springblade.modules.soldr.entity.Soldr; |
| | | import org.springblade.modules.soldr.service.ISoldrService; |
| | | import org.springblade.modules.soldrecord.service.ISoldrecordService; |
| | |
| | | private final ISoldrService soldrService; |
| | | private final ISoldrecordService soldrecordService; |
| | | private final IStockfactoryService stockfactoryService; |
| | | |
| | | private final StrainService strainService; |
| | | /** |
| | | * 详情 |
| | | */ |
| | |
| | | stockfactory.setId(ids); |
| | | Stockfactory detailstock = stockfactoryService.getOne(Condition.getQueryWrapper(stockfactory)); |
| | | String agriculturalName = detailstock.getAgriculturalName(); |
| | | String content = agriculturalName + " " + v + "公斤"; |
| | | Strain strain = strainService.getById(farm.getStrainId()); |
| | | String content =strain.getStrainName()+"-"+ agriculturalName + " " + v + "公斤"; |
| | | farm.setContent(content); |
| | | //使用农资数量等于已出农资数量 |
| | | if (farm.getSnum() == detail.getAmount1()) { |
| | | soldrService.dels(id); |
| | | } else { |
| | | soldrecordService.updateSold(amount1 - farm.getSnum(), id, detail.getCensus() - v); |
| | | detail.setAmount1(detail.getAmount1()-farm.getSnum()); |
| | | soldrService.updateById(detail); |
| | | } |
| | | } |
| | | return R.status(farmService.save(farm)); |