rev: 半成品出入库
add:半成品库存
This commit is contained in:
@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.nl.common.anno.Log;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.storage_manage.productmanage.service.structIvt.dto.CpIvtQuery;
|
||||
import org.nl.wms.storage_manage.rawmanage.service.structIvt.dto.StructIvtYLQuery;
|
||||
import org.nl.wms.storage_manage.semimanage.service.structIvt.IStIvtStructivtBcpService;
|
||||
import org.nl.wms.storage_manage.semimanage.service.structIvt.dto.StructIvtBcpQuery;
|
||||
@@ -28,6 +29,14 @@ public class StIvtStructivtBcpController {
|
||||
@Autowired
|
||||
private IStIvtStructivtBcpService bcpService;
|
||||
|
||||
|
||||
@GetMapping
|
||||
@Log("半成品库存查询")
|
||||
@ApiOperation("半成品库存查询")
|
||||
public ResponseEntity<Object> query(StructIvtBcpQuery query, PageQuery page) {
|
||||
return new ResponseEntity<>(bcpService.packageQuery(query,page), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/getBcpIvt")
|
||||
@Log("查询可用的半成品库存")
|
||||
@ApiOperation("查询可用的半成品库存")
|
||||
|
||||
@@ -6,23 +6,27 @@
|
||||
dtl.*,
|
||||
mater.material_code,
|
||||
mater.material_name,
|
||||
mater.material_spec
|
||||
mater.material_spec,
|
||||
task.task_code,
|
||||
task.task_status,
|
||||
(dtl.unit_weight * dtl.plan_qty) AS weight_qty
|
||||
FROM
|
||||
st_ivt_iostorinv_bcp dtl
|
||||
LEFT JOIN md_me_materialbase mater ON mater.material_id = dtl.material_id
|
||||
LEFT JOIN sch_base_task task ON task.task_id = dtl.task_id
|
||||
<where>
|
||||
dtl.is_delete = false
|
||||
<if test="query.stor_id != null and query.stor_id != ''">
|
||||
and dtl.stor_id = #{query.stor_id }
|
||||
and dtl.stor_id = #{query.stor_id}
|
||||
</if>
|
||||
<if test="query.iostorinv_id != null and query.iostorinv_id != ''">
|
||||
and dtl.iostorinv_id = #{query.iostorinv_id }
|
||||
and dtl.iostorinv_id = #{query.iostorinv_id}
|
||||
</if>
|
||||
<if test="query.bill_code != null and query.bill_code != ''">
|
||||
and dtl.bill_code like %${query.bill_code}%
|
||||
and dtl.bill_code like #{query.bill_code}
|
||||
</if>
|
||||
<if test="query.bill_type != null and query.bill_type != ''">
|
||||
and dtl.bill_type like %${query.bill_type}%
|
||||
and dtl.bill_type like #{query.bill_type}
|
||||
</if>
|
||||
<if test="query.bill_status != null and query.bill_status != ''">
|
||||
and dtl.bill_status = #{query.bill_status}
|
||||
|
||||
@@ -197,10 +197,18 @@ public class StIvtIostorinvBcpOutServiceImpl extends ServiceImpl<StIvtIostorinvB
|
||||
.set(StIvtStructattr::getInv_code,"")
|
||||
.set(StIvtStructattr::getStoragevehicle_code, ""));
|
||||
|
||||
// 更新任务为完成
|
||||
iSchBaseTaskService.update(
|
||||
new UpdateWrapper<SchBaseTask>().lambda()
|
||||
.set(SchBaseTask::getTask_status, TaskStatusEnum.FINISHED.getCode())
|
||||
.eq(SchBaseTask::getTask_id, mst.getTask_id())
|
||||
);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public String confirmTask(JSONObject form) {
|
||||
Assert.notNull(new Object[]{form, form.get("iostorinv_id")}, "请求参数不能为空");
|
||||
StIvtIostorinvBcp mst = this.getById(form.getString("iostorinv_id"));
|
||||
|
||||
@@ -182,6 +182,13 @@ public class StIvtIostorinvBcpServiceImpl extends ServiceImpl<StIvtIostorinvBcpM
|
||||
.set(StIvtStructattr::getInv_code, "")
|
||||
.set(StIvtStructattr::getStoragevehicle_code, mst.getStoragevehicle_code()));
|
||||
|
||||
// 更新任务为完成
|
||||
iSchBaseTaskService.update(
|
||||
new UpdateWrapper<SchBaseTask>().lambda()
|
||||
.set(SchBaseTask::getTask_status, TaskStatusEnum.FINISHED.getCode())
|
||||
.eq(SchBaseTask::getTask_id, mst.getTask_id())
|
||||
);
|
||||
|
||||
/*structivtflowService.recordStructivtFlow(
|
||||
StIvtStructivtflowDto.builder()
|
||||
.bill_code(mst.getBill_code()).change_type_scode(CHANGE_BILL_TYPE_ENUM.IOSTORINV_IN_CONFIRM).bill_table("st_ivt_iostorinv_bcp")
|
||||
|
||||
@@ -36,4 +36,5 @@ public interface IStIvtStructivtBcpService extends IService<StIvtStructivtBcp> {
|
||||
|
||||
List<Map> getBcpIvtInfo(JSONObject jo);
|
||||
|
||||
Object packageQuery(StructIvtBcpQuery query, PageQuery page);
|
||||
}
|
||||
|
||||
@@ -28,5 +28,6 @@ public interface StIvtStructivtBcpMapper extends BaseMapper<StIvtStructivtBcp> {
|
||||
|
||||
List<Map> getStructIvtInfo(@Param("map") Map map);
|
||||
|
||||
List<Map> packageQuery(@Param("query") StructIvtBcpQuery query);
|
||||
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
mu.unit_name AS qty_unit_name,
|
||||
mb.material_code,
|
||||
mb.material_name,
|
||||
mb.material_spec,
|
||||
sa.sect_id,
|
||||
sa.sect_code,
|
||||
sa.sect_name,
|
||||
@@ -42,7 +43,9 @@
|
||||
AND
|
||||
sa.lock_type = '0'
|
||||
<if test="query.material_search != null and query.material_search != ''">
|
||||
and (mb.material_code = #{query.material_search} OR mb.material_name = #{query.material_search})
|
||||
and (mb.material_code = #{query.material_search} OR
|
||||
mb.material_name = #{query.material_search} OR
|
||||
mb.material_spec = #{query.material_search})
|
||||
</if>
|
||||
<if test="query.sect_id != null and query.sect_id != ''">
|
||||
and sa.sect_id = #{query.sect_id}
|
||||
@@ -109,4 +112,41 @@
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="packageQuery" resultType="java.util.Map">
|
||||
SELECT
|
||||
ivt.*,
|
||||
mater.material_code,
|
||||
mater.material_name,
|
||||
mater.material_spec,
|
||||
unit.unit_name,
|
||||
attr.struct_name,
|
||||
attr.sect_code,
|
||||
attr.sect_name,
|
||||
attr.storagevehicle_code
|
||||
FROM
|
||||
st_ivt_structivt_bcp ivt
|
||||
LEFT JOIN md_me_materialbase mater ON ivt.material_id = mater.material_id
|
||||
LEFT JOIN st_ivt_structattr attr ON attr.struct_id = ivt.struct_id
|
||||
LEFT JOIN md_pb_measureunit unit ON unit.measure_unit_id = ivt.qty_unit_id
|
||||
<where>
|
||||
1=1
|
||||
<if test="query.material_code!= null and query.material_code != ''">
|
||||
and mater.material_code LIKE #{query.material_code} or
|
||||
(mater.material_name LIKE #{query.material_code}) or
|
||||
(mater.material_spec LIKE #{query.material_code})
|
||||
</if>
|
||||
<if test="query.struct_code!= null and query.struct_code != ''">
|
||||
and attr.struct_code LIKE #{query.struct_code} or
|
||||
(attr.struct_name LIKE #{query.struct_code})
|
||||
</if>
|
||||
<if test="query.start_time!= null and query.start_time != ''">
|
||||
and ivt.instorage_time >= #{query.start_time}
|
||||
</if>
|
||||
<if test="query.end_time!= null and query.end_time != ''">
|
||||
and ivt.instorage_time <= #{query.end_time}
|
||||
</if>
|
||||
</where>
|
||||
order by ivt.instorage_time DESC,attr.struct_code ASC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -20,6 +20,10 @@ public class StructIvtBcpQuery extends BaseQuery<StIvtStructivtBcp> {
|
||||
|
||||
private String material_search;
|
||||
|
||||
private String material_code;
|
||||
|
||||
private String struct_code;
|
||||
|
||||
private Boolean is_delete = false;
|
||||
|
||||
|
||||
|
||||
@@ -42,6 +42,15 @@ public class StIvtStructivtBcpServiceImpl extends ServiceImpl<StIvtStructivtBcpM
|
||||
return this.baseMapper.getBcpIvtInfo(jo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object packageQuery(StructIvtBcpQuery query, PageQuery pageQuery) {
|
||||
com.github.pagehelper.Page<Object> page = PageHelper.startPage(pageQuery.getPage() + 1, pageQuery.getSize());
|
||||
TableDataInfo build = TableDataInfo.build(this.baseMapper.packageQuery(query));
|
||||
build.setTotalElements(page.getTotal());
|
||||
|
||||
return build;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getBcpIvt(StructIvtBcpQuery query, PageQuery pageQuery) {
|
||||
com.github.pagehelper.Page<Object> page = PageHelper.startPage(pageQuery.getPage() + 1, pageQuery.getSize());
|
||||
|
||||
Reference in New Issue
Block a user