opt:新增成品库存报表导出、优化中文、优化菜单
This commit is contained in:
@@ -343,6 +343,84 @@ public class PdmBiSubpackagerelation extends Model<PdmBiSubpackagerelation> {
|
||||
|
||||
@TableField(exist = false)
|
||||
private String plan_qty;
|
||||
|
||||
/**
|
||||
* 实际木箱重量
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String box_actual_net_weight;
|
||||
|
||||
/**
|
||||
* 客户木箱唯一序列号
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String box_customer_sn;
|
||||
|
||||
/**
|
||||
* 客户物料号
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String customer_material_code;
|
||||
|
||||
/**
|
||||
* 客户物料名称
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String customer_material_desc;
|
||||
|
||||
/**
|
||||
* 客户要求批号
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String customer_batch_number;
|
||||
|
||||
/**
|
||||
* 子卷的客户卷号
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String customer_roll_name;
|
||||
|
||||
/**
|
||||
* 子卷铝箔袋重量
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String roll_package_material_al_weight;
|
||||
|
||||
/**
|
||||
* 子卷辅材重量
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String roll_fc_weight;
|
||||
|
||||
/**
|
||||
* 子卷备注
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String roll_remark;
|
||||
|
||||
/**
|
||||
* 净重合计
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private BigDecimal total_net_weight;
|
||||
|
||||
/**
|
||||
* 净重转换
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private BigDecimal net_weight_convert;
|
||||
|
||||
/**
|
||||
* 毛重转换
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private BigDecimal gross_weight_convert;
|
||||
|
||||
/**
|
||||
* 质保截止日期
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String warranty_expire_date;
|
||||
/**
|
||||
* 获取主键值
|
||||
*
|
||||
|
||||
@@ -71,6 +71,14 @@ public interface IStIvtIostorinvdisService extends IService<StIvtIostorinvdis> {
|
||||
*/
|
||||
List<InBillPageVo> getInBillDatas(InBillPageParam paramMap);
|
||||
|
||||
/**
|
||||
* 成品入库查询 - 不分页,从写方法,sql与 {@link IStIvtIostorinvdisService#getInBillPage(InBillPageParam, PageQuery)} 一样
|
||||
* @param paramMap
|
||||
* @return
|
||||
*/
|
||||
List<InBillPageVo> getInBillDatasNew(InBillPageParam paramMap);
|
||||
|
||||
|
||||
/**
|
||||
* 成品出库分页查询
|
||||
* @param paramMap 参数
|
||||
|
||||
@@ -83,6 +83,8 @@ public interface StIvtIostorinvdisMapper extends BaseMapper<StIvtIostorinvdis> {
|
||||
*/
|
||||
IPage<InBillPageVo> selectPageAllLeftJoin(IPage<InBillPageVo> pages, InBillPageParam paramMap);
|
||||
|
||||
List<InBillPageVo> getInBillDataNew(@Param("paramMap") InBillPageParam paramMap);
|
||||
|
||||
List<InBillPageVo> getInBillData(@Param("paramMap") InBillPageParam paramMap);
|
||||
|
||||
List<InBillPageVo> getInBillAllData(@Param("paramMap") InBillPageParam paramMap);
|
||||
|
||||
@@ -485,6 +485,218 @@
|
||||
mst.iostorinv_id,
|
||||
dis.box_no
|
||||
</select>
|
||||
<select id="getInBillDataNew" resultType="org.nl.wms.stat.service.vo.InBillPageVo">
|
||||
SELECT
|
||||
mst.stor_name,
|
||||
dis.sect_name,
|
||||
dis.struct_code,
|
||||
dis.struct_name,
|
||||
mst.bill_type,
|
||||
dis.box_no,
|
||||
mater.material_code,
|
||||
mater.material_name,
|
||||
mb.material_name AS box_name,
|
||||
dis.pcsn,
|
||||
sub.sap_pcsn,
|
||||
sub.net_weight,
|
||||
dis.qty_unit_name,
|
||||
sub.customer_name,
|
||||
cust.sales_owner,
|
||||
cust.cust_name,
|
||||
sub.quanlity_in_box,
|
||||
sub.customer_description,
|
||||
sub.sale_order_name,
|
||||
mst.input_time,
|
||||
mst.confirm_time,
|
||||
sub.date_of_production,
|
||||
mst.input_optname,
|
||||
sub.width,
|
||||
sub.box_actual_net_weight,
|
||||
sub.box_customer_sn,
|
||||
sub.customer_material_code,
|
||||
sub.customer_material_desc,
|
||||
sub.customer_batch_number,
|
||||
sub.customer_roll_name,
|
||||
sub.roll_package_material_al_weight,
|
||||
sub.roll_fc_weight,
|
||||
sub.roll_remark,
|
||||
sub.total_net_weight,
|
||||
sub.net_weight_convert,
|
||||
sub.gross_weight_convert,
|
||||
sub.warranty_expire_date,
|
||||
case when plan.paper_tube_or_FRP = '1' then '纸管' when plan.paper_tube_or_FRP = '2' then 'FRP管' end AS
|
||||
paper_type,
|
||||
case when plan.paper_tube_or_FRP = '1' then plan.paper_tube_material when plan.paper_tube_or_FRP = '2' then
|
||||
plan.FRP_material end
|
||||
AS paper_code,
|
||||
case when plan.paper_tube_or_FRP = '1' then plan.paper_tube_description when plan.paper_tube_or_FRP = '2' then
|
||||
plan.FRP_description end AS paper_name,
|
||||
sub.thickness,
|
||||
sub.box_weight,
|
||||
sub.length,
|
||||
sub.thickness_request,
|
||||
sub.width_standard,
|
||||
sub.mass_per_unit_area,
|
||||
sub.demand_limit,
|
||||
sub.standard_limit,
|
||||
sub.actual_value,
|
||||
(case when plan.parent_container_name <![CDATA[ <> ]]> '' then plan.parent_container_name else
|
||||
plan.restruct_container_name end) AS parent_container_name,
|
||||
mst.remark,
|
||||
(case when DATE_FORMAT( mst.confirm_time, '%H:%i:%s' ) <![CDATA[ >= ]]> '08:00:00' AND DATE_FORMAT(
|
||||
mst.confirm_time, '%H:%i:%s' ) <![CDATA[ <= ]]> '19:59:59' then '白班'
|
||||
when ((
|
||||
DATE_FORMAT( mst.confirm_time, '%H:%i:%s' ) <![CDATA[ >= ]]> '20:00:00' AND DATE_FORMAT( mst.confirm_time,
|
||||
'%H:%i:%s' ) <![CDATA[ <= ]]> '23:59:59'
|
||||
OR
|
||||
DATE_FORMAT( mst.confirm_time, '%H:%i:%s' ) <![CDATA[ >= ]]> '00:00:00' AND DATE_FORMAT( mst.confirm_time,
|
||||
'%H:%i:%s' ) <![CDATA[ <= ]]> '07:59:59'
|
||||
)) then '晚班' end) AS classes,
|
||||
CONCAT( sub.box_length,'*',sub.box_width,'*',sub.box_high) AS box_size,
|
||||
CASE
|
||||
|
||||
WHEN DATE_FORMAT( mst.confirm_time, '%H:%i:%s' ) <![CDATA[ >= ]]> '08:00:00' AND DATE_FORMAT( mst.confirm_time,
|
||||
'%H:%i:%s' ) <![CDATA[ <= ]]> '23:59:59'
|
||||
THEN mst.confirm_time
|
||||
WHEN DATE_FORMAT( mst.confirm_time, '%H:%i:%s' ) <![CDATA[ >= ]]> '00:00:00' AND DATE_FORMAT( mst.confirm_time,
|
||||
'%H:%i:%s' ) <![CDATA[ <= ]]> '07:59:59'
|
||||
THEN DATE_SUB(mst.confirm_time,INTERVAL 1 day)
|
||||
END AS confirm_time_class
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
MIN( a.iostorinvdis_id ) AS iostorinvdis_id
|
||||
FROM
|
||||
st_ivt_iostorinvdis a
|
||||
LEFT JOIN st_ivt_iostorinv b ON a.iostorinv_id = b.iostorinv_id
|
||||
WHERE
|
||||
b.io_type = '0'
|
||||
<if test="paramMap.bill_type != null and paramMap.bill_type != ''">
|
||||
AND b.bill_type = #{paramMap.bill_type}
|
||||
</if>
|
||||
<if test="paramMap.pcsn != null and paramMap.pcsn != ''">
|
||||
AND a.pcsn = #{paramMap.pcsn}
|
||||
</if>
|
||||
<if test="paramMap.begin_time != null and paramMap.begin_time != ''">
|
||||
AND b.confirm_time <![CDATA[ >= ]]> #{paramMap.begin_time}
|
||||
</if>
|
||||
<if test="paramMap.end_time != null and paramMap.end_time != ''">
|
||||
AND b.confirm_time <![CDATA[ <= ]]> #{paramMap.end_time}
|
||||
</if>
|
||||
AND b.bill_status = '99'
|
||||
GROUP BY
|
||||
pcsn
|
||||
UNION
|
||||
SELECT
|
||||
MIN( a.iostorinvdis_id ) AS iostorinvdis_id
|
||||
FROM
|
||||
st_ivt_iostorinvdis a
|
||||
LEFT JOIN st_ivt_iostorinv b ON a.iostorinv_id = b.iostorinv_id
|
||||
WHERE
|
||||
b.io_type = '0'
|
||||
<if test="paramMap.new_bill_type != null and paramMap.new_bill_type != ''">
|
||||
AND b.bill_type = #{paramMap.new_bill_type}
|
||||
</if>
|
||||
<if test="paramMap.pcsn != null and paramMap.pcsn != ''">
|
||||
AND a.pcsn = #{paramMap.new_bill_type}
|
||||
</if>
|
||||
<if test="paramMap.begin_time != null and paramMap.begin_time != ''">
|
||||
AND b.confirm_time <![CDATA[ >= ]]> #{paramMap.begin_time}
|
||||
</if>
|
||||
<if test="paramMap.end_time != null and paramMap.end_time != ''">
|
||||
AND b.confirm_time <![CDATA[ <= ]]> #{paramMap.end_time}
|
||||
</if>
|
||||
AND b.bill_status = '99'
|
||||
GROUP BY
|
||||
pcsn
|
||||
) AS c
|
||||
LEFT JOIN st_ivt_iostorinvdis dis ON dis.iostorinvdis_id = c.iostorinvdis_id
|
||||
LEFT JOIN st_ivt_iostorinv mst ON mst.iostorinv_id = dis.iostorinv_id
|
||||
-- LEFT JOIN st_ivt_sectattr sect ON sect.sect_id = dis.sect_id
|
||||
LEFT JOIN md_me_materialbase mater ON mater.material_id = dis.material_id
|
||||
INNER JOIN pdm_bi_subpackagerelation sub ON sub.container_name = dis.pcsn AND sub.package_box_sn =
|
||||
dis.box_no
|
||||
LEFT JOIN md_cs_customerbase cust ON cust.cust_code = sub.customer_name
|
||||
LEFT JOIN (SELECT
|
||||
container_name,
|
||||
MAX(paper_tube_or_FRP) AS paper_tube_or_FRP,
|
||||
MAX(paper_tube_material) AS paper_tube_material,
|
||||
MAX(paper_tube_description) AS paper_tube_description,
|
||||
MAX(paper_tube_model) AS paper_tube_model,
|
||||
MAX(FRP_material) AS FRP_material,
|
||||
MAX(parent_container_name) AS parent_container_name,
|
||||
MAX(restruct_container_name) AS restruct_container_name,
|
||||
MAX(FRP_description) AS FRP_description,
|
||||
MAX(FRP_model) AS FRP_model
|
||||
FROM
|
||||
pdm_bi_slittingproductionplan plan1
|
||||
WHERE
|
||||
plan1.is_delete = '0'
|
||||
GROUP BY container_name) plan ON plan.container_name = sub.container_name
|
||||
LEFT JOIN md_me_materialbase mb ON mb.material_code = sub.box_type
|
||||
WHERE
|
||||
mst.io_type = '0'
|
||||
AND mst.is_delete = '0'
|
||||
AND mst.bill_status = '99'
|
||||
<if test="paramMap.stor_id != null and !paramMap.stor_id.isEmpty()">
|
||||
AND mst.stor_id IN
|
||||
<foreach collection="paramMap.stor_id" item="code" separator="," open="(" close=")">
|
||||
#{code}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="paramMap.is_virtual == 0">
|
||||
-- AND sect.sect_type_attr <![CDATA[ <> ]]> '09'
|
||||
</if>
|
||||
<if test="paramMap.is_virtual == 1">
|
||||
-- AND sect.sect_type_attr = '09'
|
||||
</if>
|
||||
<if test="paramMap.product_area != null and !paramMap.product_area.isEmpty()">
|
||||
AND LEFT(sub.container_name,2) IN
|
||||
<foreach collection="paramMap.product_area" item="code" separator="," open="(" close=")">
|
||||
#{code}
|
||||
</foreach>
|
||||
OR SUBSTRING(sub.container_name,2,2) IN
|
||||
<foreach collection="paramMap.product_area" item="code" separator="," open="(" close=")">
|
||||
#{code}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="paramMap.thickness_request != null and paramMap.thickness_request != ''">
|
||||
AND sub.thickness_request = #{paramMap.thickness_request}
|
||||
</if>
|
||||
<if test="paramMap.bill_type != null and paramMap.bill_type != '' and paramMap.bill_type == '0001'">
|
||||
AND IFNULL(sub.sub_type,'') = ''
|
||||
</if>
|
||||
<if test="paramMap.sale_order_name != null and paramMap.sale_order_name != ''">
|
||||
AND sub.sale_order_name = #{paramMap.sale_order_name}
|
||||
</if>
|
||||
<if test="paramMap.sap_pcsn != null and paramMap.sap_pcsn != ''">
|
||||
AND sub.sap_pcsn = #{paramMap.sap_pcsn}
|
||||
</if>
|
||||
<if test="paramMap.bill_type != null and paramMap.bill_type != '' and paramMap.bill_type == '0007'">
|
||||
AND sub.sub_type = '2'
|
||||
</if>
|
||||
<if test="paramMap.begin_time != null and paramMap.begin_time != ''">
|
||||
AND mst.confirm_time <![CDATA[ >= ]]> #{paramMap.begin_time}
|
||||
</if>
|
||||
<if test="paramMap.end_time != null and paramMap.end_time != ''">
|
||||
AND mst.confirm_time <![CDATA[ <= ]]> #{paramMap.end_time}
|
||||
</if>
|
||||
<if test="paramMap.with != null and paramMap.with != ''">
|
||||
AND CONCAT( sub.thickness_request,'*',sub.width) = #{paramMap.with}
|
||||
</if>
|
||||
<if test="paramMap.classes == 1">
|
||||
AND DATE_FORMAT( mst.confirm_time, '%H:%i:%s' ) <![CDATA[ >= ]]>'08:00:00' AND DATE_FORMAT( mst.confirm_time,
|
||||
'%H:%i:%s' ) <![CDATA[ <= ]]> '19:59:59'
|
||||
</if>
|
||||
<if test="paramMap.classes == 2">
|
||||
AND (DATE_FORMAT( mst.confirm_time, '%H:%i:%s' ) <![CDATA[ >= ]]>'20:00:00' AND DATE_FORMAT( mst.confirm_time,
|
||||
'%H:%i:%s' ) <![CDATA[ <= ]]> '23:59:59'
|
||||
OR
|
||||
DATE_FORMAT( mst.confirm_time, '%H:%i:%s' ) <![CDATA[ >= ]]>'00:00:00' AND DATE_FORMAT( mst.confirm_time,
|
||||
'%H:%i:%s' ) <![CDATA[ <= ]]> '07:59:59')
|
||||
</if>
|
||||
ORDER BY mst.confirm_time DESC, dis.box_no
|
||||
</select>
|
||||
<select id="getInBillData" resultType="org.nl.wms.stat.service.vo.InBillPageVo">
|
||||
SELECT
|
||||
mst.stor_name,
|
||||
|
||||
@@ -228,6 +228,34 @@ public class StIvtIostorinvdisServiceImpl extends ServiceImpl<StIvtIostorinvdisM
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<InBillPageVo> getInBillDatasNew(InBillPageParam paramMap) {
|
||||
String begin_time = paramMap.getBegin_time();
|
||||
String end_time = paramMap.getEnd_time();
|
||||
if (ObjectUtil.isNotEmpty(paramMap.getBill_type())) {
|
||||
paramMap.setNew_bill_type("0001".equals(paramMap.getBill_type()) ? "0007" : "-1");
|
||||
}
|
||||
// 处理时间
|
||||
if (ObjectUtil.isNotEmpty(begin_time) && ObjectUtil.isNotEmpty(end_time)) {
|
||||
String begin_time_today = begin_time.substring(0, 10);
|
||||
String end_time_today = end_time.substring(0, 10);
|
||||
// 开始时间
|
||||
String today_begin_time = begin_time_today + " 08:00:00";
|
||||
// 结束时间:19:59:59
|
||||
DateTime parse = DateUtil.parse(end_time_today);
|
||||
String substring = DateUtil.offsetDay(parse, 1).toString().substring(0, 10);
|
||||
String today_end_time = substring + " 07:59:59";
|
||||
paramMap.setBegin_time(today_begin_time);
|
||||
paramMap.setEnd_time(today_end_time);
|
||||
}
|
||||
if ("0".equals(paramMap.getIs_all())) {
|
||||
return stIvtIostorinvdisMapper.getInBillDataNew(paramMap);
|
||||
} else {
|
||||
return stIvtIostorinvdisMapper.getInBillAllData(paramMap);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public IPage<OutBillPageVo> getOutBillPage(OutBillPageParam paramMap, PageQuery page) {
|
||||
// 空格查询
|
||||
|
||||
@@ -15,6 +15,7 @@ import org.nl.common.constants.FieldConstant;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.system.service.menu.dao.SysMenu;
|
||||
import org.nl.system.service.menu.dao.mapper.SysMenuMapper;
|
||||
import org.nl.system.service.role.ISysRoleService;
|
||||
import org.nl.system.service.role.dao.SysRole;
|
||||
@@ -131,10 +132,32 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
|
||||
JSONObject object = menus.getJSONObject(i);
|
||||
menuIds.add(object.getString("menuId"));
|
||||
}
|
||||
// 删除当前角色绑定的菜单
|
||||
|
||||
Set<String> allMenuIds = new HashSet<>(menuIds);
|
||||
addAllParentMenus(allMenuIds);
|
||||
|
||||
roleMapper.deleteRoleMenuBatchRoleIds(Arrays.asList(roleId));
|
||||
// 插入数据
|
||||
roleMapper.insertRoleMenu(roleId, menuIds);
|
||||
roleMapper.insertRoleMenu(roleId, allMenuIds);
|
||||
}
|
||||
|
||||
private void addAllParentMenus(Set<String> menuIds) {
|
||||
Set<String> menuIdsToQuery = new HashSet<>(menuIds);
|
||||
// Map<String, SysMenu> menuMap = new HashMap<>();
|
||||
|
||||
while (!menuIdsToQuery.isEmpty()) {
|
||||
List<String> queryList = new ArrayList<>(menuIdsToQuery);
|
||||
menuIdsToQuery.clear();
|
||||
|
||||
List<SysMenu> menus = sysMenuMapper.selectBatchIds(queryList);
|
||||
for (SysMenu menu : menus) {
|
||||
// menuMap.put(menu.getMenu_id(), menu);
|
||||
String pid = menu.getPid();
|
||||
if (StringUtils.isNotEmpty(pid) && !"0".equals(pid) && !menuIds.contains(pid)) {
|
||||
menuIds.add(pid);
|
||||
menuIdsToQuery.add(pid);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -64,6 +64,8 @@ import org.nl.wms.pdm.bi.service.dto.SubpackagerelationDto;
|
||||
import org.nl.wms.sch.manage.AbstractAcsTask;
|
||||
import org.nl.wms.sch.tasks.CoolCutTask;
|
||||
import org.nl.wms.st.instor.service.impl.ProductScrapServiceImpl;
|
||||
import org.nl.wms.util.DateCalculateUtil;
|
||||
import org.nl.wms.util.WeightUnitConverterUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -1229,7 +1231,7 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
||||
String ProductName = param.getString("ProductName"); // 来源卷位置
|
||||
String Description = param.getString("Description"); // 来源卷位置
|
||||
String DateOfFGInbound = param.getString("DateOfFGInbound"); // 来源卷位置
|
||||
String BoxWeight = param.getString("BoxWeight"); // 来源卷位置
|
||||
String BoxWeight = param.getString("BoxWeight"); // 木箱净重
|
||||
String BoxWeight2 = "";
|
||||
if (ObjectUtil.isEmpty(BoxWeight) || param.getDoubleValue("BoxWeight") == 0) {
|
||||
BoxWeight2 = "0";
|
||||
@@ -1241,6 +1243,14 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
||||
String box_high = param.getString("Attribute4"); // 木箱料号
|
||||
String sub_type = param.getString("Attribute5"); // 包装关系类型
|
||||
String ext_code = param.getString("Attribute6"); // 储存地点
|
||||
|
||||
String box_actual_net_weight = param.getString("BoxActualNetWeight"); // 实际木箱重量
|
||||
String box_customer_sn = param.getString("BoxCustomerSN"); // 客户木箱唯一序列号
|
||||
String customer_material_code = param.getString("CustomerMaterialCode"); // 客户木箱唯一序列号
|
||||
String customer_material_desc = param.getString("CustomerMaterialDesc"); // 客户物料名称
|
||||
|
||||
BigDecimal total_net_weight = BigDecimal.ZERO;
|
||||
|
||||
JSONArray details = param.getJSONArray("details");
|
||||
if (ObjectUtil.isEmpty(details)) {
|
||||
throw new BadRequestException("明细为空");
|
||||
@@ -1256,7 +1266,15 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
||||
String Width = detail.getString("Width"); // 分切机台编码
|
||||
String Thickness = detail.getString("Thickness"); // 分切组
|
||||
String MassPerUnitArea = detail.getString("MassPerUnitArea"); // 生产顺序
|
||||
String NetWeight = detail.getString("NetWeight"); // 生产订单
|
||||
String NetWeight = detail.getString("NetWeight"); // 净重
|
||||
|
||||
if (NetWeight != null && NetWeight.matches("^\\d+(\\.\\d+)?$")) {
|
||||
total_net_weight = total_net_weight.add(new BigDecimal(NetWeight));
|
||||
} else {
|
||||
// 处理非法数据(如赋值为0、抛出业务异常、打印日志等)
|
||||
throw new BadRequestException("净重不为数字");
|
||||
}
|
||||
|
||||
String Length = detail.getString("Length");
|
||||
String DateOfProduction = detail.getString("DateOfProduction");
|
||||
String isUnPlanProduction = detail.getString("isUnPlanProduction");
|
||||
@@ -1272,6 +1290,11 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
||||
String Attribute7 = detail.getString("Attribute7");//包装关系类型
|
||||
String Attribute8 = detail.getString("Attribute8");//产品类型
|
||||
int Attribute9 = detail.getIntValue("Attribute9");//接头数
|
||||
String customer_batch_number = detail.getString("CustomerBatchNumber"); // 客户要求批号
|
||||
String customer_roll_name = detail.getString("CustomerRollName"); // 子卷的客户卷号
|
||||
String roll_package_material_al_weight = detail.getString("RollPackageMaterialAlWeight"); // 子卷铝箔袋重量
|
||||
String roll_fc_weight = detail.getString("RollFCWeight"); // 子卷辅材重量
|
||||
String roll_remark = detail.getString("RollRemark"); // 子卷备注
|
||||
if (ObjectUtil.isNotEmpty(Attribute7) && "1".equals(Attribute7)) {
|
||||
sub_type = "2";
|
||||
}
|
||||
@@ -1379,8 +1402,13 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
||||
entity.setActual_value(actual_value);
|
||||
entity.setQuanlity_in_box(NumberUtil.toBigDecimal(QuanlityInBox).setScale(2, RoundingMode.DOWN));
|
||||
entity.setExt_code(ext_code);
|
||||
entity.setBox_actual_net_weight(box_actual_net_weight);
|
||||
entity.setBox_customer_sn(box_customer_sn);
|
||||
entity.setCustomer_name(customer_material_code);
|
||||
entity.setCustomer_material_desc(customer_material_desc);
|
||||
|
||||
BigDecimal boxWeightBigDecimal = new BigDecimal(BoxWeight).setScale(2, RoundingMode.DOWN);
|
||||
|
||||
BigDecimal boxWeightBigDecimal = new BigDecimal(BoxWeight);
|
||||
entity.setBox_weight(boxWeightBigDecimal);
|
||||
if (BigDecimal.ZERO.compareTo(boxWeightBigDecimal) == 0) {
|
||||
BoxWeight2 = String.valueOf(NumberUtil.add(BoxWeight2, NetWeight));
|
||||
@@ -1413,19 +1441,31 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
||||
entity.setThickness_request(thickness_request);
|
||||
entity.setMaterial_type(Attribute8);
|
||||
entity.setJoint_type(String.valueOf(Attribute9));
|
||||
entity.setCustomer_roll_name(customer_roll_name);
|
||||
entity.setCustomer_batch_number(customer_batch_number);
|
||||
entity.setRoll_package_material_al_weight(roll_package_material_al_weight);
|
||||
entity.setRoll_fc_weight(roll_fc_weight);
|
||||
entity.setRoll_remark(roll_remark);
|
||||
entity.setStatus("0");
|
||||
entity.setCreate_id(1L);
|
||||
entity.setCreate_name("管理员");
|
||||
entity.setCreate_time(DateUtil.now());
|
||||
|
||||
//计算
|
||||
entity.setTotal_net_weight(total_net_weight);
|
||||
entity.setNet_weight_convert(WeightUnitConverterUtil.convertKgToLbm(total_net_weight,2,RoundingMode.HALF_UP));
|
||||
entity.setWarranty_expire_date(DateCalculateUtil.addDateWithDays(DateOfFGInbound,QualityGuaranPeriod));
|
||||
|
||||
// ========== 2. 插入数据(替换原tab.insert(jo)) ==========
|
||||
pdmBiSubpackagerelationMapper.insert(entity);
|
||||
|
||||
PdmBiSubpackagerelation pdmBiSubpackagerelationUpdate = new PdmBiSubpackagerelation();
|
||||
if (StrUtil.equals(BoxWeight, "0")) {
|
||||
pdmBiSubpackagerelationUpdate.setBox_weight(NumberUtil.toBigDecimal(BoxWeight2).setScale(2, RoundingMode.DOWN));
|
||||
pdmBiSubpackagerelationUpdate.setBox_weight(NumberUtil.toBigDecimal(BoxWeight2));
|
||||
pdmBiSubpackagerelationUpdate.setGross_weight_convert(WeightUnitConverterUtil.convertKgToLbm(NumberUtil.toBigDecimal(BoxWeight2),2,RoundingMode.HALF_UP));
|
||||
} else {
|
||||
pdmBiSubpackagerelationUpdate.setBox_weight(NumberUtil.toBigDecimal(BoxWeight).setScale(2, RoundingMode.DOWN));
|
||||
pdmBiSubpackagerelationUpdate.setBox_weight(NumberUtil.toBigDecimal(BoxWeight));
|
||||
pdmBiSubpackagerelationUpdate.setGross_weight_convert(WeightUnitConverterUtil.convertKgToLbm(NumberUtil.toBigDecimal(BoxWeight),2,RoundingMode.HALF_UP));
|
||||
}
|
||||
pdmBiSubpackagerelationMapper.update(pdmBiSubpackagerelationUpdate, new LambdaUpdateWrapper<PdmBiSubpackagerelation>()
|
||||
.eq(PdmBiSubpackagerelation::getPackage_box_sn, PackageBoxSN));
|
||||
|
||||
@@ -57,4 +57,11 @@ public class InBillQueryController {
|
||||
public void downloadInBillTable(HttpServletResponse response, InBillPageParam whereJson, PageQuery page) throws IOException {
|
||||
inBillQueryService.downloadInBillTable(response, whereJson, page);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping(value = "/download3")
|
||||
@Log("导出成品入库数据新")
|
||||
public void downloadInBillTableNew(HttpServletResponse response, InBillPageParam whereJson, PageQuery page) throws IOException {
|
||||
inBillQueryService.downloadInBillTableNew(response, whereJson, page);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,4 +73,14 @@ public interface InBillQueryService {
|
||||
* @return
|
||||
*/
|
||||
void downloadInBillTable(HttpServletResponse response, InBillPageParam whereJson, PageQuery page) throws IOException;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param whereJson
|
||||
* @param page
|
||||
* @return
|
||||
*/
|
||||
void downloadInBillTableNew(HttpServletResponse response, InBillPageParam whereJson, PageQuery page) throws IOException;
|
||||
|
||||
}
|
||||
|
||||
@@ -654,4 +654,44 @@ public class InBillQueryServiceImpl implements InBillQueryService {
|
||||
FileUtil.downloadExcel(list, response);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void downloadInBillTableNew(HttpServletResponse response, InBillPageParam whereJson, PageQuery page) throws IOException {
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
List<InBillPageVo> inBillPageVos = iostorinvdisService.getInBillDatasNew(whereJson);
|
||||
for (int i = 0; i < inBillPageVos.size(); i++) {
|
||||
InBillPageVo billPageVo = inBillPageVos.get(i);
|
||||
Map<String, Object> mp = new LinkedHashMap<>();
|
||||
mp.put("成品卷号", billPageVo.getParent_container_name());
|
||||
mp.put("入库日期", billPageVo.getConfirm_time());
|
||||
mp.put("装箱日期", billPageVo.getDate_of_production().replace("-", "/"));
|
||||
mp.put("客户名称", billPageVo.getCust_name());
|
||||
try {
|
||||
mp.put("订单号", billPageVo.getSale_order_name().substring(0, billPageVo.getSale_order_name().indexOf("-")));
|
||||
} catch (Exception e) {
|
||||
mp.put("订单号", billPageVo.getSale_order_name());
|
||||
}
|
||||
mp.put("批号", billPageVo.getCustomer_batch_number());
|
||||
mp.put("物料号", billPageVo.getCustomer_material_code());
|
||||
mp.put("箱号", billPageVo.getBox_no());
|
||||
mp.put("客户箱号/序列号", billPageVo.getBox_customer_sn() );
|
||||
mp.put("客户卷号", billPageVo.getCustomer_roll_name());
|
||||
mp.put("客户要求厚度", billPageVo.getThickness_request());
|
||||
mp.put("客户要求幅宽", String.format("%.0f", Double.parseDouble(billPageVo.getWidth_standard())));
|
||||
//怎么取 现在还不明确
|
||||
mp.put("规格", billPageVo.getThickness_request());
|
||||
mp.put("子卷净重", NumberUtil.round(StrUtil.isEmpty(billPageVo.getNet_weight()) ? "0" : billPageVo.getNet_weight(), 1));
|
||||
mp.put("米数(长度)", NumberUtil.round(StrUtil.isEmpty(billPageVo.getLength()) ? "0" : billPageVo.getLength(), 1));
|
||||
mp.put("净重合计",billPageVo.getTotal_net_weight());
|
||||
mp.put("毛重合计", NumberUtil.round(StrUtil.isEmpty(billPageVo.getBox_weight()) ? "0" : billPageVo.getBox_weight(), 1));
|
||||
mp.put("备注", "");
|
||||
mp.put("净重转换",billPageVo.getNet_weight_convert());
|
||||
mp.put("毛重转换",billPageVo.getGross_weight_convert());
|
||||
mp.put("质保截止日期",billPageVo.getWarranty_expire_date());
|
||||
list.add(mp);
|
||||
}
|
||||
|
||||
FileUtil.downloadExcel(list, response);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -75,4 +75,18 @@ public class InBillPageVo {
|
||||
private String box_size;
|
||||
/** 日期 */
|
||||
private String confirm_time_class;
|
||||
|
||||
private String box_customer_sn;
|
||||
private String customer_material_code;
|
||||
private String customer_material_desc;
|
||||
private String customer_batch_number;
|
||||
private String customer_roll_name;
|
||||
private String roll_package_material_al_weight;
|
||||
private String roll_fc_weight;
|
||||
private String roll_remark;
|
||||
private String total_net_weight;
|
||||
private String net_weight_convert;
|
||||
private String gross_weight_convert;
|
||||
private String warranty_expire_date;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
package org.nl.wms.util;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
|
||||
/**
|
||||
* 日期工具类:移除RegexUtil,基于Hutool DateUtil实现 「字符串日期 + 字符串天数」的计算
|
||||
*/
|
||||
public class DateCalculateUtil {
|
||||
// 优化点:提取日期格式为常量,便于后续修改,符合规范
|
||||
private static final String DATE_PATTERN = "yyyy-MM-dd";
|
||||
|
||||
/**
|
||||
* 计算指定日期加上指定天数后的结果(输入输出均为字符串格式)
|
||||
* @param dateStr 原始日期字符串(格式:yyyy-MM-dd,如2022-12-24)
|
||||
* @param daysStr 天数字符串(格式:数字+天,如90天、120天)
|
||||
* @return 相加后的日期字符串(格式:yyyy-MM-dd)
|
||||
* @throws BadRequestException 入参为空/格式非法/转换失败时抛出自定义业务异常
|
||||
*/
|
||||
public static String addDateWithDays(String dateStr, String daysStr) {
|
||||
// 1. 非空校验
|
||||
if (StrUtil.isEmpty(dateStr)) {
|
||||
throw new BadRequestException("原始日期字符串不能为空,要求格式为yyyy-MM-dd");
|
||||
}
|
||||
if (StrUtil.isEmpty(daysStr)) {
|
||||
throw new BadRequestException("天数字符串不能为空,要求格式为「数字+天」(如90天)");
|
||||
}
|
||||
|
||||
// 2. 解析原始日期字符串为Date对象(显式指定格式,更严谨)
|
||||
java.util.Date originalDate;
|
||||
try {
|
||||
originalDate = DateUtil.parse(dateStr, DATE_PATTERN);
|
||||
} catch (Exception e) {
|
||||
// 优化点:统一抛出自定义业务异常,异常信息更友好,便于前端展示
|
||||
throw new BadRequestException("原始日期格式非法,要求格式为yyyy-MM-dd,当前输入:" + dateStr);
|
||||
}
|
||||
|
||||
// 3. 替代RegexUtil:提取daysStr中的纯数字(处理"90天"、" 120天 "等格式)
|
||||
// 步骤1:先去除前后空格,再替换所有非数字字符为空,只保留数字
|
||||
String pureNumStr = daysStr.trim().replaceAll("\\D", "");
|
||||
// 步骤2:判断提取后是否为空(无有效数字)
|
||||
if (StrUtil.isEmpty(pureNumStr)) {
|
||||
throw new BadRequestException("天数格式非法,要求格式为「数字+天」(如90天),当前输入:" + daysStr);
|
||||
}
|
||||
// 步骤3:转换为整数
|
||||
int days;
|
||||
try {
|
||||
days = Integer.parseInt(pureNumStr);
|
||||
} catch (NumberFormatException e) {
|
||||
// 优化点:统一抛出自定义业务异常,避免抛出原生IllegalArgumentException
|
||||
throw new BadRequestException("提取的天数无法转换为有效整数,当前输入:" + daysStr);
|
||||
}
|
||||
|
||||
// 4. 核心:使用DateUtil.offsetDay()添加天数
|
||||
java.util.Date resultDate = DateUtil.offsetDay(originalDate, days);
|
||||
|
||||
// 5. 格式化结果日期为字符串
|
||||
return DateUtil.format(resultDate, DATE_PATTERN);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package org.nl.wms.util;
|
||||
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
|
||||
/**
|
||||
* 重量单位转换工具类:kg(千克)→ lbm(磅)
|
||||
*/
|
||||
public class WeightUnitConverterUtil {
|
||||
// 核心换算常量:1 kg = 2.20462262185 lbm(用BigDecimal存储,保证精度,不可修改)
|
||||
private static final BigDecimal KG_TO_LBM_RATIO = new BigDecimal("2.20462262185");
|
||||
// 优化点:提取默认小数位数为常量,便于后续修改
|
||||
private static final int DEFAULT_SCALE = 4;
|
||||
|
||||
/**
|
||||
* 千克(kg)转换为磅(lbm)- 默认保留4位小数,四舍五入(RoundingMode.HALF_UP)
|
||||
* @param kg 待转换的千克数(BigDecimal类型),不可为null
|
||||
* @return 转换后的磅数(BigDecimal)
|
||||
* @throws BadRequestException 入参为null时抛出自定义业务异常
|
||||
*/
|
||||
public static BigDecimal convertKgToLbm(BigDecimal kg) {
|
||||
// 1. 非空校验,优化点:统一抛出自定义业务异常,替换原生NullPointerException
|
||||
if (kg == null) {
|
||||
throw new BadRequestException("入参kg(千克数)不能为null");
|
||||
}
|
||||
// 2. 核心转换:kg × 换算常量,默认保留4位小数,四舍五入
|
||||
return kg.multiply(KG_TO_LBM_RATIO).setScale(DEFAULT_SCALE, RoundingMode.HALF_UP);
|
||||
}
|
||||
|
||||
/**
|
||||
* 千克(kg)转换为磅(lbm)- 支持自定义保留小数位数和舍入模式
|
||||
* @param kg 待转换的千克数(BigDecimal类型),不可为null
|
||||
* @param scale 保留的小数位数
|
||||
* @param roundingMode 舍入模式(如RoundingMode.HALF_UP:四舍五入)
|
||||
* @return 转换后的磅数(BigDecimal)
|
||||
* @throws BadRequestException 入参为null/小数位数为负数时抛出自定义业务异常
|
||||
*/
|
||||
public static BigDecimal convertKgToLbm(BigDecimal kg, int scale, RoundingMode roundingMode) {
|
||||
// 1. 非空校验
|
||||
if (kg == null) {
|
||||
throw new BadRequestException("入参kg(千克数)不能为null");
|
||||
}
|
||||
if (roundingMode == null) {
|
||||
throw new BadRequestException("入参roundingMode(舍入模式)不能为null");
|
||||
}
|
||||
// 2. 校验小数位数合法性(不能为负数)
|
||||
if (scale < 0) {
|
||||
throw new BadRequestException("保留小数位数scale不能为负数,当前输入:" + scale);
|
||||
}
|
||||
// 3. 核心转换:kg × 换算常量,自定义精度和舍入模式
|
||||
return kg.multiply(KG_TO_LBM_RATIO).setScale(scale, roundingMode);
|
||||
}
|
||||
}
|
||||
@@ -86,29 +86,14 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="$t('wms.basedata.master.material.materialCategory')" prop="material_type_id">
|
||||
<el-select
|
||||
v-model="form.material_type_id"
|
||||
size="mini"
|
||||
:placeholder="$t('wms.basedata.master.material.pleaseSelect')"
|
||||
class="filter-item"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.material_type"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
<el-form-item :label="$t('wms.basedata.master.material.isEnabled')" prop="is_used">
|
||||
<el-radio v-model="form.is_used" label="0">{{ $t('wms.basedata.master.material.no') }}</el-radio>
|
||||
<el-radio v-model="form.is_used" label="1">{{ $t('wms.basedata.master.material.yes') }}</el-radio>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="$t('wms.basedata.master.material.isEnabled')" prop="is_used">
|
||||
<el-radio v-model="form.is_used" label="0">{{ $t('wms.basedata.master.material.no') }}</el-radio>
|
||||
<el-radio v-model="form.is_used" label="1">{{ $t('wms.basedata.master.material.yes') }}</el-radio>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
@@ -130,8 +115,6 @@
|
||||
<el-table-column prop="material_name" :label="$t('wms.basedata.master.material.materialName')" width="180" show-overflow-tooltip />
|
||||
<el-table-column prop="material_spec" :label="$t('wms.basedata.master.material.materialSpecification')" width="140" />
|
||||
<el-table-column prop="material_model" :label="$t('wms.basedata.master.material.materialModel')" />
|
||||
<el-table-column prop="class_code" :label="$t('wms.basedata.master.material.materialClassCode')" width="120" />
|
||||
<el-table-column prop="class_name" :label="$t('wms.basedata.master.material.materialClass')" width="140" />
|
||||
<el-table-column prop="unit_name" :label="$t('wms.basedata.master.material.measureUnit')" />
|
||||
<el-table-column prop="standing_time" :label="$t('wms.basedata.master.material.standingTimeMinutes')" width="130px" />
|
||||
<el-table-column :label="$t('wms.basedata.master.material.enabled')" align="center" prop="is_used">
|
||||
|
||||
@@ -639,15 +639,15 @@ export default {
|
||||
},
|
||||
oneSetPoint2() {
|
||||
if (this.form2.point_code === '') {
|
||||
this.crud.notify('请先选择站点!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
this.crud.notify(this.$t('common.pleaseSelectSiteFirst'), CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
if (this.currentDis.point_code) {
|
||||
this.crud.notify('站点已设置!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
this.crud.notify(this.$t('common.siteHasBeenSet'), CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
if (this.currentDis.work_status !== '00') {
|
||||
this.crud.notify('任务已生成!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
this.crud.notify(this.$t('common.taskAlreadyGenerated'), CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
this.loadingSetPoint = true
|
||||
@@ -667,7 +667,7 @@ export default {
|
||||
allSetPoint() {
|
||||
if (this.mstrow.stor_id !== '1582991156504039455') {
|
||||
if (this.form2.point_code === '') {
|
||||
this.crud.notify('请先选择站点!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
this.crud.notify(this.$t('common.pleaseSelectSiteFirst'), CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
}
|
||||
@@ -681,7 +681,7 @@ export default {
|
||||
this.currentRow.stor_id = this.mstrow.stor_id
|
||||
checkoutbill.allSetPoint(this.currentRow).then(res => {
|
||||
this.queryTableDdis(this.currentRow.iostorinvdtl_id)
|
||||
this.crud.notify('设置成功!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
this.crud.notify(this.$t('common.settingSuccessful'), CRUD.NOTIFICATION_TYPE.INFO)
|
||||
this.loadingSetAllPoint = false
|
||||
}).catch(() => {
|
||||
this.loadingSetAllPoint = false
|
||||
@@ -709,7 +709,7 @@ export default {
|
||||
allSetPointAllDtl() {
|
||||
if (this.mstrow.stor_id !== '1582991156504039455') {
|
||||
if (this.form2.point_code === '') {
|
||||
this.crud.notify('请先选择站点!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
this.crud.notify(this.$t('common.pleaseSelectSiteFirst'), CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
}
|
||||
@@ -723,7 +723,7 @@ export default {
|
||||
}
|
||||
checkoutbill.allSetPoint(data).then(res => {
|
||||
this.queryTableDdis(this.currentRow.iostorinvdtl_id)
|
||||
this.crud.notify('设置成功!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
this.crud.notify(this.$t('common.settingSuccessful'), CRUD.NOTIFICATION_TYPE.INFO)
|
||||
this.loadingSetAllPoint = false
|
||||
}).catch(() => {
|
||||
this.loadingSetAllPoint = false
|
||||
|
||||
@@ -459,7 +459,7 @@ export default {
|
||||
data.end_time = this.crud.query.createTime[1]
|
||||
}
|
||||
this.showDtlLoading = true
|
||||
download('/api/in/InQuery/download2', data).then(result => {
|
||||
download('/api/in/InQuery/download3', data).then(result => {
|
||||
downloadFile(result, '成品入库查询', 'xlsx')
|
||||
this.showDtlLoading = false
|
||||
}).catch(() => {
|
||||
|
||||
Reference in New Issue
Block a user