|
|
@@ -86,9 +86,35 @@ public class DocCommonServiceImpl implements DocCommonService {
|
|
|
prodInOut.setToMasterCode("YJH_HK");
|
|
|
}
|
|
|
}*/
|
|
|
+ // 清理可能包含非法字符的字段
|
|
|
+ cleanInvalidChars(prodInOut);
|
|
|
return prodInOut;
|
|
|
}
|
|
|
-
|
|
|
+ // 添加清理方法
|
|
|
+ private void cleanInvalidChars(ProdInout prodInOut) {
|
|
|
+ if(prodInOut == null) return;
|
|
|
+ // 清理主表字段
|
|
|
+ prodInOut.setPiTitle(cleanInvalidXmlChars(prodInOut.getPiTitle()));
|
|
|
+ prodInOut.setPiRemark(cleanInvalidXmlChars(prodInOut.getPiRemark()));
|
|
|
+ prodInOut.setPiLxr(cleanInvalidXmlChars(prodInOut.getPiLxr()));
|
|
|
+ prodInOut.setPiLxdh(cleanInvalidXmlChars(prodInOut.getPiLxdh()));
|
|
|
+ prodInOut.setPiKhdz(cleanInvalidXmlChars(prodInOut.getPiKhdz()));
|
|
|
+ // 清理明细字段
|
|
|
+ if(prodInOut.getDetails() != null) {
|
|
|
+ for(Prodiodetail detail : prodInOut.getDetails()) {
|
|
|
+ detail.setPdProdname(cleanInvalidXmlChars(detail.getPdProdname()));
|
|
|
+ detail.setPdRemark(cleanInvalidXmlChars(detail.getPdRemark()));
|
|
|
+ detail.setPdCustProdCode(cleanInvalidXmlChars(detail.getPdCustProdCode()));
|
|
|
+ detail.setPdCustProdDetail(cleanInvalidXmlChars(detail.getPdCustProdDetail()));
|
|
|
+ detail.setPdCustProdSpec(cleanInvalidXmlChars(detail.getPdCustProdSpec()));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ private String cleanInvalidXmlChars(String input) {
|
|
|
+ if (input == null) return null;
|
|
|
+ // 保留连字符"-"、点"."和斜杠"/"
|
|
|
+ return input.replaceAll("[\\x00-\\x08\\x0B\\x0C\\x0E-\\x1F&&[^-./]]", " ");
|
|
|
+ }
|
|
|
private ProdInout queryMainTable(String master, String id) {
|
|
|
String sql = new StringBuilder()
|
|
|
.append("select pi_Wmsordertype piOrderType,pi_id piId,pi_inoutno piInoutno,pi_class piClass,pi_type piType,")
|
|
|
@@ -282,7 +308,6 @@ public class DocCommonServiceImpl implements DocCommonService {
|
|
|
//TODO 写入表:WMS_IO_RECORD_SEQ
|
|
|
return doPostToWms(xml,method);
|
|
|
}
|
|
|
-
|
|
|
@Override
|
|
|
public String sendInToWms(ProdInout prodInOut,String masterName){
|
|
|
EntryOrder entryOrder = new EntryOrder();
|