opt:提交用料出库
This commit is contained in:
@@ -30,6 +30,14 @@ public interface MdPbStoragevehicleextMapper extends BaseMapper<MdPbStoragevehic
|
||||
*/
|
||||
IPage<JSONObject> getCanuseIvt(Page<JSONObject> page, @Param("param") Map whereJson);
|
||||
|
||||
/**
|
||||
* 获取可用库存分页查询
|
||||
* @param page 分页条件
|
||||
* @param whereJson 查询条件
|
||||
* @return IPage<JSONObject>
|
||||
*/
|
||||
IPage<JSONObject> getOrderDtl(Page<JSONObject> page, @Param("param") Map whereJson);
|
||||
|
||||
/**
|
||||
* 根据批次和物料查看可用库存总和
|
||||
* @param pcsn
|
||||
|
||||
@@ -56,6 +56,45 @@
|
||||
ORDER BY ext.create_time Desc
|
||||
</select>
|
||||
|
||||
<select id="getOrderDtl" resultType="com.alibaba.fastjson.JSONObject">
|
||||
SELECT
|
||||
form.id as storagevehicleext_id,
|
||||
form.code as source_bill_code,
|
||||
form.source_form_date,
|
||||
form.id as source_billdtl_id,
|
||||
form.form_type as source_bill_type,
|
||||
material.material_id,
|
||||
material.material_code,
|
||||
material.material_name,
|
||||
form.unit_id as qty_unit_id,
|
||||
form.unit_name as qty_unit_name,
|
||||
form.qty,
|
||||
form.stor_name
|
||||
FROM
|
||||
pm_form_data form
|
||||
INNER JOIN md_me_materialbase material ON material.material_code = form.material_code
|
||||
<where>
|
||||
form.status = '10'
|
||||
and form.form_type = '1001'
|
||||
AND form.is_finish = '0'
|
||||
<if test="param.stor_id != null and param.stor_id != ''">
|
||||
AND
|
||||
form.stor_id LIKE #{param.stor_id}
|
||||
</if>
|
||||
<if test="param.code != null and param.code != ''">
|
||||
AND
|
||||
form.code LIKE #{param.code}
|
||||
</if>
|
||||
|
||||
<if test="param.material_code != null and param.material_code != ''">
|
||||
AND
|
||||
material.material_code LIKE #{param.material_code}
|
||||
</if>
|
||||
|
||||
</where>
|
||||
ORDER BY form.create_time Desc
|
||||
</select>
|
||||
|
||||
<select id="queryAllByPage" resultType="com.alibaba.fastjson.JSONObject">
|
||||
SELECT
|
||||
ext.group_id as storagevehicleext_id,
|
||||
|
||||
@@ -37,6 +37,12 @@ public class OutBillController {
|
||||
return new ResponseEntity<>(TableDataInfo.build(iOutBillService.getCanuseIvt(whereJson,page)),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/getOrderDtl")
|
||||
@Log("获取可用库存物料")
|
||||
public ResponseEntity<Object> getOrderDtl(@RequestParam Map whereJson, PageQuery page) {
|
||||
return new ResponseEntity<>(TableDataInfo.build(iOutBillService.getOrderDtl(whereJson,page)),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("修改出库单")
|
||||
public ResponseEntity<Object> update(@RequestBody JSONObject whereJson) {
|
||||
|
||||
@@ -43,6 +43,8 @@ public interface IOutBillService extends IService<IOStorInv> {
|
||||
*/
|
||||
IPage<JSONObject> getCanuseIvt(Map whereJson, PageQuery page);
|
||||
|
||||
IPage<JSONObject> getOrderDtl(Map whereJson, PageQuery page);
|
||||
|
||||
/**
|
||||
* 修改出库单
|
||||
*
|
||||
|
||||
@@ -173,6 +173,12 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
|
||||
whereJson);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<JSONObject> getOrderDtl(Map whereJson, PageQuery page) {
|
||||
return mdPbStoragevehicleextMapper.getOrderDtl(new Page<>(page.getPage() + 1, page.getSize()),
|
||||
whereJson);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(JSONObject whereJson) {
|
||||
String iostorinv_id = (String) whereJson.get("iostorinv_id");
|
||||
@@ -272,7 +278,6 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
|
||||
map.put("iostorinv_id", iostorinv_id);
|
||||
map.put("bill_code", bill_code);
|
||||
map.put("biz_date", map.getString("biz_date").substring(0, 10));
|
||||
String bill_type = (String) map.get("bill_type");
|
||||
map.put("io_type", IOSEnum.IO_TYPE.code("出库"));
|
||||
map.put("detail_count", array.size() + "");
|
||||
map.put("create_mode", IOSEnum.CREATE_MODE.code("PC产生"));
|
||||
@@ -303,6 +308,7 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
|
||||
ioStorInvDtl.put("iostorinv_id", iostorinv_id);
|
||||
ioStorInvDtl.put("seq_no", (i + 1) + "");
|
||||
ioStorInvDtl.put("material_id", row.getString("material_id"));
|
||||
ioStorInvDtl.put("material_code", row.getString("material_code"));
|
||||
ioStorInvDtl.put("pcsn", row.getString("pcsn"));
|
||||
ioStorInvDtl.put("bill_status", IOSEnum.BILL_STATUS.code("生成"));
|
||||
ioStorInvDtl.put("qty_unit_id", row.get("qty_unit_id"));
|
||||
@@ -311,6 +317,9 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
|
||||
ioStorInvDtl.put("remark", row.getString("remark"));
|
||||
ioStorInvDtl.put("assign_qty", "0");
|
||||
ioStorInvDtl.put("unassign_qty", row.get("qty"));
|
||||
ioStorInvDtl.put("source_billdtl_id", row.getString("source_billdtl_id"));
|
||||
ioStorInvDtl.put("source_bill_code", row.getString("source_bill_code"));
|
||||
ioStorInvDtl.put("source_bill_type", row.getString("source_bill_type"));
|
||||
|
||||
ioStorInvDtlMapper.insert(ioStorInvDtl.toJavaObject(IOStorInvDtl.class));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user