|
|
|
@ -36,6 +36,7 @@ import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
|
import java.math.RoundingMode;
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
|
import java.time.LocalDate;
|
|
|
|
|
import java.time.LocalDateTime;
|
|
|
|
|
import java.time.LocalTime;
|
|
|
|
@ -580,11 +581,12 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return sapRson;
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
return R.fail("报工失败:"+e.getMessage());
|
|
|
|
|
} finally {
|
|
|
|
|
DynamicDataSourceContextHolder.poll();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@ -808,7 +810,7 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
|
|
|
|
|
* @param workOrder
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
private R reportHzToSap(MesReportWork workOrder) {
|
|
|
|
|
private R reportHzToSap(MesReportWork workOrder) throws Exception {
|
|
|
|
|
Date nowTime = DateUtils.getNowDate();
|
|
|
|
|
SapRFW sapRFW = new SapRFW();
|
|
|
|
|
sapRFW.setAufnr(workOrder.getWorkorderCodeSap());//虚拟工单号
|
|
|
|
@ -847,6 +849,7 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
|
|
|
|
|
}
|
|
|
|
|
sapRFW.setLt_hwList(lt_hwList);
|
|
|
|
|
sapRFW.setAnzma(workOrder.getSapCode());//产线编号
|
|
|
|
|
sapRFW.setBudat(DateUtils.formatToYYYYMMDD(workOrder.getProductDate(),"yyyy-MM-dd"));
|
|
|
|
|
sapRFW.setRemark(workOrder.getRemark());//备注
|
|
|
|
|
logger.info(workOrder.getWorkorderCodeSap() + "sap工单报工请求:" + JSONObject.toJSONString(sapRFW));
|
|
|
|
|
R r = remoteSapService.sapRFWOrder(sapRFW);
|
|
|
|
@ -872,7 +875,7 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
|
|
|
|
|
* @param workOrder
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
private R reportHzToSap3(MesReportWork workOrder) {
|
|
|
|
|
private R reportHzToSap3(MesReportWork workOrder) throws Exception {
|
|
|
|
|
Date nowTime = DateUtils.getNowDate();
|
|
|
|
|
SapRFW sapRFW = new SapRFW();
|
|
|
|
|
sapRFW.setAufnr(workOrder.getWorkorderCodeSap());//虚拟工单号
|
|
|
|
@ -909,6 +912,7 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
|
|
|
|
|
}
|
|
|
|
|
sapRFW.setLt_hwList(lt_hwList);
|
|
|
|
|
sapRFW.setAnzma(workOrder.getSapCode());//产线编号
|
|
|
|
|
sapRFW.setBudat(DateUtils.formatToYYYYMMDD(workOrder.getProductDate(),"yyyy-MM-dd"));
|
|
|
|
|
sapRFW.setRemark(workOrder.getRemark());//备注
|
|
|
|
|
logger.info(workOrder.getWorkorderCodeSap() + "sap工单报工请求:" + JSONObject.toJSONString(sapRFW));
|
|
|
|
|
//R r= R.ok();
|
|
|
|
@ -1310,18 +1314,18 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void main(String args[]){
|
|
|
|
|
List<String> days = new ArrayList<>();
|
|
|
|
|
// 获取当前日期
|
|
|
|
|
LocalDate today = LocalDate.now();
|
|
|
|
|
// 定义一个日期格式化器
|
|
|
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
|
|
|
// 打印最近七天的日期
|
|
|
|
|
for (int i = 0; i < 7; i++) {
|
|
|
|
|
LocalDate date = today.minusDays(i);
|
|
|
|
|
days.add(date.format(formatter));
|
|
|
|
|
}
|
|
|
|
|
Collections.reverse(days);
|
|
|
|
|
System.out.println(days);
|
|
|
|
|
}
|
|
|
|
|
// public static void main(String args[]){
|
|
|
|
|
// List<String> days = new ArrayList<>();
|
|
|
|
|
// // 获取当前日期
|
|
|
|
|
// LocalDate today = LocalDate.now();
|
|
|
|
|
// // 定义一个日期格式化器
|
|
|
|
|
// DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
|
|
|
// // 打印最近七天的日期
|
|
|
|
|
// for (int i = 0; i < 7; i++) {
|
|
|
|
|
// LocalDate date = today.minusDays(i);
|
|
|
|
|
// days.add(date.format(formatter));
|
|
|
|
|
// }
|
|
|
|
|
// Collections.reverse(days);
|
|
|
|
|
// System.out.println(days);
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|