sunxianglong 4 месяцев назад
Родитель
Сommit
dae995f366

+ 15 - 0
src/main/java/com/jeesite/modules/mes/dao/MesMaterialRkDao.java

@@ -0,0 +1,15 @@
+package com.jeesite.modules.mes.dao;
+
+import com.jeesite.common.dao.CrudDao;
+import com.jeesite.common.mybatis.annotation.MyBatisDao;
+import com.jeesite.modules.mes.entity.MesMaterialRk;
+
+/**
+ * 采购入库单DAO接口
+ * @author sxl
+ * @version 2026-06-24
+ */
+@MyBatisDao
+public interface MesMaterialRkDao extends CrudDao<MesMaterialRk> {
+	
+}

+ 46 - 13
src/main/java/com/jeesite/modules/mes/entity/MesMaterial.java

@@ -19,6 +19,9 @@ import com.jeesite.common.utils.excel.annotation.ExcelFields;
 		@Column(name="title", attrName="title", label="部件名称", queryType=QueryType.LIKE),
 		@Column(name="spec", attrName="spec", label="部件规格"),
 		@Column(name="erp_sn", attrName="erpSn", label="ERP编码"),
+		@Column(name="unit", attrName="unit", label="单位"),
+		@Column(name="house", attrName="house", label="仓库"),
+		@Column(name="location", attrName="location", label="库位"),
 		@Column(name="img_sn", attrName="imgSn", label="内部图号"),
 		@Column(name="nums", attrName="nums", label="数量/套", isQuery=false, isUpdateForce=true),
 		@Column(name="attr", attrName="attr", label="加工属性"),
@@ -34,11 +37,14 @@ import com.jeesite.common.utils.excel.annotation.ExcelFields;
 	}, orderBy="a.update_date DESC"
 )
 public class MesMaterial extends DataEntity<MesMaterial> {
-	
+
 	private static final long serialVersionUID = 1L;
 	private String title;		// 部件名称
 	private String spec;		// 部件规格
 	private String erpSn;		// ERP编码
+	private String unit;  //单位
+	private String house;  //仓库
+	private String location;  //库位
 	private String imgSn;		// 内部图号
 	private Integer nums;		// 数量/套
 	private String num;
@@ -53,6 +59,9 @@ public class MesMaterial extends DataEntity<MesMaterial> {
 			@ExcelField(title="部件名称", attrName="title", align= ExcelField.Align.CENTER, sort=30),
 			@ExcelField(title="部件规格", attrName="spec", align= ExcelField.Align.CENTER, sort=30),
 			@ExcelField(title="ERP编码", attrName="erpSn", align= ExcelField.Align.CENTER, sort=30),
+			@ExcelField(title="单位", attrName="unit", align= ExcelField.Align.CENTER, sort=30),
+			@ExcelField(title="仓库", attrName="house", align= ExcelField.Align.CENTER, sort=30),
+			@ExcelField(title="库位", attrName="location", align= ExcelField.Align.CENTER, sort=30),
 			@ExcelField(title="内部图号", attrName="imgSn", align= ExcelField.Align.CENTER, sort=30),
 			@ExcelField(title="数量/套", attrName="nums", align= ExcelField.Align.CENTER, sort=30),
 			@ExcelField(title="加工属性", attrName="attr", align= ExcelField.Align.CENTER, sort=30),
@@ -67,11 +76,11 @@ public class MesMaterial extends DataEntity<MesMaterial> {
 	public MesMaterial() {
 		this(null);
 	}
-	
+
 	public MesMaterial(String id){
 		super(id);
 	}
-	
+
 	@Size(min=0, max=255, message="部件名称长度不能超过 255 个字符")
 	public String getTitle() {
 		return title;
@@ -80,7 +89,7 @@ public class MesMaterial extends DataEntity<MesMaterial> {
 	public void setTitle(String title) {
 		this.title = title;
 	}
-	
+
 	@Size(min=0, max=255, message="部件规格长度不能超过 255 个字符")
 	public String getSpec() {
 		return spec;
@@ -89,7 +98,7 @@ public class MesMaterial extends DataEntity<MesMaterial> {
 	public void setSpec(String spec) {
 		this.spec = spec;
 	}
-	
+
 	@Size(min=0, max=64, message="ERP编码长度不能超过 64 个字符")
 	public String getErpSn() {
 		return erpSn;
@@ -98,7 +107,31 @@ public class MesMaterial extends DataEntity<MesMaterial> {
 	public void setErpSn(String erpSn) {
 		this.erpSn = erpSn;
 	}
-	
+
+	public String getUnit() {
+		return unit;
+	}
+
+	public void setUnit(String unit) {
+		this.unit = unit;
+	}
+
+	public String getHouse() {
+		return house;
+	}
+
+	public void setHouse(String house) {
+		this.house = house;
+	}
+
+	public String getLocation() {
+		return location;
+	}
+
+	public void setLocation(String location) {
+		this.location = location;
+	}
+
 	@Size(min=0, max=255, message="内部图号长度不能超过 255 个字符")
 	public String getImgSn() {
 		return imgSn;
@@ -107,7 +140,7 @@ public class MesMaterial extends DataEntity<MesMaterial> {
 	public void setImgSn(String imgSn) {
 		this.imgSn = imgSn;
 	}
-	
+
 	public Integer getNums() {
 		return nums;
 	}
@@ -115,7 +148,7 @@ public class MesMaterial extends DataEntity<MesMaterial> {
 	public void setNums(Integer nums) {
 		this.nums = nums;
 	}
-	
+
 	@Size(min=0, max=255, message="加工属性长度不能超过 255 个字符")
 	public String getAttr() {
 		return attr;
@@ -124,7 +157,7 @@ public class MesMaterial extends DataEntity<MesMaterial> {
 	public void setAttr(String attr) {
 		this.attr = attr;
 	}
-	
+
 	@Size(min=0, max=255, message="供应商长度不能超过 255 个字符")
 	public String getSupplier() {
 		return supplier;
@@ -133,7 +166,7 @@ public class MesMaterial extends DataEntity<MesMaterial> {
 	public void setSupplier(String supplier) {
 		this.supplier = supplier;
 	}
-	
+
 	public Integer getAging() {
 		return aging;
 	}
@@ -141,7 +174,7 @@ public class MesMaterial extends DataEntity<MesMaterial> {
 	public void setAging(Integer aging) {
 		this.aging = aging;
 	}
-	
+
 	@Size(min=0, max=1, message="追溯类型长度不能超过 1 个字符")
 	public String getType() {
 		return type;
@@ -150,7 +183,7 @@ public class MesMaterial extends DataEntity<MesMaterial> {
 	public void setType(String type) {
 		this.type = type;
 	}
-	
+
 	@Size(min=0, max=255, message="备注长度不能超过 255 个字符")
 	public String getRemark() {
 		return remark;
@@ -167,4 +200,4 @@ public class MesMaterial extends DataEntity<MesMaterial> {
 	public void setNum(String num) {
 		this.num = num;
 	}
-}
+}

+ 165 - 0
src/main/java/com/jeesite/modules/mes/entity/MesMaterialRk.java

@@ -0,0 +1,165 @@
+package com.jeesite.modules.mes.entity;
+
+import javax.validation.constraints.Size;
+import javax.validation.constraints.NotBlank;
+import java.util.Date;
+import com.jeesite.common.mybatis.annotation.JoinTable;
+import com.jeesite.common.mybatis.annotation.JoinTable.Type;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import javax.validation.constraints.NotNull;
+
+import com.jeesite.common.entity.DataEntity;
+import com.jeesite.common.mybatis.annotation.Column;
+import com.jeesite.common.mybatis.annotation.Table;
+import com.jeesite.common.mybatis.mapper.query.QueryType;
+
+/**
+ * 采购入库单Entity
+ * @author sxl
+ * @version 2026-06-24
+ */
+@Table(name="mes_material_rk", alias="a", label="采购入库单信息", columns={
+		@Column(name="id", attrName="id", label="id", isPK=true),
+		@Column(name="other_id", attrName="otherId", label="第三方数据标识"),
+		@Column(name="doc_type_code", attrName="docTypeCode", label="单据类型编码"),
+		@Column(name="businese_date", attrName="busineseDate", label="单据日期"),
+		@Column(name="confirm_date", attrName="confirmDate", label="入库确认时间"),
+		@Column(name="doc_line_no", attrName="docLineNo", label="行号"),
+		@Column(name="src_doc_no", attrName="srcDocNo", label="采购订单号"),
+		@Column(name="src_doc_line_no", attrName="srcDocLineNo", label="采购订单行号"),
+		@Column(name="lot_code", attrName="lotCode", label="批号"),
+		@Column(name="qty", attrName="qty", label="合格数量", isUpdateForce=true),
+		@Column(name="rtn_deduct_qty", attrName="rtnDeductQty", label="退补数量", isUpdateForce=true),
+		@Column(name="rtn_fill_qty", attrName="rtnFillQty", label="退扣数量", isUpdateForce=true),
+		@Column(name="status", attrName="status", label="状态", isUpdate=false),
+		@Column(name="create_date", attrName="createDate", label="创建时间", isUpdate=false, isQuery=false, isUpdateForce=true),
+		@Column(name="create_by", attrName="createBy", label="create_by", isUpdate=false, isQuery=false),
+		@Column(name="update_by", attrName="updateBy", label="update_by", isQuery=false),
+		@Column(name="update_date", attrName="updateDate", label="更新时间", isQuery=false, isUpdateForce=true),
+	}, orderBy="a.update_date DESC"
+)
+public class MesMaterialRk extends DataEntity<MesMaterialRk> {
+	
+	private static final long serialVersionUID = 1L;
+	private String otherId;		// 第三方数据标识
+	private String docTypeCode;		// 单据类型编码
+	private Date busineseDate;		// 单据日期
+	private Date confirmDate;		// 入库确认时间
+	private Long docLineNo;		// 行号
+	private String srcDocNo;		// 采购订单号
+	private Long srcDocLineNo;		// 采购订单行号
+	private String lotCode;		// 批号
+	private Long qty;		// 合格数量
+	private Long rtnDeductQty;		// 退补数量
+	private Long rtnFillQty;		// 退扣数量
+
+	public MesMaterialRk() {
+		this(null);
+	}
+	
+	public MesMaterialRk(String id){
+		super(id);
+	}
+	
+	@Size(min=0, max=64, message="第三方数据标识长度不能超过 64 个字符")
+	public String getOtherId() {
+		return otherId;
+	}
+
+	public void setOtherId(String otherId) {
+		this.otherId = otherId;
+	}
+	
+	@NotBlank(message="单据类型编码不能为空")
+	@Size(min=0, max=255, message="单据类型编码长度不能超过 255 个字符")
+	public String getDocTypeCode() {
+		return docTypeCode;
+	}
+
+	public void setDocTypeCode(String docTypeCode) {
+		this.docTypeCode = docTypeCode;
+	}
+	
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+	@NotNull(message="单据日期不能为空")
+	public Date getBusineseDate() {
+		return busineseDate;
+	}
+
+	public void setBusineseDate(Date busineseDate) {
+		this.busineseDate = busineseDate;
+	}
+	
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+	@NotNull(message="入库确认时间不能为空")
+	public Date getConfirmDate() {
+		return confirmDate;
+	}
+
+	public void setConfirmDate(Date confirmDate) {
+		this.confirmDate = confirmDate;
+	}
+	
+	@NotNull(message="行号不能为空")
+	public Long getDocLineNo() {
+		return docLineNo;
+	}
+
+	public void setDocLineNo(Long docLineNo) {
+		this.docLineNo = docLineNo;
+	}
+	
+	@NotBlank(message="采购订单号不能为空")
+	@Size(min=0, max=255, message="采购订单号长度不能超过 255 个字符")
+	public String getSrcDocNo() {
+		return srcDocNo;
+	}
+
+	public void setSrcDocNo(String srcDocNo) {
+		this.srcDocNo = srcDocNo;
+	}
+	
+	@NotNull(message="采购订单行号不能为空")
+	public Long getSrcDocLineNo() {
+		return srcDocLineNo;
+	}
+
+	public void setSrcDocLineNo(Long srcDocLineNo) {
+		this.srcDocLineNo = srcDocLineNo;
+	}
+	
+	@NotBlank(message="批号不能为空")
+	@Size(min=0, max=255, message="批号长度不能超过 255 个字符")
+	public String getLotCode() {
+		return lotCode;
+	}
+
+	public void setLotCode(String lotCode) {
+		this.lotCode = lotCode;
+	}
+	
+	public Long getQty() {
+		return qty;
+	}
+
+	public void setQty(Long qty) {
+		this.qty = qty;
+	}
+	
+	public Long getRtnDeductQty() {
+		return rtnDeductQty;
+	}
+
+	public void setRtnDeductQty(Long rtnDeductQty) {
+		this.rtnDeductQty = rtnDeductQty;
+	}
+	
+	public Long getRtnFillQty() {
+		return rtnFillQty;
+	}
+
+	public void setRtnFillQty(Long rtnFillQty) {
+		this.rtnFillQty = rtnFillQty;
+	}
+	
+}

+ 84 - 0
src/main/java/com/jeesite/modules/mes/service/MesMaterialRkService.java

@@ -0,0 +1,84 @@
+package com.jeesite.modules.mes.service;
+
+import java.util.List;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import com.jeesite.common.entity.Page;
+import com.jeesite.common.service.CrudService;
+import com.jeesite.modules.mes.entity.MesMaterialRk;
+import com.jeesite.modules.mes.dao.MesMaterialRkDao;
+import com.jeesite.modules.file.utils.FileUploadUtils;
+
+/**
+ * 采购入库单Service
+ * @author sxl
+ * @version 2026-06-24
+ */
+@Service
+public class MesMaterialRkService extends CrudService<MesMaterialRkDao, MesMaterialRk> {
+	
+	/**
+	 * 获取单条数据
+	 * @param mesMaterialRk
+	 * @return
+	 */
+	@Override
+	public MesMaterialRk get(MesMaterialRk mesMaterialRk) {
+		return super.get(mesMaterialRk);
+	}
+	
+	/**
+	 * 查询分页数据
+	 * @param mesMaterialRk 查询条件
+	 * @param mesMaterialRk.page 分页对象
+	 * @return
+	 */
+	@Override
+	public Page<MesMaterialRk> findPage(MesMaterialRk mesMaterialRk) {
+		return super.findPage(mesMaterialRk);
+	}
+	
+	/**
+	 * 查询列表数据
+	 * @param mesMaterialRk
+	 * @return
+	 */
+	@Override
+	public List<MesMaterialRk> findList(MesMaterialRk mesMaterialRk) {
+		return super.findList(mesMaterialRk);
+	}
+	
+	/**
+	 * 保存数据(插入或更新)
+	 * @param mesMaterialRk
+	 */
+	@Override
+	@Transactional
+	public void save(MesMaterialRk mesMaterialRk) {
+		super.save(mesMaterialRk);
+		// 保存上传图片
+		FileUploadUtils.saveFileUpload(mesMaterialRk, mesMaterialRk.getId(), "mesMaterialRk_image");
+	}
+	
+	/**
+	 * 更新状态
+	 * @param mesMaterialRk
+	 */
+	@Override
+	@Transactional
+	public void updateStatus(MesMaterialRk mesMaterialRk) {
+		super.updateStatus(mesMaterialRk);
+	}
+	
+	/**
+	 * 删除数据
+	 * @param mesMaterialRk
+	 */
+	@Override
+	@Transactional
+	public void delete(MesMaterialRk mesMaterialRk) {
+		super.delete(mesMaterialRk);
+	}
+	
+}

+ 6 - 6
src/main/java/com/jeesite/modules/mes/service/MesMaterialService.java

@@ -48,7 +48,7 @@ public class MesMaterialService extends CrudService<MesMaterialDao, MesMaterial>
 	public Page<MesMaterial> findPage(MesMaterial mesMaterial) {
 		return super.findPage(mesMaterial);
 	}
-	
+
 	/**
 	 * 查询列表数据
 	 * @param mesMaterial
@@ -58,7 +58,7 @@ public class MesMaterialService extends CrudService<MesMaterialDao, MesMaterial>
 	public List<MesMaterial> findList(MesMaterial mesMaterial) {
 		return super.findList(mesMaterial);
 	}
-	
+
 	/**
 	 * 保存数据(插入或更新)
 	 * @param mesMaterial
@@ -70,7 +70,7 @@ public class MesMaterialService extends CrudService<MesMaterialDao, MesMaterial>
 		// 保存上传图片
 		FileUploadUtils.saveFileUpload(mesMaterial, mesMaterial.getId(), "mesMaterial_image");
 	}
-	
+
 	/**
 	 * 更新状态
 	 * @param mesMaterial
@@ -80,7 +80,7 @@ public class MesMaterialService extends CrudService<MesMaterialDao, MesMaterial>
 	public void updateStatus(MesMaterial mesMaterial) {
 		super.updateStatus(mesMaterial);
 	}
-	
+
 	/**
 	 * 删除数据
 	 * @param mesMaterial
@@ -90,5 +90,5 @@ public class MesMaterialService extends CrudService<MesMaterialDao, MesMaterial>
 	public void delete(MesMaterial mesMaterial) {
 		super.delete(mesMaterial);
 	}
-	
-}
+
+}

+ 165 - 0
src/main/java/com/jeesite/modules/mes/util/U9cAuthUtil.java

@@ -0,0 +1,165 @@
+package com.jeesite.modules.mes.util;
+
+import com.alibaba.fastjson.JSONObject;
+import com.jeesite.common.lang.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.BufferedReader;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.nio.charset.StandardCharsets;
+
+/**
+ * U9C OAuth2 登录工具类
+ */
+public class U9cAuthUtil {
+
+	private static final Logger log = LoggerFactory.getLogger(U9cAuthUtil.class);
+
+	private static final String AUTH_URL = "http://10.0.10.11/u9c/webapi/OAuth2/AuthLogin"
+			+ "?clientid=mes"
+			+ "&clientsecret=4cb93d6876d0484a9e4d3549b80cf5a1"
+			+ "&entCode=100"
+			+ "&userCode=yonyou"
+			+ "&orgCode=100";
+
+	private static final String CREATE_RCV_URL = "http://10.0.10.11/u9c/webapi/CustLJRMESOpenAPI/CreateRCV";
+
+	private U9cAuthUtil() {
+	}
+
+	/**
+	 * 调用 U9C OAuth2 登录接口,获取 token
+	 *
+	 * @return 登录成功返回 token,失败返回 null
+	 */
+	public static String getToken() {
+		JSONObject response = authLogin();
+		if (response == null) {
+			return null;
+		}
+		Boolean success = response.getBoolean("Success");
+		if (success != null && success) {
+			return response.getString("Data");
+		}
+		log.warn("U9C 登录失败: {}", response.getString("ResMsg"));
+		return null;
+	}
+
+	/**
+	 * 调用 CreateRCV 接口,自动获取 token 并写入请求头
+	 *
+	 * @param requestBody JSON 请求体
+	 * @return 接口响应,失败返回 null
+	 */
+	public static JSONObject createRCV(String requestBody) {
+		String token = getToken();
+		if (StringUtils.isEmpty(token)) {
+			log.warn("CreateRCV 请求失败: 无法获取 token");
+			return null;
+		}
+		return postWithToken(CREATE_RCV_URL, requestBody, token);
+	}
+
+	/**
+	 * 调用 CreateRCV 接口,自动获取 token 并写入请求头
+	 *
+	 * @param requestBody JSON 请求体
+	 * @return 接口响应,失败返回 null
+	 */
+	public static JSONObject createRCV(JSONObject requestBody) {
+		return createRCV(requestBody == null ? "{}" : requestBody.toJSONString());
+	}
+
+	/**
+	 * 调用 U9C OAuth2 登录接口,返回完整响应
+	 */
+	public static JSONObject authLogin() {
+		HttpURLConnection connection = null;
+		try {
+			URL url = new URL(AUTH_URL);
+			connection = (HttpURLConnection) url.openConnection();
+			connection.setRequestMethod("GET");
+			connection.setConnectTimeout(10000);
+			connection.setReadTimeout(10000);
+			connection.setDoInput(true);
+			connection.setUseCaches(false);
+
+			int responseCode = connection.getResponseCode();
+			if (responseCode != HttpURLConnection.HTTP_OK) {
+				log.warn("U9C 登录请求失败, HTTP状态码: {}", responseCode);
+				return null;
+			}
+
+			String body = readResponse(connection.getInputStream());
+			return JSONObject.parseObject(body);
+		} catch (Exception e) {
+			log.error("U9C 登录请求异常", e);
+			return null;
+		} finally {
+			if (connection != null) {
+				connection.disconnect();
+			}
+		}
+	}
+
+	private static JSONObject postWithToken(String url, String requestBody, String token) {
+		HttpURLConnection connection = null;
+		try {
+			connection = (HttpURLConnection) new URL(url).openConnection();
+			connection.setRequestMethod("POST");
+			connection.setConnectTimeout(10000);
+			connection.setReadTimeout(30000);
+			connection.setDoInput(true);
+			connection.setDoOutput(true);
+			connection.setUseCaches(false);
+			connection.setRequestProperty("Content-Type", "application/json;charset=UTF-8");
+			connection.setRequestProperty("token", token);
+
+			byte[] bodyBytes = StringUtils.defaultString(requestBody).getBytes(StandardCharsets.UTF_8);
+			try (OutputStream outputStream = connection.getOutputStream()) {
+				outputStream.write(bodyBytes);
+				outputStream.flush();
+			}
+
+			int responseCode = connection.getResponseCode();
+			InputStream inputStream = responseCode == HttpURLConnection.HTTP_OK
+					? connection.getInputStream()
+					: connection.getErrorStream();
+			if (inputStream == null) {
+				log.warn("CreateRCV 请求失败, HTTP状态码: {}", responseCode);
+				return null;
+			}
+
+			String body = readResponse(inputStream);
+			if (responseCode != HttpURLConnection.HTTP_OK) {
+				log.warn("CreateRCV 请求失败, HTTP状态码: {}, 响应: {}", responseCode, body);
+				return null;
+			}
+			return JSONObject.parseObject(body);
+		} catch (Exception e) {
+			log.error("CreateRCV 请求异常", e);
+			return null;
+		} finally {
+			if (connection != null) {
+				connection.disconnect();
+			}
+		}
+	}
+
+	private static String readResponse(InputStream inputStream) throws Exception {
+		StringBuilder result = new StringBuilder();
+		try (BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream, StandardCharsets.UTF_8))) {
+			String line;
+			while ((line = reader.readLine()) != null) {
+				result.append(line);
+			}
+		}
+		return result.toString();
+	}
+
+}

+ 36 - 7
src/main/java/com/jeesite/modules/mes/web/MesMaterialController.java

@@ -20,6 +20,7 @@ import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.ResponseBody;
 
+import com.jeesite.common.lang.StringUtils;
 import com.jeesite.common.config.Global;
 import com.jeesite.common.entity.Page;
 import com.jeesite.common.web.BaseController;
@@ -37,7 +38,7 @@ public class MesMaterialController extends BaseController {
 
 	@Autowired
 	private MesMaterialService mesMaterialService;
-	
+
 	/**
 	 * 获取数据
 	 */
@@ -45,7 +46,7 @@ public class MesMaterialController extends BaseController {
 	public MesMaterial get(String id, boolean isNewRecord) {
 		return mesMaterialService.get(id, isNewRecord);
 	}
-	
+
 	/**
 	 * 查询列表
 	 */
@@ -55,7 +56,7 @@ public class MesMaterialController extends BaseController {
 		model.addAttribute("mesMaterial", mesMaterial);
 		return "modules/mes/mesMaterialList";
 	}
-	
+
 	/**
 	 * 查询列表数据
 	 */
@@ -88,7 +89,35 @@ public class MesMaterialController extends BaseController {
 		mesMaterialService.save(mesMaterial);
 		return renderResult(Global.TRUE, text("保存物料表成功!"));
 	}
-	
+
+	/**
+	 * erpTomes
+	 */
+	@PostMapping(value = "saveMaterial")
+	@ResponseBody
+	public String saveMaterial(@Validated MesMaterial mesMaterial) {
+		if (StringUtils.isBlank(mesMaterial.getTitle())) {
+			return renderResult(Global.FALSE, text("部件名称不能为空!"));
+		}
+		if (StringUtils.isBlank(mesMaterial.getSpec())) {
+			return renderResult(Global.FALSE, text("部件规格不能为空!"));
+		}
+		if (StringUtils.isBlank(mesMaterial.getErpSn())) {
+			return renderResult(Global.FALSE, text("ERP编码不能为空!"));
+		}
+		if (StringUtils.isBlank(mesMaterial.getUnit())) {
+			return renderResult(Global.FALSE, text("单位不能为空!"));
+		}
+		if (StringUtils.isBlank(mesMaterial.getHouse())) {
+			return renderResult(Global.FALSE, text("仓库不能为空!"));
+		}
+		if (StringUtils.isBlank(mesMaterial.getLocation())) {
+			return renderResult(Global.FALSE, text("库位不能为空!"));
+		}
+		mesMaterialService.save(mesMaterial);
+		return renderResult(Global.TRUE, text("保存物料表成功!"));
+	}
+
 	/**
 	 * 停用数据
 	 */
@@ -100,7 +129,7 @@ public class MesMaterialController extends BaseController {
 		mesMaterialService.updateStatus(mesMaterial);
 		return renderResult(Global.TRUE, text("停用物料表成功"));
 	}
-	
+
 	/**
 	 * 启用数据
 	 */
@@ -112,7 +141,7 @@ public class MesMaterialController extends BaseController {
 		mesMaterialService.updateStatus(mesMaterial);
 		return renderResult(Global.TRUE, text("启用物料表成功"));
 	}
-	
+
 	/**
 	 * 删除数据
 	 */
@@ -147,4 +176,4 @@ public class MesMaterialController extends BaseController {
 		model.addAttribute("warehouse", mesMaterial);
 		return "modules/mes/mesMaterialSelect";
 	}
-}
+}

+ 308 - 0
src/main/java/com/jeesite/modules/mes/web/MesMaterialRkController.java

@@ -0,0 +1,308 @@
+package com.jeesite.modules.mes.web;
+
+import java.text.ParseException;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.jeesite.common.lang.DateUtils;
+import com.jeesite.common.lang.StringUtils;
+import com.jeesite.modules.mes.entity.MesMaterial;
+import com.jeesite.modules.mes.resp.CommonResp;
+import com.jeesite.modules.mes.service.MesMaterialService;
+import com.jeesite.modules.mes.util.U9cAuthUtil;
+import com.jeesite.modules.utils.DateLocalUtils;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import com.jeesite.common.config.Global;
+import com.jeesite.common.entity.Page;
+import com.jeesite.common.web.BaseController;
+import com.jeesite.modules.mes.entity.MesMaterialRk;
+import com.jeesite.modules.mes.service.MesMaterialRkService;
+
+/**
+ * 采购入库单Controller
+ * @author sxl
+ * @version 2026-06-23
+ */
+@Controller
+@RequestMapping(value = "${adminPath}/mes/mesMaterialRk")
+public class MesMaterialRkController extends BaseController {
+
+	@Autowired
+	private MesMaterialRkService mesMaterialRkService;
+
+	@Autowired
+	private MesMaterialService mesMaterialService;
+
+	/**
+	 * 获取数据
+	 */
+	@ModelAttribute
+	public MesMaterialRk get(String id, boolean isNewRecord) {
+		return mesMaterialRkService.get(id, isNewRecord);
+	}
+
+	/**
+	 * 查询列表
+	 */
+	@RequiresPermissions("mes:mesMaterialRk:view")
+	@RequestMapping(value = {"list", ""})
+	public String list(MesMaterialRk mesMaterialRk, Model model) {
+		model.addAttribute("mesMaterialRk", mesMaterialRk);
+		return "modules/mes/mesMaterialRkList";
+	}
+
+	/**
+	 * 查询列表数据
+	 */
+	@RequiresPermissions("mes:mesMaterialRk:view")
+	@RequestMapping(value = "listData")
+	@ResponseBody
+	public Page<MesMaterialRk> listData(MesMaterialRk mesMaterialRk, HttpServletRequest request, HttpServletResponse response) {
+		mesMaterialRk.setPage(new Page<>(request, response));
+		Page<MesMaterialRk> page = mesMaterialRkService.findPage(mesMaterialRk);
+		return page;
+	}
+
+	/**
+	 * 查看编辑表单
+	 */
+	@RequiresPermissions("mes:mesMaterialRk:view")
+	@RequestMapping(value = "form")
+	public String form(MesMaterialRk mesMaterialRk, Model model) {
+		model.addAttribute("mesMaterialRk", mesMaterialRk);
+		return "modules/mes/mesMaterialRkForm";
+	}
+
+	/**
+	 * 保存数据
+	 */
+	@RequiresPermissions("mes:mesMaterialRk:edit")
+	@PostMapping(value = "save")
+	@ResponseBody
+	public String save(@Validated MesMaterialRk mesMaterialRk) {
+		mesMaterialRkService.save(mesMaterialRk);
+		return renderResult(Global.TRUE, text("保存采购入库单成功!"));
+	}
+
+	/**
+	 * 停用数据
+	 */
+	@RequiresPermissions("mes:mesMaterialRk:edit")
+	@RequestMapping(value = "disable")
+	@ResponseBody
+	public String disable(MesMaterialRk mesMaterialRk) {
+		mesMaterialRk.setStatus(MesMaterialRk.STATUS_DISABLE);
+		mesMaterialRkService.updateStatus(mesMaterialRk);
+		return renderResult(Global.TRUE, text("停用采购入库单成功"));
+	}
+
+	/**
+	 * 启用数据
+	 */
+	@RequiresPermissions("mes:mesMaterialRk:edit")
+	@RequestMapping(value = "enable")
+	@ResponseBody
+	public String enable(MesMaterialRk mesMaterialRk) {
+		mesMaterialRk.setStatus(MesMaterialRk.STATUS_NORMAL);
+		mesMaterialRkService.updateStatus(mesMaterialRk);
+		return renderResult(Global.TRUE, text("启用采购入库单成功"));
+	}
+
+	/**
+	 * 删除数据
+	 */
+	@RequiresPermissions("mes:mesMaterialRk:edit")
+	@RequestMapping(value = "delete")
+	@ResponseBody
+	public String delete(MesMaterialRk mesMaterialRk) {
+		mesMaterialRkService.delete(mesMaterialRk);
+		return renderResult(Global.TRUE, text("删除采购入库单成功!"));
+	}
+
+	/**
+	 * 解析来料编码
+	 * 格式:ERP代码,采购订单号,采购订单行号,料号,生产日期,生产批次,批次数量
+	 * 样例:S-00015,LJR-PO2606030001,10,D3503-000001,20260608,26060001,1000
+	 */
+//	@RequiresPermissions("mes:mesMaterialRk:api")
+	@RequestMapping(value = "jxCode")
+	@ResponseBody
+	public CommonResp jxCode(HttpServletRequest req) {
+		String materialCode = req.getParameter("materialCode");
+		CommonResp<Map<String, Object>> resp = new CommonResp<>();
+
+		if (StringUtils.isBlank(materialCode)) {
+			resp.setResult(Global.FALSE);
+			resp.setMessage("来料码不能为空!");
+			return resp;
+		}
+
+		String[] parts = materialCode.split(",", -1);
+		if (parts.length != 7) {
+			resp.setResult(Global.FALSE);
+			resp.setMessage("二维码规则不正确!");
+			return resp;
+		}
+
+		String docTypeCode = parts[0].trim();
+		String srcDocNo = parts[1].trim();
+		String srcDocLineNoStr = parts[2].trim();
+		String erpSn = parts[3].trim();
+		String produceDateStr = parts[4].trim();
+		String lotCode = parts[5].trim();
+		String qtyStr = parts[6].trim();
+
+		if (StringUtils.isBlank(docTypeCode) || StringUtils.isBlank(srcDocNo) || StringUtils.isBlank(srcDocLineNoStr)
+				|| StringUtils.isBlank(erpSn) || StringUtils.isBlank(produceDateStr) || StringUtils.isBlank(lotCode)
+				|| StringUtils.isBlank(qtyStr)) {
+			resp.setResult(Global.FALSE);
+			resp.setMessage("二维码规则不正确!");
+			return resp;
+		}
+
+		Long srcDocLineNo;
+		Long pcQty;
+		try {
+			srcDocLineNo = Long.valueOf(srcDocLineNoStr);
+			pcQty = Long.valueOf(qtyStr);
+		} catch (NumberFormatException e) {
+			resp.setResult(Global.FALSE);
+			resp.setMessage("二维码规则不正确!");
+			return resp;
+		}
+
+		String produceDate;
+		try {
+			produceDate = DateLocalUtils.getCurrentDate2(produceDateStr);
+		} catch (ParseException e) {
+			resp.setResult(Global.FALSE);
+			resp.setMessage("二维码规则不正确!");
+			return resp;
+		}
+
+//		MesMaterial mesMaterial = new MesMaterial();
+//		mesMaterial.setErpSn(erpSn);
+//		MesMaterial material = mesMaterialService.findInfo(mesMaterial);
+//		if (material == null) {
+//			resp.setResult(Global.FALSE);
+//			resp.setMessage("物料不存在!");
+//			return resp;
+//		}
+
+		HashMap<String, Object> data = new HashMap<>();
+//		data.put("materialCode", materialCode);       // 来料码
+//		data.put("docTypeCode", docTypeCode);         // ERP代码/单据类型编码
+		data.put("srcDocNo", srcDocNo);               // 采购订单号
+		data.put("srcDocLineNo", srcDocLineNo);       // 采购订单行号
+		data.put("docLineNo", srcDocLineNo);          // 行号
+//		data.put("erpSn", erpSn);                     // 料号/ERP编码
+		data.put("produceDate", produceDate);         // 生产日期
+		data.put("lotCode", lotCode);                 // 生产批次/批号
+		data.put("pcQty", pcQty);                         // 批次数量
+
+		resp.setData(data);
+		resp.setResult(Global.TRUE);
+		resp.setMessage("解析成功");
+		return resp;
+	}
+
+	/**
+	 * 同步数据到 ERP
+	 */
+//	@RequiresPermissions("mes:mesMaterialRk:api")
+	@RequestMapping(value = "mesToErp")
+	@ResponseBody
+	public String mesToErp(MesMaterialRk mesMaterialRk) {
+		if (StringUtils.isNotBlank(mesMaterialRk.getId())) {
+			mesMaterialRk = mesMaterialRkService.get(mesMaterialRk);
+		}
+		if (mesMaterialRk == null) {
+			return renderResult(Global.FALSE, text("采购入库单不存在!"));
+		}
+
+		String requestJson = buildCreateRcvJson(mesMaterialRk);
+		JSONObject response = U9cAuthUtil.createRCV(requestJson);
+		if (response == null) {
+			return renderResult(Global.FALSE, text("同步ERP失败!"));
+		}
+		if (!Boolean.TRUE.equals(response.getBoolean("Success"))) {
+			String msg = response.getString("ResMsg");
+			return renderResult(Global.FALSE, text(StringUtils.isNotBlank(msg) ? msg : "同步ERP失败!"));
+		}
+
+		JSONArray dataList = response.getJSONArray("Data");
+		if (dataList == null || dataList.isEmpty()) {
+			return renderResult(Global.FALSE, text("同步ERP失败:返回数据为空!"));
+		}
+		JSONObject data = dataList.getJSONObject(0);
+		if (data == null || !Boolean.TRUE.equals(data.getBoolean("IsSucceed"))) {
+			String errorMsg = data != null ? data.getString("ErrorMsg") : null;
+			return renderResult(Global.FALSE, text(StringUtils.isNotBlank(errorMsg) ? errorMsg : "同步ERP失败!"));
+		}
+
+		String code = data.getString("Code");
+		String docId = data.getString("ID");
+		StringBuilder successMsg = new StringBuilder(text("同步ERP成功!"));
+		if (StringUtils.isNotBlank(code)) {
+			successMsg.append(" ").append(code);
+		}
+		if (StringUtils.isNotBlank(docId)) {
+			successMsg.append(" (").append(docId).append(")");
+		}
+		return renderResult(Global.TRUE, successMsg.toString());
+	}
+
+	/**
+	 * 构造 CreateRCV 接口请求 JSON
+	 */
+	private String buildCreateRcvJson(MesMaterialRk mesMaterialRk) {
+		JSONObject root = new JSONObject(true);
+		root.put("OtherID", StringUtils.defaultIfBlank(mesMaterialRk.getOtherId(), ""));
+		root.put("DocTypeCode", StringUtils.defaultIfBlank(mesMaterialRk.getDocTypeCode(), ""));
+		root.put("BusinessDate", formatRkDate(mesMaterialRk.getBusineseDate()));
+		root.put("ConfirmDate", formatRkDate(mesMaterialRk.getConfirmDate()));
+
+		JSONObject line = new JSONObject(true);
+		line.put("OtherID", StringUtils.defaultIfBlank(mesMaterialRk.getOtherId(), ""));
+		line.put("DocLineNo", mesMaterialRk.getDocLineNo());
+		line.put("SrcDocNo", StringUtils.defaultIfBlank(mesMaterialRk.getSrcDocNo(), ""));
+		line.put("SrcDocLineNo", mesMaterialRk.getSrcDocLineNo());
+		line.put("LotCode", StringUtils.defaultIfBlank(mesMaterialRk.getLotCode(), ""));
+		line.put("Qty", mesMaterialRk.getQty());
+		line.put("RtnDeductQty", mesMaterialRk.getRtnDeductQty());
+		line.put("RtnFillQty", mesMaterialRk.getRtnFillQty());
+
+		JSONArray lineDtos = new JSONArray();
+		lineDtos.add(line);
+		root.put("LineDtos", lineDtos);
+
+		JSONArray requestArray = new JSONArray();
+		requestArray.add(root);
+		return requestArray.toJSONString();
+	}
+
+	private String formatRkDate(Date date) {
+		if (date == null) {
+			return "";
+		}
+		return DateUtils.formatDate(date, "yyyy-MM-dd");
+	}
+
+
+
+}

+ 61 - 1
src/main/java/com/jeesite/modules/mes/web/MesProductRecordController.java

@@ -765,7 +765,6 @@ public class MesProductRecordController extends BaseController {
 		if(!ObjectUtils.isEmpty(mpr)){
 			return renderResult(Global.FALSE, text("产品编号重复!"));
 		}
-
 		// 检验工件码
 		if(!mesProductCateService.checkSn(mesProductRecord.getSn())){
 			return renderResult(Global.FALSE, text("工件码格式不正确!"));
@@ -2750,6 +2749,67 @@ public String check(@RequestBody MesElectricTorque mesElectricTorque,HttpServlet
 		return renderResult(Global.TRUE, text("操作成功!"));
 	}
 
+//OP080热处理
+	@PostMapping(value = "pdaRcl")
+	@ResponseBody
+	public String pdaRcl(@Validated MesProductRecord mesProductRecord,HttpServletRequest request) {
+		String sn = request.getParameter("sn");
+		String oprno = request.getParameter("oprno");
+		String lineSn = request.getParameter("lineSn");
+		String result = request.getParameter("result");
+
+		String craft = "100000";
+		String remark = request.getParameter("remark");
+		String oldOprno = oprno;
+		if(oldOprno.length()==5){
+			oldOprno += "A";
+		}
+		String mesProductRecord_image = request.getParameter("mesProductRecord_image");
+		if(StringUtils.isEmpty(mesProductRecord_image)){
+			return renderResult(Global.FALSE, text("图片不能为空!"));
+		}
+		if(StringUtils.isEmpty(sn) || StringUtils.isEmpty(oprno) || StringUtils.isEmpty(result) || StringUtils.isEmpty(lineSn)){
+			return renderResult(Global.FALSE, text("参数错误!"));
+		}
+		if(!result.equals("UDF") && !result.equals("OK") && !result.equals("NG")){
+			return renderResult(Global.FALSE, text("结果错误!"));
+		}
+
+		User user = UserUtils.getUser();
+		String userCode = user.getUserCode();
+
+		List<ParamsResp> params = new ArrayList<>();
+
+		// 获取工位配置
+		MesLineProcess mesLineProcess1 = mesLineProcessService.findInfoByOprnoLineSn(oprno,lineSn);
+		if(ObjectUtils.isEmpty(mesLineProcess1)){
+			return renderResult(Global.FALSE, text("子工位未配置!"));
+		}
+
+		try{
+			String res = updateQualityCommon(mesLineProcess1,oprno,lineSn,sn,craft,result,userCode,params,remark);
+			String checkret = res.substring(2,4);
+			if(!checkret.equals("OK")){
+				String lx = res.substring(0,2)+" ";
+				String lmsg = ErrorMsg.getErrorMsg(checkret,lx);
+				return renderResult(Global.FALSE, text(lmsg));
+			}
+			// 保存上传的图片
+			mesProductRecord.setSn(sn);
+			mesProductRecord.setLineSn(lineSn);
+			mesProductRecord.setOprno(oprno);
+			mesProductRecord.setCraft(craft);
+			MesProductRecord info = mesProductRecordService.findInfo(mesProductRecord);
+			if(!ObjectUtils.isEmpty(info)){
+				FileUploadUtils.saveFileUpload(info, info.getId(), "mesProductRecord_image");
+			}
+		}catch (Exception e){
+			e.printStackTrace();
+			return renderResult(Global.FALSE, text("操作失败!"));
+		}
+
+		return renderResult(Global.TRUE, text("操作成功!"));
+	}
 	// 绑定底护板
 	@PostMapping(value = "binddhb")
 	@ResponseBody

+ 5 - 3
src/main/resources/config/application.yml

@@ -54,7 +54,7 @@ jdbc:
   type: mysql
   driver: com.mysql.cj.jdbc.Driver
 #  url: jdbc:mysql://127.0.0.1:3306/mes_cloud_ljr?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=CONVERT_TO_NULL&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true
-  url: jdbc:mysql://127.0.0.1:3390/mes_cloud_x04c?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=CONVERT_TO_NULL&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true
+  url: jdbc:mysql://10.0.20.10:3306/mes_cloud_ljr?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=CONVERT_TO_NULL&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true
 #  url: jdbc:mysql://192.168.22.99:3306/mes_cloud?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=CONVERT_TO_NULL&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true
 #  username: mes_cloud
 #  password: YD57bSRabiyWBwkZ
@@ -730,8 +730,10 @@ shiro:
     ${adminPath}/mes/mesInspectionApi/mesInspectionList= anon
     ${adminPath}/mes/mesInboundControllerApi/mesInboundList= anon
     ${adminPath}/mes/mesUnpackApi/mesUnpackList= anon
-    
-    
+    ${adminPath}/mes/mesMaterial/saveMaterial= anon
+    ${adminPath}/mes/mesProductRecord/pdaRcl= anon
+    ${adminPath}/mes/mesMaterialRk/jxCode= anon
+    ${adminPath}/mes/mesMaterialRk/mesToErp= anon
     
     
   

+ 15 - 0
src/main/resources/mappings/modules/mes/MesMaterialRkDao.xml

@@ -0,0 +1,15 @@
+<?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.jeesite.modules.mes.dao.MesMaterialRkDao">
+	
+	<!-- 查询数据
+	<select id="findList" resultType="MesMaterialRk">
+		SELECT ${sqlMap.column.toSql()}
+		FROM ${sqlMap.table.toSql()}
+		<where>
+			${sqlMap.where.toSql()}
+		</where>
+		ORDER BY ${sqlMap.order.toSql()}
+	</select> -->
+	
+</mapper>

+ 159 - 0
src/main/resources/views/modules/mes/mesMaterialRkForm.html

@@ -0,0 +1,159 @@
+<% layout('/layouts/default.html', {title: '采购入库单管理', libs: ['validate','fileupload']}){ %>
+<div class="main-content">
+	<div class="box box-main">
+		<div class="box-header with-border">
+			<div class="box-title">
+				<i class="fa icon-note"></i> ${text(mesMaterialRk.isNewRecord ? '新增采购入库单' : '编辑采购入库单')}
+			</div>
+			<div class="box-tools pull-right">
+				<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
+			</div>
+		</div>
+		<#form:form id="inputForm" model="${mesMaterialRk}" action="${ctx}/mes/mesMaterialRk/save" method="post" class="form-horizontal">
+			<div class="box-body">
+				<div class="form-unit">${text('基本信息')}</div>
+				<#form:hidden path="id"/>
+				<div class="row">
+					<div class="col-xs-6">
+						<div class="form-group">
+							<label class="control-label col-sm-4" title="">
+								<span class="required hide">*</span> ${text('第三方数据标识')}:<i class="fa icon-question hide"></i></label>
+							<div class="col-sm-8">
+								<#form:input path="otherId" maxlength="64" class="form-control"/>
+							</div>
+						</div>
+					</div>
+					<div class="col-xs-6">
+						<div class="form-group">
+							<label class="control-label col-sm-4" title="">
+								<span class="required ">*</span> ${text('单据类型编码')}:<i class="fa icon-question hide"></i></label>
+							<div class="col-sm-8">
+								<#form:input path="docTypeCode" maxlength="255" class="form-control required"/>
+							</div>
+						</div>
+					</div>
+					<div class="col-xs-6">
+						<div class="form-group">
+							<label class="control-label col-sm-4" title="">
+								<span class="required ">*</span> ${text('单据日期')}:<i class="fa icon-question hide"></i></label>
+							<div class="col-sm-8">
+								<#form:input path="busineseDate" readonly="true" maxlength="20" class="form-control laydate required"
+									dataFormat="datetime" data-type="datetime" data-format="yyyy-MM-dd HH:mm"/>
+							</div>
+						</div>
+					</div>
+					<div class="col-xs-6">
+						<div class="form-group">
+							<label class="control-label col-sm-4" title="">
+								<span class="required ">*</span> ${text('入库确认时间')}:<i class="fa icon-question hide"></i></label>
+							<div class="col-sm-8">
+								<#form:input path="confirmDate" readonly="true" maxlength="20" class="form-control laydate required"
+									dataFormat="datetime" data-type="datetime" data-format="yyyy-MM-dd HH:mm"/>
+							</div>
+						</div>
+					</div>
+					<div class="col-xs-6">
+						<div class="form-group">
+							<label class="control-label col-sm-4" title="">
+								<span class="required ">*</span> ${text('行号')}:<i class="fa icon-question hide"></i></label>
+							<div class="col-sm-8">
+								<#form:input path="docLineNo" maxlength="9" class="form-control required digits"/>
+							</div>
+						</div>
+					</div>
+					<div class="col-xs-6">
+						<div class="form-group">
+							<label class="control-label col-sm-4" title="">
+								<span class="required ">*</span> ${text('采购订单号')}:<i class="fa icon-question hide"></i></label>
+							<div class="col-sm-8">
+								<#form:input path="srcDocNo" maxlength="255" class="form-control required"/>
+							</div>
+						</div>
+					</div>
+					<div class="col-xs-6">
+						<div class="form-group">
+							<label class="control-label col-sm-4" title="">
+								<span class="required ">*</span> ${text('采购订单行号')}:<i class="fa icon-question hide"></i></label>
+							<div class="col-sm-8">
+								<#form:input path="srcDocLineNo" maxlength="9" class="form-control required digits"/>
+							</div>
+						</div>
+					</div>
+					<div class="col-xs-6">
+						<div class="form-group">
+							<label class="control-label col-sm-4" title="">
+								<span class="required ">*</span> ${text('批号')}:<i class="fa icon-question hide"></i></label>
+							<div class="col-sm-8">
+								<#form:input path="lotCode" maxlength="255" class="form-control required"/>
+							</div>
+						</div>
+					</div>
+					<div class="col-xs-6">
+						<div class="form-group">
+							<label class="control-label col-sm-4" title="">
+								<span class="required hide">*</span> ${text('合格数量')}:<i class="fa icon-question hide"></i></label>
+							<div class="col-sm-8">
+								<#form:input path="qty" maxlength="9" class="form-control digits"/>
+							</div>
+						</div>
+					</div>
+					<div class="col-xs-6">
+						<div class="form-group">
+							<label class="control-label col-sm-4" title="">
+								<span class="required hide">*</span> ${text('退补数量')}:<i class="fa icon-question hide"></i></label>
+							<div class="col-sm-8">
+								<#form:input path="rtnDeductQty" maxlength="9" class="form-control digits"/>
+							</div>
+						</div>
+					</div>
+					<div class="col-xs-6">
+						<div class="form-group">
+							<label class="control-label col-sm-4" title="">
+								<span class="required hide">*</span> ${text('退扣数量')}:<i class="fa icon-question hide"></i></label>
+							<div class="col-sm-8">
+								<#form:input path="rtnFillQty" maxlength="9" class="form-control digits"/>
+							</div>
+						</div>
+					</div>
+				</div>
+				<div class="row">
+					<div class="col-xs-12">
+						<div class="form-group">
+							<label class="control-label col-sm-2">
+								<span class="required hide">*</span> ${text('图片上传')}:</label>
+							<div class="col-sm-10">
+								<#form:fileupload id="uploadImage" bizKey="${mesMaterialRk.id}" bizType="mesMaterialRk_image"
+									uploadType="image" class="" readonly="false" preview="true"/>
+							</div>
+						</div>
+					</div>
+				</div>
+			</div>
+			<div class="box-footer">
+				<div class="row">
+					<div class="col-sm-offset-2 col-sm-10">
+						<% if (hasPermi('mes:mesMaterialRk:edit')){ %>
+							<button type="submit" class="btn btn-sm btn-primary" id="btnSubmit"><i class="fa fa-check"></i> ${text('保 存')}</button>&nbsp;
+						<% } %>
+						<button type="button" class="btn btn-sm btn-default" id="btnCancel" onclick="js.closeCurrentTabPage()"><i class="fa fa-reply-all"></i> ${text('关 闭')}</button>
+					</div>
+				</div>
+			</div>
+		</#form:form>
+	</div>
+</div>
+<% } %>
+<script>
+$("#inputForm").validate({
+	submitHandler: function(form){
+		js.ajaxSubmitForm($(form), function(data){
+			js.showMessage(data.message);
+			if(data.result == Global.TRUE){
+				js.closeCurrentTabPage(function(contentWindow){
+					contentWindow.page();
+				});
+			}
+		}, "json");
+    }
+});
+</script>

+ 146 - 0
src/main/resources/views/modules/mes/mesMaterialRkList.html

@@ -0,0 +1,146 @@
+<% layout('/layouts/default.html', {title: '采购入库单管理', libs: ['dataGrid']}){ %>
+<div class="main-content">
+	<div class="box box-main">
+		<div class="box-header">
+			<div class="box-title">
+				<i class="fa icon-notebook"></i> ${text('采购入库单管理')}
+			</div>
+			<div class="box-tools pull-right">
+				<a href="#" class="btn btn-default" id="btnSearch" title="${text('查询')}"><i class="fa fa-filter"></i> ${text('查询')}</a>
+				<% if(hasPermi('mes:mesMaterialRk:edit')){ %>
+					<a href="${ctx}/mes/mesMaterialRk/form" class="btn btn-default btnTool" title="${text('新增采购入库单')}"><i class="fa fa-plus"></i> ${text('新增')}</a>
+				<% } %>
+				<a href="#" class="btn btn-default" id="btnSetting" title="${text('设置')}"><i class="fa fa-navicon"></i></a>
+			</div>
+		</div>
+		<div class="box-body">
+			<#form:form id="searchForm" model="${mesMaterialRk}" action="${ctx}/mes/mesMaterialRk/listData" method="post" class="form-inline hide"
+					data-page-no="${parameter.pageNo}" data-page-size="${parameter.pageSize}" data-order-by="${parameter.orderBy}">
+				<div class="form-group">
+					<label class="control-label">${text('第三方数据标识')}:</label>
+					<div class="control-inline">
+						<#form:input path="otherId" maxlength="64" class="form-control width-120"/>
+					</div>
+				</div>
+				<div class="form-group">
+					<label class="control-label">${text('单据类型编码')}:</label>
+					<div class="control-inline">
+						<#form:input path="docTypeCode" maxlength="255" class="form-control width-120"/>
+					</div>
+				</div>
+				<div class="form-group">
+					<label class="control-label">${text('单据日期')}:</label>
+					<div class="control-inline">
+						<#form:input path="busineseDate" readonly="true" maxlength="20" class="form-control laydate width-datetime"
+							dataFormat="datetime" data-type="datetime" data-format="yyyy-MM-dd HH:mm"/>
+					</div>
+				</div>
+				<div class="form-group">
+					<label class="control-label">${text('入库确认时间')}:</label>
+					<div class="control-inline">
+						<#form:input path="confirmDate" readonly="true" maxlength="20" class="form-control laydate width-datetime"
+							dataFormat="datetime" data-type="datetime" data-format="yyyy-MM-dd HH:mm"/>
+					</div>
+				</div>
+				<div class="form-group">
+					<label class="control-label">${text('行号')}:</label>
+					<div class="control-inline">
+						<#form:input path="docLineNo" maxlength="9" class="form-control width-120"/>
+					</div>
+				</div>
+				<div class="form-group">
+					<label class="control-label">${text('采购订单号')}:</label>
+					<div class="control-inline">
+						<#form:input path="srcDocNo" maxlength="255" class="form-control width-120"/>
+					</div>
+				</div>
+				<div class="form-group">
+					<label class="control-label">${text('采购订单行号')}:</label>
+					<div class="control-inline">
+						<#form:input path="srcDocLineNo" maxlength="9" class="form-control width-120"/>
+					</div>
+				</div>
+				<div class="form-group">
+					<label class="control-label">${text('批号')}:</label>
+					<div class="control-inline">
+						<#form:input path="lotCode" maxlength="255" class="form-control width-120"/>
+					</div>
+				</div>
+				<div class="form-group">
+					<label class="control-label">${text('合格数量')}:</label>
+					<div class="control-inline">
+						<#form:input path="qty" maxlength="9" class="form-control width-120"/>
+					</div>
+				</div>
+				<div class="form-group">
+					<label class="control-label">${text('退补数量')}:</label>
+					<div class="control-inline">
+						<#form:input path="rtnDeductQty" maxlength="9" class="form-control width-120"/>
+					</div>
+				</div>
+				<div class="form-group">
+					<label class="control-label">${text('退扣数量')}:</label>
+					<div class="control-inline">
+						<#form:input path="rtnFillQty" maxlength="9" class="form-control width-120"/>
+					</div>
+				</div>
+				<div class="form-group">
+					<label class="control-label">${text('状态')}:</label>
+					<div class="control-inline width-120">
+						<#form:select path="status" dictType="sys_search_status" blankOption="true" class="form-control isQuick"/>
+					</div>
+				</div>
+				<div class="form-group">
+					<button type="submit" class="btn btn-primary btn-sm">${text('查询')}</button>
+					<button type="reset" class="btn btn-default btn-sm">${text('重置')}</button>
+				</div>
+			</#form:form>
+			<table id="dataGrid"></table>
+			<div id="dataGridPage"></div>
+		</div>
+	</div>
+</div>
+<% } %>
+<script>
+// 初始化DataGrid对象
+$('#dataGrid').dataGrid({
+	searchForm: $("#searchForm"),
+	columnModel: [
+		{header:'${text("第三方数据标识")}', name:'otherId', index:'a.other_id', width:150, align:"left", frozen:true, formatter: function(val, obj, row, act){
+			return '<a href="${ctx}/mes/mesMaterialRk/form?id='+row.id+'" class="btnList" data-title="${text("编辑采购入库单")}">'+(val||row.id)+'</a>';
+		}},
+		{header:'${text("单据类型编码")}', name:'docTypeCode', index:'a.doc_type_code', width:150, align:"left"},
+		{header:'${text("单据日期")}', name:'busineseDate', index:'a.businese_date', width:150, align:"center"},
+		{header:'${text("入库确认时间")}', name:'confirmDate', index:'a.confirm_date', width:150, align:"center"},
+		{header:'${text("行号")}', name:'docLineNo', index:'a.doc_line_no', width:150, align:"center"},
+		{header:'${text("采购订单号")}', name:'srcDocNo', index:'a.src_doc_no', width:150, align:"left"},
+		{header:'${text("采购订单行号")}', name:'srcDocLineNo', index:'a.src_doc_line_no', width:150, align:"center"},
+		{header:'${text("批号")}', name:'lotCode', index:'a.lot_code', width:150, align:"left"},
+		{header:'${text("合格数量")}', name:'qty', index:'a.qty', width:150, align:"center"},
+		{header:'${text("退补数量")}', name:'rtnDeductQty', index:'a.rtn_deduct_qty', width:150, align:"center"},
+		{header:'${text("退扣数量")}', name:'rtnFillQty', index:'a.rtn_fill_qty', width:150, align:"center"},
+		{header:'${text("状态")}', name:'status', index:'a.status', width:150, align:"center", formatter: function(val, obj, row, act){
+			return js.getDictLabel(${@DictUtils.getDictListJson('sys_search_status')}, val, '${text("未知")}', true);
+		}},
+		{header:'${text("更新时间")}', name:'updateDate', index:'a.update_date', width:150, align:"center"},
+		{header:'${text("操作")}', name:'actions', width:180, formatter: function(val, obj, row, act){
+			var actions = [];
+			//<% if(hasPermi('mes:mesMaterialRk:edit')){ %>
+				actions.push('<a href="${ctx}/mes/mesMaterialRk/form?id='+row.id+'" class="btnList" title="${text("编辑采购入库单")}"><i class="fa fa-pencil"></i></a>&nbsp;');
+				if (row.status == Global.STATUS_NORMAL){
+					actions.push('<a href="${ctx}/mes/mesMaterialRk/disable?id='+row.id+'" class="btnList" title="${text("停用采购入库单")}" data-confirm="${text("确认要停用该采购入库单吗?")}"><i class="glyphicon glyphicon-ban-circle"></i></a>&nbsp;');
+				} else if (row.status == Global.STATUS_DISABLE){
+					actions.push('<a href="${ctx}/mes/mesMaterialRk/enable?id='+row.id+'" class="btnList" title="${text("启用采购入库单")}" data-confirm="${text("确认要启用该采购入库单吗?")}"><i class="glyphicon glyphicon-ok-circle"></i></a>&nbsp;');
+				}
+				actions.push('<a href="${ctx}/mes/mesMaterialRk/delete?id='+row.id+'" class="btnList" title="${text("删除采购入库单")}" data-confirm="${text("确认要删除该采购入库单吗?")}"><i class="fa fa-trash-o"></i></a>&nbsp;');
+				actions.push('<a href="${ctx}/mes/mesMaterialRk/mesToErp?id='+row.id+'" class="btnList" title="${text("同步ERP")}" data-confirm="${text("确认要同步该采购入库单到ERP吗?")}">${text("同步ERP")}</a>&nbsp;');
+			//<% } %>
+			return actions.join('');
+		}}
+	],
+	// 加载成功后执行事件
+	ajaxSuccess: function(data){
+		
+	}
+});
+</script>