rev:拆拼盘修改

This commit is contained in:
2023-06-01 11:28:45 +08:00
parent 8fc96a773d
commit a160d1cd5d
7 changed files with 89 additions and 12 deletions

View File

@@ -65,5 +65,13 @@ public class StIvtShutframeinvBcpController {
public ResponseEntity<Object> getBillDtl(@RequestBody JSONObject jo) {
return new ResponseEntity<>(shutframeinvBcpService.getBillDtl(jo), HttpStatus.OK);
}
@PostMapping("/confirm")
@Log("拼盘确认")
@ApiOperation("拼盘确认")
public ResponseEntity<Object> confirm(@RequestBody JSONObject jo) {
shutframeinvBcpService.confirm(jo);
return new ResponseEntity<>(HttpStatus.OK);
}
}

View File

@@ -34,5 +34,7 @@ public interface IStIvtShutframeinvBcpService extends IService<StIvtShutframeinv
List<Map> getBillDtl(JSONObject jo);
void confirm(JSONObject jo);
}

View File

@@ -34,15 +34,13 @@ import java.util.LinkedList;
@Service
public class StIvtShutframedtlBcpServiceImpl extends ServiceImpl<StIvtShutframedtlBcpMapper, StIvtShutframedtlBcp> implements IStIvtShutframedtlBcpService {
private StIvtStructattr first_struct;
private StIvtStructattr last_struct;
@Autowired
private IStIvtStructattrService structattrService;
@Override
public int create(JSONArray rows, String shutframeinv_id) {
StIvtStructattr first_struct = null;
StIvtStructattr last_struct = null;
int total_qty = 1;
if (rows.size() > 0 && StringUtils.isNotEmpty(shutframeinv_id)) {
@@ -100,6 +98,6 @@ public class StIvtShutframedtlBcpServiceImpl extends ServiceImpl<StIvtShutframed
total_qty++;
}
}
return total_qty;
return total_qty--;
}
}

View File

@@ -2,6 +2,7 @@ package org.nl.wms.storage_manage.semimanage.service.shutFrame.impl;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
@@ -29,6 +30,8 @@ import org.nl.wms.storage_manage.semimanage.service.shutFrame.dao.StIvtShutframe
import org.nl.wms.storage_manage.semimanage.service.shutFrame.dao.StIvtShutframeinvBcp;
import org.nl.wms.storage_manage.semimanage.service.shutFrame.dao.mapper.StIvtShutframeinvBcpMapper;
import org.nl.wms.storage_manage.semimanage.service.shutFrame.dto.ShutQuery;
import org.nl.wms.storage_manage.semimanage.service.structIvt.IStIvtStructivtBcpService;
import org.nl.wms.storage_manage.semimanage.service.structIvt.dao.StIvtStructivtBcp;
import org.nl.wms.storage_manage.semimanage.service.structIvt.dao.mapper.StIvtStructivtBcpMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -53,6 +56,8 @@ public class StIvtShutframeinvBcpServiceImpl extends ServiceImpl<StIvtShutframei
@Autowired
private IStIvtBsrealstorattrService stIvtBsrealstorattrService;
@Autowired
private IStIvtStructivtBcpService structivtBcpService;
@Autowired
private StIvtStructivtBcpMapper bcpMapper;
@Override
@@ -64,11 +69,30 @@ public class StIvtShutframeinvBcpServiceImpl extends ServiceImpl<StIvtShutframei
return build;
}
@Override
public void confirm(JSONObject form) {
Assert.notNull(new Object[]{form, form.get("shutframeinv_id")}, "请求参数不能为空");
List<StIvtShutframedtlBcp> list = shutframedtlBcpService.list(new QueryWrapper<StIvtShutframedtlBcp>().eq("shutframeinv_id", form.getString("shutframeinv_id")));
list.forEach(dtl -> {
String material_id = dtl.getMaterial_id();
String turnin_struct_id = dtl.getTurnin_struct_id();
String turnout_struct_id = dtl.getTurnout_struct_id();
StIvtStructivtBcp in_ivt = structivtBcpService.getOne(new QueryWrapper<StIvtStructivtBcp>().eq("struct_id", turnin_struct_id).eq("material_id", material_id));
if (ObjectUtil.isEmpty(in_ivt)) {
throw new BadRequestException("库存不能为空!");
}
in_ivt.setCanuse_qty(NumberUtil.add(in_ivt.getCanuse_qty(), dtl.getFact_qty()));
structivtBcpService.remove(new QueryWrapper<StIvtStructivtBcp>().eq("struct_id", turnout_struct_id));
structivtBcpService.updateById(in_ivt);
});
}
@Override
public List<Map> getBillDtl(JSONObject jo) {
List<StIvtShutframedtlBcp> list = shutframedtlBcpService.list(new QueryWrapper<StIvtShutframedtlBcp>().eq("shutframeinv_id", jo.getString("shutframeinv_id")));
List<Map> ivt_list = bcpMapper.getStructIvtInfo(MapOf.of("struct_code", list.get(0).getTurnout_struct_code()));
List<Map> ivt_list2 = bcpMapper.getStructIvtInfo(MapOf.of("struct_code", list.get(0).getTurnin_struct_code()));
List<Map> ivt_list = bcpMapper.getStructIvtInfo(MapOf.of("struct_code", list.get(0).getTurnin_struct_code()));
List<Map> ivt_list2 = bcpMapper.getStructIvtInfo(MapOf.of("struct_code", list.get(0).getTurnout_struct_code()));
ivt_list.addAll(ivt_list2);
return ivt_list;
}

View File

@@ -1,6 +1,8 @@
package org.nl.wms.storage_manage.semimanage.service.structIvt.dao;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.util.Date;
import java.io.Serializable;
@@ -28,6 +30,7 @@ public class StIvtStructivtBcp implements Serializable {
/**
* 仓位标识
*/
@TableId
private String struct_id;
/**