|
@@ -8,6 +8,7 @@ import com.steerinfo.dil.util.DataChange;
|
|
|
import com.steerinfo.framework.controller.RESTfulResult;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
@@ -92,13 +93,43 @@ public class BackgroundProcessingController extends BaseRESTfulController {
|
|
|
|
|
|
@ApiOperation(value = "更新运输订单状态接口")
|
|
|
@PostMapping("updateOrderStatus")
|
|
|
- public RESTfulResult updateOrderStatus(@RequestBody(required = false) Map<String,Object> map){
|
|
|
- if(map.get("orderNumber") != null){
|
|
|
- if(DataChange.dataToBigDecimal(map.get("orderStatus")).intValue() != 2) {
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ public RESTfulResult updateOrderStatus(@RequestBody(required = false) Map<String,Object> map) throws Exception{
|
|
|
+ if (map.get("orderNumber") != null) {
|
|
|
+ if (DataChange.dataToBigDecimal(map.get("orderStatus")).intValue() != 2) {
|
|
|
int i = backgroundProcessingMapper.updateOrderStatus(map);
|
|
|
+ if(i > 1){
|
|
|
+ throw new Exception("该订单号有多个运单,不允许修改,请去数据库手动修改订单状态!");
|
|
|
+ }
|
|
|
return success(i);
|
|
|
}
|
|
|
}
|
|
|
return failed(0);
|
|
|
}
|
|
|
+
|
|
|
+ @ApiOperation(value = "内转/采购新增上传金蝶表")
|
|
|
+ @PostMapping("insertToUploadEas")
|
|
|
+ public RESTfulResult insertToUploadEas(@RequestBody(required = false) Map<String,Object> map){
|
|
|
+ try {
|
|
|
+ Map<String,Object> purchaseOrder = (Map<String, Object>) map.get("purchaseOrder");
|
|
|
+ List<Map<String,Object>> list= (List<Map<String, Object>>) map.get("list");
|
|
|
+ for(Map<String,Object> item:list){
|
|
|
+ item.put("purchaseOrderNo",purchaseOrder.get("purchaseOrderNo"));
|
|
|
+ backgroundProcessingMapper.insertNotUpload(item);
|
|
|
+ }
|
|
|
+ }catch (NullPointerException e){
|
|
|
+ e.printStackTrace();
|
|
|
+ return failed("缺乏参数!");
|
|
|
+ }catch (Exception e){
|
|
|
+ e.printStackTrace();
|
|
|
+ return failed("未知异常!");
|
|
|
+ }
|
|
|
+ return success("修改成功,稍后会自动上传金蝶!");
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "重置钢材打印数量")
|
|
|
+ @PostMapping("resetPrintNumber")
|
|
|
+ public RESTfulResult resetPrintNumber(@RequestBody(required = false) Map<String,Object> map){
|
|
|
+ return success(backgroundProcessingMapper.resetPrintNumber(map));
|
|
|
+ }
|
|
|
}
|