获取采购入库单
parent
5a430a9270
commit
c395e634cb
|
@ -1673,7 +1673,7 @@ public class WmImNoticeHController extends BaseController {
|
||||||
if(StringUtil.isEmpty(formDate)){
|
if(StringUtil.isEmpty(formDate)){
|
||||||
formDate = "2011-01-01";
|
formDate = "2011-01-01";
|
||||||
}
|
}
|
||||||
yyUtil.getPo(formDate);
|
yyUtil.getPord(formDate);
|
||||||
|
|
||||||
}
|
}
|
||||||
if ("UAS".equals(ResourceUtil.getConfigByName("interfacetype"))){
|
if ("UAS".equals(ResourceUtil.getConfigByName("interfacetype"))){
|
||||||
|
|
|
@ -89,7 +89,13 @@ public class yyUtil {
|
||||||
BaUnitEntity mdn = new BaUnitEntity();
|
BaUnitEntity mdn = new BaUnitEntity();
|
||||||
mdn.setUnitCode(prodbo.get("cComunitCode").toString());
|
mdn.setUnitCode(prodbo.get("cComunitCode").toString());
|
||||||
mdn.setUnitZhName(prodbo.get("cComUnitName").toString());
|
mdn.setUnitZhName(prodbo.get("cComUnitName").toString());
|
||||||
mdn.setUnitChange(prodbo.get("iChangeRate").toString());
|
try{
|
||||||
|
mdn.setUnitChange(prodbo.get("iChangRate").toString());
|
||||||
|
|
||||||
|
}catch (Exception e){
|
||||||
|
mdn.setUnitChange("1");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
BaUnitEntity baunit = systemService.findUniqueByProperty(
|
BaUnitEntity baunit = systemService.findUniqueByProperty(
|
||||||
|
@ -115,17 +121,31 @@ public class yyUtil {
|
||||||
mdn.setSuoShuKeHu("hwm");
|
mdn.setSuoShuKeHu("hwm");
|
||||||
mdn.setShpMingCheng(prodbo.get("cInvName").toString());
|
mdn.setShpMingCheng(prodbo.get("cInvName").toString());
|
||||||
mdn.setBzhiQi("360");
|
mdn.setBzhiQi("360");
|
||||||
mdn.setChpShuXing(prodbo.get("cInvCCode").toString().substring(0,2));
|
try{
|
||||||
|
mdn.setChpShuXing(prodbo.get("cInvCCode").toString().substring(0,2));
|
||||||
|
|
||||||
|
}catch (Exception e){
|
||||||
|
|
||||||
|
}
|
||||||
// mdn.setChpShuXing("其他");
|
// mdn.setChpShuXing("其他");
|
||||||
mdn.setShpGuiGe(prodbo.get("cInvStd").toString());
|
try{
|
||||||
|
mdn.setShpGuiGe(prodbo.get("cInvStd").toString());
|
||||||
|
}catch (Exception e){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
mdn.setJshDanWei(prodbo.get("cComUnitCode").toString());//拆零单位
|
mdn.setJshDanWei(prodbo.get("cComUnitCode").toString());//拆零单位
|
||||||
BaUnitEntity baunit = systemService.findUniqueByProperty(
|
BaUnitEntity baunit = systemService.findUniqueByProperty(
|
||||||
BaUnitEntity.class, "unitCode", mdn.getJshDanWei());
|
BaUnitEntity.class, "unitCode", mdn.getJshDanWei());
|
||||||
if (baunit !=null){
|
if (baunit !=null){
|
||||||
mdn.setJshDanWei(baunit.getUnitZhName());//拆零单位
|
mdn.setJshDanWei(baunit.getUnitZhName());//拆零单位
|
||||||
}
|
}
|
||||||
|
try{
|
||||||
mdn.setShlDanWei(prodbo.get("cSAComUnitCode").toString());//单位
|
mdn.setShlDanWei(prodbo.get("cSAComUnitCode").toString());//单位
|
||||||
|
}catch (Exception e){
|
||||||
|
|
||||||
|
}
|
||||||
if(StringUtil.isEmpty(mdn.getShlDanWei())){
|
if(StringUtil.isEmpty(mdn.getShlDanWei())){
|
||||||
mdn.setChlShl("1");
|
mdn.setChlShl("1");
|
||||||
mdn.setChlKongZhi("N");
|
mdn.setChlKongZhi("N");
|
||||||
|
@ -173,6 +193,83 @@ public class yyUtil {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public static void getPord(String indate) {
|
||||||
|
// PO_Pomain 采购订单主表
|
||||||
|
// PO_Podetails 采购订单子表
|
||||||
|
String dbKey= ResourceUtil.getConfigByName("yydbkey");
|
||||||
|
List<Map<String, Object>> result=null;
|
||||||
|
List<Map<String, Object>> resultdetail=null;
|
||||||
|
String querySql = "select * from RdRecord01 where ddate = '"+indate+"'";
|
||||||
|
Map queryparams = new LinkedHashMap<String,Object>();
|
||||||
|
|
||||||
|
SystemService systemService =ApplicationContextUtil.getContext().getBean(SystemService.class);
|
||||||
|
WmImNoticeHServiceI wmImNoticeHService =ApplicationContextUtil.getContext().getBean(WmImNoticeHServiceI.class);
|
||||||
|
|
||||||
|
if(StringUtils.isNotBlank(dbKey)) {
|
||||||
|
result = DynamicDBUtil.findList(dbKey, SqlUtil.jeecgCreatePageSql(dbKey, querySql, queryparams, 1, 1000000));
|
||||||
|
}
|
||||||
|
if (result!=null&&result.size()>0) {
|
||||||
|
for (int i = 0; i < result.size(); i++) {
|
||||||
|
Map<String, Object> prodbo = result.get(i);
|
||||||
|
String poid = prodbo.get("id").toString();
|
||||||
|
|
||||||
|
if (StringUtil.isNotEmpty(poid)) {
|
||||||
|
WmImNoticeHEntity wmimh = systemService.findUniqueByProperty(WmImNoticeHEntity.class, "imCusCode", poid);
|
||||||
|
if (wmimh == null) {
|
||||||
|
WmImNoticeHEntity wmImNoticeH = new WmImNoticeHEntity();
|
||||||
|
List<WmImNoticeIEntity> wmImNoticeIListnew = new ArrayList<WmImNoticeIEntity>();
|
||||||
|
|
||||||
|
wmImNoticeH.setOrderTypeCode("01");
|
||||||
|
String noticeid = wmUtil.getNextNoticeid(wmImNoticeH.getOrderTypeCode());
|
||||||
|
|
||||||
|
wmImNoticeH.setCusCode(ResourceUtil.getConfigByName("yy.cuscode"));
|
||||||
|
wmImNoticeH.setNoticeId(noticeid);
|
||||||
|
// wmImNoticeH.setPlatformCode(Integer.toString(billResult.getData().get(s).getPiId()));
|
||||||
|
// wmImNoticeH.setPiClass(billResult.getData().get(s).getPiClass());
|
||||||
|
// wmImNoticeH.setPiMaster(master);
|
||||||
|
// wmImNoticeH.setSupCode(billResult.getData().get(s).getPiCardcode());
|
||||||
|
// MdSupEntity mdsup = systemService.findUniqueByProperty(MdSupEntity.class, "gysBianMa", wmImNoticeH.getSupCode());
|
||||||
|
// if (mdsup != null) {
|
||||||
|
// wmImNoticeH.setSupName(mdsup.getZhongWenQch());
|
||||||
|
// }
|
||||||
|
try{
|
||||||
|
wmImNoticeH.setImBeizhu(prodbo.get("cMemo").toString());
|
||||||
|
}catch (Exception e){
|
||||||
|
|
||||||
|
}
|
||||||
|
wmImNoticeH.setImCusCode(poid);
|
||||||
|
String querySqldetail = "select * from RdRecords01 where id = '"+poid+"'";
|
||||||
|
if (resultdetail!=null){
|
||||||
|
resultdetail.clear();
|
||||||
|
}
|
||||||
|
resultdetail = DynamicDBUtil.findList(dbKey, SqlUtil.jeecgCreatePageSql(dbKey, querySqldetail, queryparams, 1, 1000000));
|
||||||
|
|
||||||
|
for (int k = 0; k < resultdetail.size(); k++) {
|
||||||
|
WmImNoticeIEntity wmi = new WmImNoticeIEntity();
|
||||||
|
Map<String, Object> proddet = resultdetail.get(k);
|
||||||
|
wmi.setGoodsCode(proddet.get("cInvCode").toString());
|
||||||
|
MvGoodsEntity mvgoods = systemService.findUniqueByProperty(
|
||||||
|
MvGoodsEntity.class, "goodsCode", wmi.getGoodsCode());
|
||||||
|
if (mvgoods != null) {
|
||||||
|
wmi.setGoodsName(mvgoods.getGoodsName());
|
||||||
|
wmi.setGoodsUnit(mvgoods.getShlDanWei());
|
||||||
|
}
|
||||||
|
wmi.setGoodsCount(Long.toString(new BigDecimal(proddet.get("iQuantity").toString()).setScale(0, RoundingMode.UP).longValue()));
|
||||||
|
// wmi.setGoodsPrdData(billResult.getData().get(s).getDetail().get(k).getPdProdmadedate2User());
|
||||||
|
// wmi.setOtherId();
|
||||||
|
wmImNoticeIListnew.add(wmi);
|
||||||
|
}
|
||||||
|
wmImNoticeHService.addMain(wmImNoticeH, wmImNoticeIListnew);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static void getPo(String indate) {
|
public static void getPo(String indate) {
|
||||||
// PO_Pomain 采购订单主表
|
// PO_Pomain 采购订单主表
|
||||||
// PO_Podetails 采购订单子表
|
// PO_Podetails 采购订单子表
|
||||||
|
|
Loading…
Reference in New Issue