6 changed files with 143 additions and 2 deletions
-
20src/main/java/com/gaotao/modules/oa/dao/SoRoutingMapper.java
-
78src/main/java/com/gaotao/modules/shopOrder/controller/SoRoutingController.java
-
28src/main/java/com/gaotao/modules/shopOrder/entity/RouteInShopOrderData.java
-
12src/main/resources/mapper/oa/SoRoutingMapper.xml
-
4src/main/resources/mapper/productionInbound/ProductionInboundMapper.xml
-
3src/main/resources/mapper/shopOrder/ShopOrderMapper.xml
@ -0,0 +1,78 @@ |
|||
package com.gaotao.modules.shopOrder.controller; |
|||
|
|||
import com.gaotao.common.constant.SysMsgConstant; |
|||
import com.gaotao.common.utils.R; |
|||
import com.gaotao.modules.oa.dao.SoRoutingMapper; |
|||
import com.gaotao.modules.sys.controller.AbstractController; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.PostMapping; |
|||
import org.springframework.web.bind.annotation.RequestBody; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
import java.math.BigDecimal; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 生产订单工艺路线Controller |
|||
* |
|||
* @author sxm |
|||
* @date 2024-12-11 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("shoporder/sorouting") |
|||
public class SoRoutingController extends AbstractController { |
|||
|
|||
@Autowired |
|||
private SoRoutingMapper soRoutingMapper; |
|||
|
|||
/** |
|||
* 批量更新工艺路线(生产总数、总卷数、每卷总数、备注) |
|||
* @param params 工艺路线数据列表 |
|||
* @return R |
|||
*/ |
|||
@PostMapping("/batchUpdateSORouting") |
|||
public R batchUpdateSORouting(@RequestBody List<Map<String, Object>> params) { |
|||
try { |
|||
for (Map<String, Object> item : params) { |
|||
String site = (String) item.get("site"); |
|||
String orderNo = (String) item.get("orderNo"); |
|||
Object itemNoObj = item.get("itemNo"); |
|||
Double itemNo = null; |
|||
if (itemNoObj instanceof Number) { |
|||
itemNo = ((Number) itemNoObj).doubleValue(); |
|||
} else if (itemNoObj instanceof String) { |
|||
itemNo = Double.parseDouble((String) itemNoObj); |
|||
} |
|||
|
|||
Object productionQtyObj = item.get("productionQty"); |
|||
BigDecimal productionQty = null; |
|||
if (productionQtyObj instanceof Number) { |
|||
productionQty = new BigDecimal(productionQtyObj.toString()); |
|||
} |
|||
|
|||
Object totalRollQtyObj = item.get("totalRollQty"); |
|||
BigDecimal totalRollQty = null; |
|||
if (totalRollQtyObj instanceof Number) { |
|||
totalRollQty = new BigDecimal(totalRollQtyObj.toString()); |
|||
} |
|||
|
|||
Object totalPerVolumeObj = item.get("totalPerVolume"); |
|||
BigDecimal totalPerVolume = null; |
|||
if (totalPerVolumeObj instanceof Number) { |
|||
totalPerVolume = new BigDecimal(totalPerVolumeObj.toString()); |
|||
} |
|||
|
|||
String remark = (String) item.get("remark"); |
|||
|
|||
soRoutingMapper.batchUpdateRoutingFields(site, orderNo, itemNo, |
|||
productionQty, totalRollQty, totalPerVolume, remark); |
|||
} |
|||
return R.ok(getLanguageMsg(SysMsgConstant.OBJECT_ID_200000)); |
|||
} catch (Exception e) { |
|||
return R.error("批量更新失败:" + e.getMessage()); |
|||
} |
|||
} |
|||
} |
|||
|
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue