| | |
| | | public R update(@Valid @RequestBody Farm farm) { |
| | | farm.setUpdateTime(new Date()); |
| | | //坐标转换 |
| | | if (null != farm.getPosition() && !farm.getPosition().equals("")) { |
| | | //替换逗号为空格 |
| | | String sNull = farm.getPosition().replaceAll(",", " "); |
| | | //替换分号为逗号 |
| | | String replaceAll = sNull.replaceAll(";", ","); |
| | | farm.setPosition("'POLYGON((" + replaceAll + "))'"); |
| | | } |
| | | // if (null != farm.getPosition() && !farm.getPosition().equals("")) { |
| | | // //替换逗号为空格 |
| | | // String sNull = farm.getPosition().replaceAll(",", " "); |
| | | // //替换分号为逗号 |
| | | // String replaceAll = sNull.replaceAll(";", ","); |
| | | // farm.setPosition("'POLYGON((" + replaceAll + "))'"); |
| | | // } |
| | | //更新并返回 |
| | | return R.status(farmService.updateFarmById(farm)); |
| | | } |
| | |
| | | panoramic = #{farm.panoramic}, |
| | | longitude = #{farm.longitude}, |
| | | latitude = #{farm.latitude}, |
| | | <if test="farm.position!=null and farm.position!=''"> |
| | | position = ST_GeomFromText(${farm.position}), |
| | | </if> |
| | | <!-- <if test="farm.position!=null and farm.position!=''">--> |
| | | <!-- position = ST_GeomFromText(${farm.position}),--> |
| | | <!-- </if>--> |
| | | update_time = #{farm.updateTime} |
| | | where id = #{farm.id} |
| | | </update> |
| | |
| | | stock.setState("0"); |
| | | stockService.Updaet(stock); |
| | | //删除 |
| | | soldrService.del(soldrVOs.getId()); |
| | | // soldrService.del(soldrVOs.getId()); |
| | | soldrService.delLogic(soldrVOs.getId()); |
| | | } |
| | | //如果小于就修改 |
| | | else { |