|
|
@@ -6,8 +6,11 @@ import com.java110.api.listener.AbstractServiceApiPlusListener;
|
|
|
import com.java110.core.annotation.Java110Listener;
|
|
|
import com.java110.core.context.DataFlowContext;
|
|
|
import com.java110.core.event.service.api.ServiceDataFlowEvent;
|
|
|
+import com.java110.core.factory.GenerateCodeFactory;
|
|
|
import com.java110.dto.allocationStorehouse.AllocationStorehouseDto;
|
|
|
+import com.java110.dto.purchaseApply.PurchaseApplyDto;
|
|
|
import com.java110.dto.resourceStore.ResourceStoreDto;
|
|
|
+import com.java110.intf.common.IAllocationStorehouseUserInnerServiceSMO;
|
|
|
import com.java110.intf.store.IResourceStoreInnerServiceSMO;
|
|
|
import com.java110.po.allocationStorehouse.AllocationStorehousePo;
|
|
|
import com.java110.po.purchase.ResourceStorePo;
|
|
|
@@ -17,6 +20,8 @@ import com.java110.utils.util.Assert;
|
|
|
import com.java110.utils.util.BeanConvertUtil;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.http.HttpMethod;
|
|
|
+import org.springframework.http.HttpStatus;
|
|
|
+import org.springframework.http.ResponseEntity;
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
@@ -33,6 +38,9 @@ public class SaveAllocationStorehouseListener extends AbstractServiceApiPlusList
|
|
|
@Autowired
|
|
|
private IResourceStoreInnerServiceSMO resourceStoreInnerServiceSMOImpl;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private IAllocationStorehouseUserInnerServiceSMO allocationStorehouseUserInnerServiceSMOImpl;
|
|
|
+
|
|
|
@Override
|
|
|
protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
|
|
|
//Assert.hasKeyAndValue(reqJson, "xxx", "xxx");
|
|
|
@@ -69,7 +77,7 @@ public class SaveAllocationStorehouseListener extends AbstractServiceApiPlusList
|
|
|
@Override
|
|
|
protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
|
|
|
|
|
|
- reqJson.put("asId", "-1");
|
|
|
+ reqJson.put("asId", GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_allocationStorehouseId));
|
|
|
AllocationStorehousePo allocationStorehousePo = BeanConvertUtil.covertBean(reqJson, AllocationStorehousePo.class);
|
|
|
allocationStorehousePo.setRemark(reqJson.getString("remark"));
|
|
|
allocationStorehousePo.setStartUserId(reqJson.getString("userId"));
|
|
|
@@ -87,6 +95,17 @@ public class SaveAllocationStorehouseListener extends AbstractServiceApiPlusList
|
|
|
int stockB = Integer.parseInt(reqJson.getString("stock"));
|
|
|
resourceStorePo.setStock((stockA - stockB) + "");
|
|
|
super.update(context, resourceStorePo, BusinessTypeConstant.BUSINESS_TYPE_UPDATE_RESOURCE_STORE);
|
|
|
+ commit(context);
|
|
|
+
|
|
|
+ ResponseEntity<String> responseEntity = context.getResponseEntity();
|
|
|
+
|
|
|
+ //开始流程
|
|
|
+ if (HttpStatus.OK == responseEntity.getStatusCode()) {
|
|
|
+ AllocationStorehouseDto allocationStorehouseDto = BeanConvertUtil.covertBean(reqJson, AllocationStorehouseDto.class);
|
|
|
+ allocationStorehouseDto.setCurrentUserId(reqJson.getString("userId"));
|
|
|
+ allocationStorehouseUserInnerServiceSMOImpl.startProcess(allocationStorehouseDto);
|
|
|
+ }
|
|
|
+ context.setResponseEntity(responseEntity);
|
|
|
}
|
|
|
|
|
|
@Override
|