add:日库存统计
This commit is contained in:
@@ -9,8 +9,10 @@ import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.TableDataInfo;
|
||||
import org.nl.common.anno.Log;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.utils.MapOf;
|
||||
import org.nl.wms.masterdata_manage.service.master.IMdPbMeasureunitService;
|
||||
import org.nl.wms.masterdata_manage.service.master.dao.MdPbMeasureunit;
|
||||
import org.nl.wms.masterdata_manage.service.master.dto.UnitQuery;
|
||||
@@ -22,7 +24,9 @@ import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author loujf
|
||||
@@ -45,6 +49,17 @@ public class MdPbMeasureunitController {
|
||||
return new ResponseEntity<>(measureunitService.pageQuery(query, page), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/select")
|
||||
@Log("查询单位下拉列表设备")
|
||||
public ResponseEntity<Object> selectAll(){
|
||||
List<MdPbMeasureunit> list = measureunitService.list();
|
||||
List<Map> result = new ArrayList<>();
|
||||
for (MdPbMeasureunit item : list) {
|
||||
result.add(MapOf.of("label",item.getUnit_name(),"value",item.getMeasure_unit_id()));
|
||||
}
|
||||
return new ResponseEntity<>(TableDataInfo.build(result),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/add")
|
||||
@Log("新增计量单位")
|
||||
//("新增计量单位")
|
||||
|
||||
@@ -17,4 +17,5 @@ public interface IStIvtStructivtDailyService extends IService<StIvtStructivtDail
|
||||
* 统计日常数据
|
||||
*/
|
||||
void dailyStructivt(String...structivts);
|
||||
|
||||
}
|
||||
|
||||
@@ -34,6 +34,21 @@ public class StIvtStructivtDaily implements Serializable {
|
||||
*/
|
||||
private String stor_id;
|
||||
|
||||
|
||||
/**
|
||||
* 仓库名称
|
||||
*/
|
||||
private String stor_name;
|
||||
|
||||
/**
|
||||
* 库区标识
|
||||
*/
|
||||
private String sect_id;
|
||||
/**
|
||||
* 库区名称
|
||||
*/
|
||||
private String sect_name;
|
||||
|
||||
/**
|
||||
* 仓库表
|
||||
*/
|
||||
@@ -64,6 +79,17 @@ public class StIvtStructivtDaily implements Serializable {
|
||||
*/
|
||||
private String material_id;
|
||||
|
||||
|
||||
/**
|
||||
* 物料标识
|
||||
*/
|
||||
private String material_code;
|
||||
|
||||
/**
|
||||
* 物料标识
|
||||
*/
|
||||
private String material_spec;
|
||||
|
||||
/**
|
||||
* 可用数
|
||||
*/
|
||||
|
||||
@@ -18,7 +18,7 @@ import java.util.Map;
|
||||
*/
|
||||
public interface StIvtStructivtDailyMapper extends BaseMapper<StIvtStructivtDaily> {
|
||||
|
||||
@Select("select #{table} as table_name,'A1' as product_area, UUID_SHORT() id,material_id,sum(canuse_qty) canuse_qty ,sum(frozen_qty) frozen_qty,sum(ivt_qty) ivt_qty,sum(warehousing_qty) warehousing_qty,GROUP_CONCAT(struct_code) struct_code,stor_id,qty_unit_id,CURDATE() create_time from ${table} GROUP BY material_id")
|
||||
@Select("SELECT #{table} AS table_name,GROUP_CONCAT(a.struct_code) struct_code, 'A1' AS product_area, st_ivt_structattr.stor_id,st_ivt_structattr.stor_name , st_ivt_structattr.sect_id,st_ivt_structattr.sect_name , UUID_SHORT( ) id,a.material_id,md_me_materialbase.material_code,md_me_materialbase.material_spec, sum( canuse_qty ) canuse_qty, sum( frozen_qty ) frozen_qty, sum( ivt_qty ) ivt_qty, sum( warehousing_qty ) warehousing_qty, qty_unit_id, CURDATE( ) create_time FROM ${table} as a left join st_ivt_structattr on a.struct_code = st_ivt_structattr.struct_code left join md_me_materialbase on a.material_id = md_me_materialbase.material_id GROUP BY material_id")
|
||||
List<Map> selectStructivt(@Param("table") String table);
|
||||
}
|
||||
|
||||
|
||||
@@ -13,23 +13,14 @@ import org.nl.wms.masterdata_manage.storage.service.dailyStructivt.dao.StIvtStru
|
||||
@Data
|
||||
public class DailyStructivtQuery extends BaseQuery<StIvtStructivtDaily> {
|
||||
|
||||
private String is_materialstore;
|
||||
private String is_reversed;
|
||||
private String is_attachment;
|
||||
private String is_productstore;
|
||||
private String is_semi_finished;
|
||||
private String is_virtualstore;
|
||||
|
||||
private String stor_id;
|
||||
private String sect_id;
|
||||
private String struct_code;
|
||||
private String lock_type;
|
||||
private Boolean is_used;
|
||||
private Boolean emptyvehicle;
|
||||
private Boolean is_emptyvehicle;
|
||||
private String blurry;
|
||||
|
||||
@Override
|
||||
public void paramMapping() {
|
||||
super.doP.put("blurry", QParam.builder().k(new String[]{"struct_code"}).type(QueryTEnum.LK).build());
|
||||
super.doP.put("emptyvehicle", QParam.builder().k(new String[]{"storagevehicle_code"}).type(QueryTEnum.NULL_OR_EMPTY).build());
|
||||
super.doP.put("blurry", QParam.builder().k(new String[]{"material_code","material_spec"}).type(QueryTEnum.ORLK).build());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,9 +37,11 @@ public enum IOSEnum {
|
||||
//锁定类型
|
||||
LOCK_TYPE(MapOf.of("未锁定", "0", "入库锁", "1", "出库锁", "2","盘点锁", "3","损溢锁", "4","拼盘锁","5","移库锁","10","其他锁","99")),
|
||||
// 海柔半成品出入库类型
|
||||
BILL_TYPE_HR(MapOf.of("生产出库", "1001", "盘点出库", "1002", "手工出库", "1009","生产入库","0001")),
|
||||
BILL_TYPE_HR(MapOf.of("生产出库", "1001", "盘点出库", "1002", "手工出库", "1009","生产入库","0001","手工入库", "0009")),
|
||||
// 半成品出入类型
|
||||
BILL_TYPE_BCP(MapOf.of("清洗入库", "0001", "手工入库", "0009","生产出库","1001","手工出库","1009")),
|
||||
|
||||
ST_INV_CP_TYPE(MapOf.of("生产出库", "1001", "盘点出库", "1002", "移库出库", "1003","手工出库", "1009","生产入库","0001","移库入库","0003","手工入库", "0009")),
|
||||
;
|
||||
private Map<String, String> code;
|
||||
|
||||
|
||||
@@ -284,7 +284,8 @@ public class StIvtMoveinvCpServiceImpl extends ServiceImpl<StIvtMoveinvCpMapper,
|
||||
ivtOutParam.put("sale_id", dtl.getSale_id());
|
||||
ivtOutParam.put("bill_code",mst.getBill_code());
|
||||
ivtOutParam.put("inv_id",mst.getMoveinv_id());
|
||||
ivtOutParam.put("bill_type_scode",mst.getBill_type());
|
||||
ivtOutParam.put("bill_type_scode",IOSEnum.ST_INV_CP_TYPE.code("移库出库"));
|
||||
ivtOutParam.put("stor_id",mst.getStor_id());
|
||||
iStIvtStructivtCpService.UpdateIvt(ivtOutParam);
|
||||
//加入库
|
||||
JSONObject ivtInParam = new JSONObject();
|
||||
@@ -298,7 +299,8 @@ public class StIvtMoveinvCpServiceImpl extends ServiceImpl<StIvtMoveinvCpMapper,
|
||||
ivtInParam.put("sale_id", dtl.getSale_id());
|
||||
ivtInParam.put("bill_code",mst.getBill_code());
|
||||
ivtInParam.put("inv_id",mst.getMoveinv_id());
|
||||
ivtInParam.put("bill_type_scode",mst.getBill_type());
|
||||
ivtInParam.put("bill_type_scode",IOSEnum.ST_INV_CP_TYPE.code("移库入库"));
|
||||
ivtInParam.put("product_area",mst.getProduct_area());
|
||||
iStIvtStructivtCpService.UpdateIvt(ivtInParam);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -324,7 +324,7 @@ public class StIvtIostorinvBcpOutServiceImpl extends ServiceImpl<StIvtIostorinvB
|
||||
mst.setPcsn(StringUtils.isNotEmpty(form.getString("pcsn")) ? form.getString("pcsn") : DateUtil.today());
|
||||
mst.setPlan_qty(stIvtStructivtBcp.getCanuse_qty());
|
||||
mst.setQuality_scode(stIvtStructivtBcp.getQuality_scode());
|
||||
mst.setQty_unit_id(stIvtStructivtBcp.getQty_unit_id());
|
||||
mst.setQty_unit_id("2");
|
||||
mst.setBase_bill_code("");
|
||||
mst.setQty_unit_name(" ");
|
||||
mst.setUnit_weight(material.getNet_weight());
|
||||
|
||||
@@ -219,7 +219,7 @@ public class StIvtIostorinvBcpServiceImpl extends ServiceImpl<StIvtIostorinvBcpM
|
||||
.pcsn(DateUtil.today())
|
||||
.ivt_level(IVTEnum.IVT_LEVEL.code("一级"))
|
||||
.is_active(true)
|
||||
.qty_unit_id(mdMeMaterialbase.getBase_unit_id())
|
||||
.qty_unit_id("2")
|
||||
.instorage_time(DateUtil.now())
|
||||
.stor_id(form.getString("stor_id"))
|
||||
.canuse_qty(form.getBigDecimal("qty"))
|
||||
@@ -273,7 +273,7 @@ public class StIvtIostorinvBcpServiceImpl extends ServiceImpl<StIvtIostorinvBcpM
|
||||
.pcsn(mst.getPcsn())
|
||||
.ivt_level(mst.getIvt_level())
|
||||
.is_active(mst.getIs_active())
|
||||
.qty_unit_id(mst.getQty_unit_id())
|
||||
.qty_unit_id("2")
|
||||
.instorage_time(DateUtil.now())
|
||||
.stor_id(mst.getStor_id())
|
||||
.canuse_qty(mst.getPlan_qty())
|
||||
|
||||
@@ -288,7 +288,7 @@ public class StIvtMoveinvBcpServiceImpl extends ServiceImpl<StIvtMoveinvBcpMappe
|
||||
.pcsn(dtl.getPcsn())
|
||||
.ivt_level(dtl.getIvt_level())
|
||||
.is_active(dtl.getIs_active())
|
||||
.qty_unit_id(dtl.getQty_unit_id())
|
||||
.qty_unit_id("2")
|
||||
.instorage_time(DateUtil.now())
|
||||
.stor_id(mst.getStor_id())
|
||||
.canuse_qty(dtl.getQty())
|
||||
|
||||
@@ -235,7 +235,7 @@ public class StIvtMoreorlessmstBcpServiceImpl extends ServiceImpl<StIvtMoreorles
|
||||
.ivt_level(dtl.getIvt_level())
|
||||
.is_active(dtl.getIs_active())
|
||||
.canuse_qty(mol_qty)
|
||||
.qty_unit_id(dtl.getQty_unit_id())
|
||||
.qty_unit_id("2")
|
||||
.instorage_time(DateUtil.now())
|
||||
.stor_id(mst.getStor_id())
|
||||
.workshop_id(mst.getProduct_area())
|
||||
|
||||
@@ -86,7 +86,7 @@ public class StIvtStructivtBcp implements Serializable {
|
||||
private BigDecimal warehousing_qty;
|
||||
|
||||
/**
|
||||
* 计量单位标识
|
||||
* 计量单位标识:2/g
|
||||
*/
|
||||
private String qty_unit_id;
|
||||
|
||||
|
||||
@@ -297,7 +297,7 @@ public class StIvtIostorinvHrBcpOutServiceImpl extends ServiceImpl<StIvtIostorin
|
||||
new QueryWrapper<MdPbStoragevehicleext>().lambda()
|
||||
.eq(MdPbStoragevehicleext::getStoragevehicle_code,form.getString("storagevehicle_code"))
|
||||
);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -335,7 +335,7 @@ public class StIvtIostorinvHrBcpOutServiceImpl extends ServiceImpl<StIvtIostorin
|
||||
mst.setPcsn(StringUtils.isNotEmpty(form.getString("pcsn")) ? form.getString("pcsn") : DateUtil.today());
|
||||
mst.setPlan_qty(stIvtStructivtBcp.getCanuse_qty());
|
||||
mst.setQuality_scode(stIvtStructivtBcp.getQuality_scode());
|
||||
mst.setQty_unit_id(stIvtStructivtBcp.getQty_unit_id());
|
||||
mst.setQty_unit_id("2");
|
||||
mst.setBase_bill_code("");
|
||||
mst.setQty_unit_name(" ");
|
||||
mst.setUnit_weight(material.getNet_weight());
|
||||
|
||||
@@ -19,3 +19,6 @@ ALTER TABLE st_ivt_structivt_bcp
|
||||
ADD COLUMN `frozen_qty` decimal(18,3) DEFAULT '0.000' COMMENT '冻结数',
|
||||
ADD COLUMN `ivt_qty` decimal(18,3) NOT NULL DEFAULT '0.000' COMMENT '库存数',
|
||||
ADD COLUMN `warehousing_qty` decimal(18,3) DEFAULT '0.000' COMMENT '待入数';
|
||||
-- CP移库类型
|
||||
INSERT INTO `hl_one_mes`.`sys_dict`(`dict_id`, `code`, `name`, `label`, `value`, `dict_sort`, `dict_type`, `para1`, `para2`, `para3`, `create_id`, `create_name`, `create_time`, `update_id`, `update_name`, `update_time`) VALUES ('1703954832731279360', 'ST_INV_CP_IN_TYPE', '成品入库单据类型', '移库入库', '0003', 3, NULL, NULL, NULL, NULL, '1694303357524643840', '管理员', '2023-09-19 10:11:04', '1694303357524643840', '管理员', '2023-09-19 10:11:04');
|
||||
INSERT INTO `hl_one_mes`.`sys_dict`(`dict_id`, `code`, `name`, `label`, `value`, `dict_sort`, `dict_type`, `para1`, `para2`, `para3`, `create_id`, `create_name`, `create_time`, `update_id`, `update_name`, `update_time`) VALUES ('1703955348920078336', 'ST_INV_CP_OUT_TYPE', '成品出库单据类型', '移库出库', '1003', 3, NULL, NULL, NULL, NULL, '1694303357524643840', '管理员', '2023-09-19 10:13:07', '1694303357524643840', '管理员', '2023-09-19 10:13:16');
|
||||
|
||||
Reference in New Issue
Block a user