|
|
@@ -0,0 +1,43 @@
|
|
|
+package com.java110.community.cmd.parkingArea;
|
|
|
+
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.java110.core.annotation.Java110Cmd;
|
|
|
+import com.java110.core.annotation.Java110Transactional;
|
|
|
+import com.java110.core.context.ICmdDataFlowContext;
|
|
|
+import com.java110.core.event.cmd.AbstractServiceCmdListener;
|
|
|
+import com.java110.core.event.cmd.CmdEvent;
|
|
|
+import com.java110.intf.community.IParkingAreaAttrV1InnerServiceSMO;
|
|
|
+import com.java110.intf.community.IParkingAreaV1InnerServiceSMO;
|
|
|
+import com.java110.po.parking.ParkingAreaPo;
|
|
|
+import com.java110.utils.exception.CmdException;
|
|
|
+import com.java110.utils.util.Assert;
|
|
|
+import com.java110.utils.util.BeanConvertUtil;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+
|
|
|
+@Java110Cmd(serviceCode = "parkingArea.deleteParkingArea")
|
|
|
+public class DeleteParkingAreaCmd extends AbstractServiceCmdListener {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IParkingAreaV1InnerServiceSMO parkingAreaV1InnerServiceSMOImpl;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IParkingAreaAttrV1InnerServiceSMO parkingAreaAttrV1InnerServiceSMOImpl;
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
|
|
|
+ //Assert.hasKeyAndValue(reqJson, "xxx", "xxx");
|
|
|
+ Assert.hasKeyAndValue(reqJson, "communityId", "必填,请填写小区信息");
|
|
|
+ Assert.hasKeyAndValue(reqJson, "paId", "停车场ID不能为空");
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ @Java110Transactional
|
|
|
+ public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
|
|
|
+
|
|
|
+ ParkingAreaPo parkingAreaPo = BeanConvertUtil.covertBean(reqJson, ParkingAreaPo.class);
|
|
|
+ int flag = parkingAreaV1InnerServiceSMOImpl.deleteParkingArea(parkingAreaPo);
|
|
|
+ if (flag < 1) {
|
|
|
+ throw new CmdException("保存停车场失败");
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|