报工新页面,计件工资界面编写。

master
Yangwl 1 year ago
parent 91f358251a
commit 274798eff7

@ -70,7 +70,6 @@ public class MesReportWorkController extends BaseController {
List<MesReportWork> hzlist = mesReportWorkService.getReportWorkHzList(mesReportWork);
return getDataTable(hzlist);
}
/**
*
*/

@ -0,0 +1,33 @@
package com.op.mes.controller;
import com.op.common.core.web.controller.BaseController;
import com.op.common.core.web.page.TableDataInfo;
import com.op.common.security.annotation.RequiresPermissions;
import com.op.mes.domain.MesReportWork;
import com.op.mes.service.IMesReportWorksService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import static com.op.common.core.utils.PageUtils.startPage;
@RestController
@RequestMapping("/reportWorks")
public class MesReportWorksController extends BaseController {
@Autowired
private IMesReportWorksService mesReportWorksService;
/**
* 线
*/
@RequiresPermissions("mes:reportWork:lists")
@GetMapping("/lists")
public TableDataInfo lists(MesReportWork mesReportWork) {
startPage();
List<MesReportWork> hzlist = mesReportWorksService.getReportWorksList(mesReportWork);
return getDataTable(hzlist);
}
}

@ -0,0 +1,10 @@
package com.op.mes.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/unitPriceReport")
public class MesUnitPriceReportController {
}

@ -220,6 +220,15 @@ public class MesReportWork extends BaseEntity {
private Long workTimes;
private String workCenter;
private String shiftId;
private String keywords;
public String getKeywords() {
return keywords;
}
public void setKeywords(String keywords) {
this.keywords = keywords;
}
private List<MesReportWorkConsume> consumesInfos;

@ -0,0 +1,15 @@
package com.op.mes.mapper;
import com.op.mes.domain.MesReportWork;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface MesReportWorksMapper {
List<MesReportWork> getReportWorkList(MesReportWork mesReportWork);
}

@ -21,6 +21,8 @@ public interface MesUnitPriceMapper {
*/
public MesUnitPrice selectMesUnitPriceByPicId(String picId);
public MesUnitPrice selectMesUnitPriceByProCode(MesUnitPrice mesUnitPrice);
/**
* unitPrice
*

@ -0,0 +1,11 @@
package com.op.mes.service;
import com.op.mes.domain.MesReportWork;
import java.util.List;
public interface IMesReportWorksService {
List<MesReportWork> getReportWorksList(MesReportWork mesReportWork);
}

@ -0,0 +1,24 @@
package com.op.mes.service.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.mes.domain.MesReportWork;
import com.op.mes.mapper.MesReportWorksMapper;
import com.op.mes.service.IMesReportWorksService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class MesReportWorksServiceImpl implements IMesReportWorksService {
@Autowired
private MesReportWorksMapper mesReportWorksMapper;
@Override
@DS("#header.poolName")
public List<MesReportWork> getReportWorksList(MesReportWork mesReportWork) {
return mesReportWorksMapper.getReportWorkList(mesReportWork);
}
}

@ -6,6 +6,7 @@ import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.exception.ServiceException;
import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.StringUtils;
import com.op.common.core.utils.bean.BeanValidators;
import com.op.common.core.utils.uuid.IdUtils;
import com.op.mes.domain.MesUnitPrice;
import com.op.mes.mapper.MesUnitPriceMapper;
@ -15,6 +16,8 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.validation.Validator;
/**
* unitPriceService
@ -30,6 +33,9 @@ public class MesUnitPriceServiceImpl implements IMesUnitPriceService {
@Autowired
private MesUnitPriceMapper mesUnitPriceMapper;
@Autowired
protected Validator validator;
/**
* unitPrice
@ -106,7 +112,7 @@ public class MesUnitPriceServiceImpl implements IMesUnitPriceService {
@DS("#header.poolName")
public String importMesUnitPrice(List<MesUnitPrice> UnitPriceList, Boolean updateSupport, String operName) {
if (StringUtils.isNull(UnitPriceList) || UnitPriceList.size() == 0) {
throw new ServiceException("导入数据不能为空!");
throw new ServiceException("导入用户数据不能为空!");
}
int successNum = 0;
int failureNum = 0;
@ -114,15 +120,22 @@ public class MesUnitPriceServiceImpl implements IMesUnitPriceService {
StringBuilder failureMsg = new StringBuilder();
for (MesUnitPrice mesUnitPrice : UnitPriceList) {
try {
// 验证是否存在这个产线产品
mesUnitPrice.setPicId(IdUtils.simpleUUID());
mesUnitPriceMapper.insertMesUnitPrice(mesUnitPrice);
successNum++;
successMsg.append("导入成功");
// 验证是否存在这个产品的单价信息
MesUnitPrice u=mesUnitPriceMapper.selectMesUnitPriceByProCode(mesUnitPrice);
if (StringUtils.isNull(u)) {
BeanValidators.validateWithException(validator, mesUnitPrice);
mesUnitPrice.setPicId(IdUtils.simpleUUID());
mesUnitPriceMapper.insertMesUnitPrice(mesUnitPrice);
successNum++;
successMsg.append("<br/>" + successNum + mesUnitPrice.getProductName()+"-"+mesUnitPrice.getChildprocessName() + " 导入成功");
}
else {
failureNum++;
failureMsg.append("<br/>" + failureNum + "、产品 " + mesUnitPrice.getProductName() + " 已存在");
}
} catch (Exception e) {
failureNum++;
String msg = "导入失败:";
String msg = "<br/>" + failureNum + "、产品 " + mesUnitPrice.getProductName() + " 导入失败:";
failureMsg.append(msg + e.getMessage());
log.error(msg, e);
}
@ -134,5 +147,34 @@ public class MesUnitPriceServiceImpl implements IMesUnitPriceService {
successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:");
}
return successMsg.toString();
// if (StringUtils.isNull(UnitPriceList) || UnitPriceList.size() == 0) {
// throw new ServiceException("导入数据不能为空!");
// }
// int successNum = 0;
// int failureNum = 0;
// StringBuilder successMsg = new StringBuilder();
// StringBuilder failureMsg = new StringBuilder();
// for (MesUnitPrice mesUnitPrice : UnitPriceList) {
// try {
// // 验证是否存在这个产线产品
// mesUnitPrice.setPicId(IdUtils.simpleUUID());
// mesUnitPriceMapper.insertMesUnitPrice(mesUnitPrice);
// successNum++;
// successMsg.append("导入成功");
//
// } catch (Exception e) {
// failureNum++;
// String msg = "导入失败:";
// failureMsg.append(msg + e.getMessage());
// log.error(msg, e);
// }
// }
// if (failureNum > 0) {
// failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:");
// throw new ServiceException(failureMsg.toString());
// } else {
// successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:");
// }
// return successMsg.toString();
}
}

@ -0,0 +1,97 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.op.mes.mapper.MesReportWorksMapper">
<resultMap type="MesReportWork" id="MesReportWorkResult">
<result property="id" column="id" />
<result property="reportType" column="report_type" />
<result property="reportCode" column="report_code" />
<result property="workorderCode" column="workorder_code" />
<result property="workorderCodeSap" column="workorder_code_sap" />
<result property="productCode" column="product_code" />
<result property="productName" column="product_name" />
<result property="spec" column="spec" />
<result property="unit" column="unit" />
<result property="quantity" column="quantity" />
<result property="quantityFeedback" column="quantity_feedback" />
<result property="quantityQualified" column="quantity_qualified" />
<result property="quantityUnqualified" column="quantity_unqualified" />
<result property="userName" column="user_name" />
<result property="nickName" column="nick_name" />
<result property="feedbackChannel" column="feedback_channel" />
<result property="feedbackTime" column="feedback_time" />
<result property="recordUser" column="record_user" />
<result property="status" column="status" />
<result property="remark" column="remark" />
<result property="workTime" column="work_time" />
<result property="useMan" column="use_man" />
<result property="machineCode" column="machine_code" />
<result property="machineName" column="machine_name" />
<result property="teamCode" column="team_code" />
<result property="shiftCode" column="shift_code" />
<result property="attr1" column="attr1" />
<result property="attr2" column="attr2" />
<result property="attr3" column="attr3" />
<result property="attr4" column="attr4" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="updateBy" column="update_by" />
<result property="uploadTime" column="upload_time" />
<result property="uploadStatus" column="upload_status" />
<result property="uploadMsg" column="upload_msg" />
<result property="orderCode" column="order_code" />
<result property="batch" column="batch" />
<result property="materialCode" column="material_code" />
<result property="materialName" column="material_name" />
<result property="materialNameUnit" column="material_name_unit" />
</resultMap>
<resultMap type="com.op.system.api.domain.mes.ProOrderWorkorderDTO" id="ProOrderWorkorderDTOResult">
<result property="workorderId" column="workorder_id" />
<result property="workorderCode" column="workorder_code" />
<result property="workorderName" column="workorder_name" />
<result property="orderId" column="order_id" />
<result property="orderCode" column="order_code" />
<result property="productId" column="product_id" />
<result property="productCode" column="product_code" />
<result property="productName" column="product_name" />
<result property="productSpc" column="product_spc" />
<result property="unit" column="unit" />
<result property="quantityProduced" column="quantity_produced" />
<result property="quantitySplit" column="quantity_split" />
<result property="routeCode" column="route_code" />
<result property="prodLineCode" column="prod_line_code" />
<result property="productDate" column="product_date" />
<result property="shiftId" column="shift_id" />
<result property="parentOrder" column="parent_order" />
<result property="ancestors" column="ancestors" />
<result property="status" column="status" />
<result property="remark" column="remark" />
<result property="attr1" column="attr1" />
<result property="attr2" column="attr2" />
<result property="attr3" column="attr3" />
<result property="attr4" column="attr4" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="prodType" column="prod_type" />
<result property="factoryCode" column="factory_code" />
<result property="endFlag" column="end_flag" />
<result property="carNum" column="car_num" />
<result property="sortNo" column="sort_no" />
<result property="workorderCodes" column="workorderCodes" />
<result property="productCodes" column="productCodes" />
<result property="productNames" column="productNames" />
<result property="quantitySplits" column="quantitySplits" />
<result property="units" column="units" />
</resultMap>
<select id="getReportWorkList" resultMap="MesReportWorkResult" parameterType="MesReportWork">
</select>
</mapper>

@ -500,6 +500,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
unit
from mes_report_work
where del_flag = '0' and parent_order = '0'
<if test="keywords != null and keywords != ''"> and workorder_code like concat('%', #{workorderCode}, '%')</if>
<if test="workorderCode != null and workorderCode != ''"> and workorder_code like concat('%', #{workorderCode}, '%')</if>
<if test="productCode != null and productCode != ''"> and product_code like concat('%', #{productCode}, '%')</if>
<if test="productName != null and productName != ''"> and product_name like concat('%', #{productName}, '%')</if>
@ -513,6 +514,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join pro_order_workorder pow on mrw.workorderCode = pow.workorder_code
<where>
pow.del_flag = '0'
<if test="keywords != null and keywords != ''">
and pow.order_code like concat('%', #{keywords}, '%') or
pow.workorder_code_sap like concat('%', #{keywords}, '%') or
mrw.productCode like concat('%', #{keywords}, '%')
</if>
<if test="feedbackTimeStart != null "> and pow.product_date >= #{feedbackTimeStart}</if>
<if test="feedbackTimeEnd != null "> and #{feedbackTimeEnd} >= pow.product_date</if>
<if test="orderCode != null and orderCode != ''"> and pow.order_code like concat('%', #{orderCode}, '%')</if>

@ -52,6 +52,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectMesUnitPriceVo"/>
where pic_id = #{picId}
</select>
<select id="selectMesUnitPriceByProCode" parameterType="MesUnitPrice" resultMap="MesUnitPriceResult">
<include refid="selectMesUnitPriceVo"/>
where product_code = #{productCode} and childprocess_code = #{childprocessCode}
</select>
<insert id="insertMesUnitPrice" parameterType="MesUnitPrice">
insert into mes_unit_price

@ -13,17 +13,17 @@ spring:
cloud:
nacos:
discovery:
namespace: lanju-op
group: zxl
namespace: lanju-op-test
group: test
# 服务注册地址
server-addr: 175.27.215.92:8848
server-addr: 192.168.202.20:8848
config:
namespace: lanju-op
group: zxl
namespace: lanju-op-test
group: test
#命名空间
#group: local
# 配置中心地址
server-addr: 175.27.215.92:8848
server-addr: 192.168.202.20:8848
# 配置文件格式
file-extension: yml
# 共享配置

@ -187,13 +187,7 @@ public class SapOrderServiceImpl implements SapOrderService {
JCoParameterList J= func.getExportParameterList();
System.out.println(func.getExportParameterList());
L_MSG= func.getExportParameterList().getString("L_MSG");
// String RETCODE = func.getExportParameterList().getString("RETCODE");
//String LV_ORDER_NUMBER= func.getExportParameterList().getString("LV_ORDER_NUMBER");
// if (RETCODE.equals(Constants.FAIL)){
// return R.fail(LV_ORDER_NUM_List,L_MSG);
// }
JCoTable LT_ZGD=func.getTableParameterList().getTable("LT_ZGD");
for (int i = 0; i <LT_ZGD.getNumRows(); i++) {
LT_ZGD.setRow(i);
Map map=new HashMap();
@ -203,10 +197,8 @@ public class SapOrderServiceImpl implements SapOrderService {
map.put("AUFNR",AUFNR);
LV_ORDER_NUM_List.add(map);
}
}
log.info("订单创建结果----"+L_MSG+"|"+JSONObject.toJSONString(LV_ORDER_NUM_List));
return R.ok(LV_ORDER_NUM_List,L_MSG);
}else {
log.error("接收的数据为空");

@ -13,15 +13,15 @@ spring:
cloud:
nacos:
discovery:
namespace: lanju-op
group: zxl
namespace: lanju-op-test
group: test
# 服务注册地址
server-addr: 175.27.215.92:8848
server-addr: 192.168.202.20:8848
config:
namespace: lanju-op
group: zxl
namespace: lanju-op-test
group: test
# 服务注册地址
server-addr: 175.27.215.92:8848
server-addr: 192.168.202.20:8848
# 配置文件格式
file-extension: yml
# 共享配置

@ -67,6 +67,15 @@ public class BaseProductController extends BaseController {
return success(baseProductService.selectBaseProductByProductId(productId));
}
/**
*
*/
@RequiresPermissions("wms:product:query")
@GetMapping(value = "/code/{productCode}")
public AjaxResult selectBaseProductByProductCode(@PathVariable("productCode") String productCode) {
return success(baseProductService.selectBaseProductByProductCode(productCode));
}
/**
*
*/

@ -6,14 +6,14 @@ import com.op.wms.domain.BaseProduct;
/**
* Mapper
*
*
* @author Open Platform
* @date 2023-07-18
*/
public interface BaseProductMapper {
/**
*
*
*
* @param productId
* @return
*/
@ -21,7 +21,7 @@ public interface BaseProductMapper {
/**
*
*
*
* @param baseProduct
* @return
*/
@ -29,7 +29,7 @@ public interface BaseProductMapper {
/**
*
*
*
* @param baseProduct
* @return
*/
@ -37,7 +37,7 @@ public interface BaseProductMapper {
/**
*
*
*
* @param baseProduct
* @return
*/
@ -45,7 +45,7 @@ public interface BaseProductMapper {
/**
*
*
*
* @param productId
* @return
*/
@ -53,7 +53,7 @@ public interface BaseProductMapper {
/**
*
*
*
* @param productIds
* @return
*/
@ -61,4 +61,6 @@ public interface BaseProductMapper {
String checkNameUnique(BaseProduct baseProduct);
String checkCodeUnique(BaseProduct baseProduct);
BaseProduct selectBaseProductByProductCode(String productCode);
}

@ -5,14 +5,14 @@ import com.op.wms.domain.BaseProduct;
/**
* Service
*
*
* @author Open Platform
* @date 2023-07-18
*/
public interface IBaseProductService {
/**
*
*
*
* @param productId
* @return
*/
@ -20,7 +20,7 @@ public interface IBaseProductService {
/**
*
*
*
* @param baseProduct
* @return
*/
@ -28,7 +28,7 @@ public interface IBaseProductService {
/**
*
*
*
* @param baseProduct
* @return
*/
@ -36,7 +36,7 @@ public interface IBaseProductService {
/**
*
*
*
* @param baseProduct
* @return
*/
@ -44,7 +44,7 @@ public interface IBaseProductService {
/**
*
*
*
* @param productIds
* @return
*/
@ -52,7 +52,7 @@ public interface IBaseProductService {
/**
*
*
*
* @param productId
* @return
*/
@ -60,4 +60,6 @@ public interface IBaseProductService {
boolean checkCodeUnique(BaseProduct baseProduct);
boolean checkNameUnique(BaseProduct baseProduct);
public BaseProduct selectBaseProductByProductCode(String productCode);
}

@ -14,7 +14,7 @@ import com.op.wms.service.IBaseProductService;
/**
* Service
*
*
* @author Open Platform
* @date 2023-07-18
*/
@ -25,7 +25,7 @@ public class BaseProductServiceImpl implements IBaseProductService {
/**
*
*
*
* @param productId
* @return
*/
@ -37,7 +37,7 @@ public class BaseProductServiceImpl implements IBaseProductService {
/**
*
*
*
* @param baseProduct
* @return
*/
@ -49,7 +49,7 @@ public class BaseProductServiceImpl implements IBaseProductService {
/**
*
*
*
* @param baseProduct
* @return
*/
@ -63,7 +63,7 @@ public class BaseProductServiceImpl implements IBaseProductService {
/**
*
*
*
* @param baseProduct
* @return
*/
@ -77,7 +77,7 @@ public class BaseProductServiceImpl implements IBaseProductService {
/**
*
*
*
* @param productIds
* @return
*/
@ -89,7 +89,7 @@ public class BaseProductServiceImpl implements IBaseProductService {
/**
*
*
*
* @param productId
* @return
*/
@ -130,4 +130,10 @@ public class BaseProductServiceImpl implements IBaseProductService {
return true;
}
}
@Override
@DS("#header.poolName")
public BaseProduct selectBaseProductByProductCode(String productCode) {
return baseProductMapper.selectBaseProductByProductCode(productCode);
}
}

@ -3,7 +3,7 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.op.wms.mapper.BaseProductMapper">
<resultMap type="BaseProduct" id="BaseProductResult">
<result property="productId" column="product_id" />
<result property="productCode" column="product_code" />
@ -72,7 +72,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectBaseProductList" parameterType="BaseProduct" resultMap="BaseProductResult">
<include refid="selectBaseProductVo"/>
<where>
<where>
<if test="productCode != null and productCode != ''"> and product_code like concat('%', #{productCode}, '%')</if>
<if test="productDescZh != null and productDescZh != ''"> and product_desc_zh like concat('%', #{productDescZh}, '%')</if>
<if test="productModel != null and productModel != ''"> and product_model = #{productModel}</if>
@ -113,7 +113,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and del_flag = '0'
</where>
</select>
<select id="selectBaseProductByProductId" parameterType="String" resultMap="BaseProductResult">
select
bp.product_id,
@ -180,7 +180,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where product_id = #{productId}
and del_flag = '0'
</select>
<insert id="insertBaseProduct" parameterType="BaseProduct">
insert into base_product
<trim prefix="(" suffix=")" suffixOverrides=",">
@ -351,5 +353,71 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where product_code = #{productCode}
and del_flag ='0'
</select>
<select id="selectBaseProductByProductCode" parameterType="String" resultMap="BaseProductResult">
select
bp.product_id,
bp.product_code,
bp.product_desc_zh,
bp.product_model,
bp.product_desc_en,
bp.rule_code,
bp.old_product_code,
bp.parts_product_code,
bp.sku_barcode,
bp.length,
bp.width,
bp.height,
bp.gross_weight,
bp.net_weight,
bp.tare_weight,
bp.volume,
bp.unit_price,
bp.product_group,
bp.product_group_name,
bp.user_defined1,
bp.user_defined2,
bp.user_defined3,
bp.user_defined4,
bp.user_defined5,
bp.user_defined6,
bp.create_by,
bp.create_time,
bp.update_by,
bp.update_time,
bp.factory_code,
bp.active_flag,
bp.sync_flag,
bp.primary_uom,
bp.del_flag,
bp.bstme,
bp.basic_order,
bp.conv_order,
bp.ausme,
bp.basic_issue,
bp.conv_issue,
bp.append_flag,
bp.append_percent,
bp.mtart,
bpa.category,
bpa.pc,
bpa.iei,
bpa.man_standar,
bpa.spray_way,
bpa.blank_diameter,
bpa.blank_no,
bpa.spray_volume,
bpa.liquid_no,
bpa.endometrial_dosage,
bpa.outer_film_dosage,
bpa.support,
bpa.support_no,
bpa.pvc,
bpa.support_plate,
bpa.other
from base_product bp
left join base_product_attached bpa on bpa.product_code = right(bp.product_code,11)
where bp.product_code like concat('%', #{productCode}, '%')
and del_flag = '0'
</select>
</mapper>
</mapper>

Loading…
Cancel
Save