更改种类描述的判断方式、溯源时地图详情sql调整、农资出库时删除数据回滚修复、大屏接受数据增加展示判断
| | |
| | | import org.springblade.core.tool.constant.BladeConstant; |
| | | import org.springblade.core.tool.constant.RoleConstant; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | import org.springblade.modules.farm.entity.FarmingRecord; |
| | | import org.springblade.modules.farm.service.FarmingRecordService; |
| | | import org.springblade.modules.farmplant.entity.FarmPlant; |
| | |
| | | } |
| | | record.setLandId(farmPlant.getLandId()); |
| | | record.setOperator(farmPlant.getCreateUser()); |
| | | if (farmPlant.getVarieties().equals("")){ |
| | | if (StringUtil.isBlank(farmPlant.getVarieties())){ |
| | | record.setContent("品种: " + strain.getStrainName()); |
| | | |
| | | }else { |
| | | record.setContent("品种: " + strain.getStrainName()+"-"+farmPlant.getVarieties()); |
| | | } |
| | |
| | | |
| | | <!--详情信息(自定义查询)--> |
| | | <select id="getLandInfo" resultType="org.springblade.modules.lang.vo.LandVO"> |
| | | select l.user_id, |
| | | select DISTINCT |
| | | l.user_id, |
| | | l.land_name, |
| | | l.land_type, |
| | | l.land_area, |
| | |
| | | and l.is_deleted = 0 |
| | | AND bdb.code = 'landunit' |
| | | and l.id = #{land.id} |
| | | GROUP BY l.user_id,l.land_name,l.land_type,l.land_area,landRange,l.type,l.land_unit,l.url,dica |
| | | </select> |
| | | |
| | | <!--自定义地块数据--> |
| | |
| | | <result column="rid" property="id"/> |
| | | <result column="re_name" property="reName"/> |
| | | <result column="re_url" property="reUrl"/> |
| | | <result column="re_type" property="reType"/> |
| | | </collection> |
| | | </resultMap> |
| | | |
| | | <select id="getRemoteDetailsList" resultMap="typeDTO"> |
| | | select t.id,t.name,t.longitude,t.latitude,r.id rid,r.re_name,r.re_url |
| | | select t.id,t.name,t.longitude,t.latitude,r.id rid,r.re_name,r.re_url,r.re_type |
| | | FROM sys_remote_type t |
| | | LEFT JOIN sys_remote r ON r.type = t.id |
| | | WHERE r.is_deleted = 0 |
| | |
| | | //对库存表操作 |
| | | //判断stockType1 0出库 1入库 |
| | | if (stockRecord.getStockType1() == 0) { |
| | | if (stockRecord.getType1().equals("4")){ //如果是农资退回 |
| | | Soldrecord soldrecord = soldrecordService.getById(stockRecord.getSrId()); |
| | | Soldr soldr = soldrService.getByServalParam(soldrecord.getStockId1(), soldrecord.getSpecs1(), soldrecord.getSpecsVal1(), soldrecord.getSpecsVal2(), soldrecord.getSid(), "0"); |
| | | if (stockRecord.getType1().equals("4")){ //如果是农资退回 |
| | | if (stock.getAmount()<stockRecord.getAmount1()){//库存数量比出入库记录表数量少 没那么多库存补 |
| | | throw new org.springblade.core.log.exception.ServiceException(StringUtil.format("当前库存不足!")); |
| | | }else { |
| | |
| | | } |
| | | }else {//其他出库类型 |
| | | stock.setAmount(stock.getAmount() + stockRecord.getAmount1()); |
| | | soldrecordService.deleteLogic(Func.toLongList(soldrecord.getId().toString())); |
| | | Integer sub = soldr.getAmount1() - stockRecord.getAmount1(); |
| | | soldr.setAmount1(sub); |
| | | soldrService.updateById(soldr); |
| | | } |
| | | } |
| | | else { |