出库打印第三方客户

master
e 2019-03-19 22:15:12 +08:00
parent d4aad9e770
commit 7b1fa2dc8c
1 changed files with 5 additions and 40 deletions

View File

@ -234,8 +234,11 @@ public class WmOmNoticeHController extends BaseController {
MdCusEntity mdcus = systemService.findUniqueByProperty(MdCusEntity.class,"keHuBianMa",wmOmNoticeHEntity.getCusCode()); MdCusEntity mdcus = systemService.findUniqueByProperty(MdCusEntity.class,"keHuBianMa",wmOmNoticeHEntity.getCusCode());
MdCusOtherEntity mdcusother = systemService.findUniqueByProperty(MdCusOtherEntity.class,"keHuBianMa",wmOmNoticeHEntity.getOcusCode()); MdCusOtherEntity mdcusother = systemService.findUniqueByProperty(MdCusOtherEntity.class,"keHuBianMa",wmOmNoticeHEntity.getOcusCode());
request.setAttribute("cusname",wmOmNoticeHEntity.getCusCode()+"-"+ mdcus.getZhongWenQch()); request.setAttribute("cusname",wmOmNoticeHEntity.getCusCode()+"-"+ mdcus.getZhongWenQch());
if(mdcusother!=null){
request.setAttribute("ocusname",wmOmNoticeHEntity.getOcusCode()+"-"+ mdcusother.getZhongWenQch()); request.setAttribute("ocusname",wmOmNoticeHEntity.getOcusCode()+"-"+ mdcusother.getZhongWenQch());
}else{
request.setAttribute("ocusname",wmOmNoticeHEntity.getOcusCode());
}
}catch (Exception e){ }catch (Exception e){
@ -248,45 +251,32 @@ public class WmOmNoticeHController extends BaseController {
Double tomsum = 0.00; Double tomsum = 0.00;
Double noticesum = 0.00; Double noticesum = 0.00;
Double tijisum = 0.00; Double tijisum = 0.00;
Double zhlsum = 0.00; Double zhlsum = 0.00;
try{ try{
List<WmOmQmIEntity> wmOmQmIEntityList = systemService.findHql(hql0, id0);//获取行项目 List<WmOmQmIEntity> wmOmQmIEntityList = systemService.findHql(hql0, id0);//获取行项目
List<WmOmQmIEntity> wmOmQmIEntityListnew = new ArrayList<>(); List<WmOmQmIEntity> wmOmQmIEntityListnew = new ArrayList<>();
DecimalFormat dfsum=new DecimalFormat(".##"); DecimalFormat dfsum=new DecimalFormat(".##");
try{ try{
for(WmOmQmIEntity tom:wmOmQmIEntityList){ for(WmOmQmIEntity tom:wmOmQmIEntityList){
tomsum = tomsum + Double.parseDouble(tom.getBaseGoodscount()); tomsum = tomsum + Double.parseDouble(tom.getBaseGoodscount());
try{ try{
tijisum = tijisum + Double.parseDouble(tom.getTinTj()); tijisum = tijisum + Double.parseDouble(tom.getTinTj());
}catch ( Exception e){ }catch ( Exception e){
} }
try{ try{
zhlsum = zhlsum + Double.parseDouble(tom.getTinZhl()); zhlsum = zhlsum + Double.parseDouble(tom.getTinZhl());
}catch ( Exception e){ }catch ( Exception e){
} }
try{ try{
tom.setTinZhl(dfsum.format(Double.parseDouble(tom.getTinZhl()))); tom.setTinZhl(dfsum.format(Double.parseDouble(tom.getTinZhl())));
}catch ( Exception e){ }catch ( Exception e){
} }
try{ try{
tom.setTinTj(dfsum.format(Double.parseDouble(tom.getTinTj()))); tom.setTinTj(dfsum.format(Double.parseDouble(tom.getTinTj())));
}catch ( Exception e){ }catch ( Exception e){
} }
tom.setBaseGoodscount(StringUtil.getdouble(tom.getBaseGoodscount())); tom.setBaseGoodscount(StringUtil.getdouble(tom.getBaseGoodscount()));
try{ try{
MvGoodsEntity mvgoods = systemService.findUniqueByProperty( MvGoodsEntity mvgoods = systemService.findUniqueByProperty(
MvGoodsEntity.class, "goodsCode", tom.getGoodsId()); MvGoodsEntity.class, "goodsCode", tom.getGoodsId());
@ -297,7 +287,6 @@ public class WmOmNoticeHController extends BaseController {
try{ try{
shpguige = Integer.parseInt(mvgoods.getShpGuiGe()); shpguige = Integer.parseInt(mvgoods.getShpGuiGe());
}catch (Exception e){ }catch (Exception e){
} }
if(shpguige!=0){ if(shpguige!=0){
Double xianhshu = Math.floor(Double.parseDouble(tom.getBaseGoodscount())/shpguige); Double xianhshu = Math.floor(Double.parseDouble(tom.getBaseGoodscount())/shpguige);
@ -305,24 +294,16 @@ public class WmOmNoticeHController extends BaseController {
long xiangshuint = Math.round(xianhshu); long xiangshuint = Math.round(xianhshu);
if(xianhshu > 0){ if(xianhshu > 0){
tom.setPickNotice(xiangshuint+"整"+jianshu+tom.getBaseUnit()); tom.setPickNotice(xiangshuint+"整"+jianshu+tom.getBaseUnit());
}else{ }else{
tom.setPickNotice(tom.getBaseGoodscount()+tom.getBaseUnit()); tom.setPickNotice(tom.getBaseGoodscount()+tom.getBaseUnit());
} }
} }
}catch (Exception e){ }catch (Exception e){
} }
wmOmQmIEntityListnew.add(tom); wmOmQmIEntityListnew.add(tom);
} }
}catch ( Exception e){ }catch ( Exception e){
} }
String hqlnotice = "from WmOmNoticeIEntity where 1 = 1 AND oM_NOTICE_ID = ? "; String hqlnotice = "from WmOmNoticeIEntity where 1 = 1 AND oM_NOTICE_ID = ? ";
List<WmOmNoticeIEntity> wmOmNoticeIEntityList = systemService.findHql(hqlnotice,id0); List<WmOmNoticeIEntity> wmOmNoticeIEntityList = systemService.findHql(hqlnotice,id0);
for(WmOmNoticeIEntity tnotice:wmOmNoticeIEntityList){ for(WmOmNoticeIEntity tnotice:wmOmNoticeIEntityList){
@ -336,17 +317,14 @@ public class WmOmNoticeHController extends BaseController {
String tijiunit="立方分米"; String tijiunit="立方分米";
String zhongliangunit="公斤"; String zhongliangunit="公斤";
try{ try{
tijiunit= ResourceUtil.getConfigByName("tijiunit"); tijiunit= ResourceUtil.getConfigByName("tijiunit");
zhongliangunit=ResourceUtil.getConfigByName("zhongliangunit"); zhongliangunit=ResourceUtil.getConfigByName("zhongliangunit");
}catch (Exception e){ }catch (Exception e){
} }
request.setAttribute("tijisum", dfsum.format(tijisum)+tijiunit); request.setAttribute("tijisum", dfsum.format(tijisum)+tijiunit);
request.setAttribute("zhlsum", dfsum.format(zhlsum)+zhongliangunit); request.setAttribute("zhlsum", dfsum.format(zhlsum)+zhongliangunit);
request.setAttribute("wmOmQmIList", wmOmQmIEntityList); request.setAttribute("wmOmQmIList", wmOmQmIEntityList);
}catch (Exception e){ }catch (Exception e){
} }
return new ModelAndView("com/zzjee/wm/print/jianhuorenwu-print"); return new ModelAndView("com/zzjee/wm/print/jianhuorenwu-print");
} }
@ -382,13 +360,9 @@ public class WmOmNoticeHController extends BaseController {
} catch (Exception e) { } catch (Exception e) {
throw new BusinessException(e.getMessage()); throw new BusinessException(e.getMessage());
} }
if(StringUtil.isNotEmpty(wmUtil.getCusCode())){ if(StringUtil.isNotEmpty(wmUtil.getCusCode())){
cq.eq("cusCode", wmUtil.getCusCode()); cq.eq("cusCode", wmUtil.getCusCode());
} }
cq.eq("omSta", Constants.wm_sta6);//"复核完成" cq.eq("omSta", Constants.wm_sta6);//"复核完成"
cq.add(); cq.add();
this.wmOmNoticeHService.getDataGridReturn(cq, true); this.wmOmNoticeHService.getDataGridReturn(cq, true);
@ -397,7 +371,6 @@ public class WmOmNoticeHController extends BaseController {
for (WmOmNoticeHEntity WmOmNoticeH : resultold) { for (WmOmNoticeHEntity WmOmNoticeH : resultold) {
WmOmNoticeH.setDelvData(null); WmOmNoticeH.setDelvData(null);
resultnew.add(WmOmNoticeH); resultnew.add(WmOmNoticeH);
} }
dataGrid.setResults(resultnew); dataGrid.setResults(resultnew);
TagUtil.datagrid(response, dataGrid); TagUtil.datagrid(response, dataGrid);
@ -642,7 +615,6 @@ public class WmOmNoticeHController extends BaseController {
if(wmOmNoticeH.getCusCode()==null){ if(wmOmNoticeH.getCusCode()==null){
if(StringUtil.isNotEmpty(wmUtil.getCusCode())){ if(StringUtil.isNotEmpty(wmUtil.getCusCode())){
wmOmNoticeH.setCusCode(wmUtil.getCusCode()); wmOmNoticeH.setCusCode(wmUtil.getCusCode());
} }
} }
List<WmOmNoticeIEntity> wmomNoticeIListnew = new ArrayList<WmOmNoticeIEntity>(); List<WmOmNoticeIEntity> wmomNoticeIListnew = new ArrayList<WmOmNoticeIEntity>();
@ -655,12 +627,9 @@ public class WmOmNoticeHController extends BaseController {
} catch (Exception e) { } catch (Exception e) {
// TODO: handle exception // TODO: handle exception
} }
wmomNoticeIListnew.add(wmomNoticeIEntity); wmomNoticeIListnew.add(wmomNoticeIEntity);
} }
} }
if(StringUtil.isNotEmpty( wmOmNoticeH.getOcusCode())){ if(StringUtil.isNotEmpty( wmOmNoticeH.getOcusCode())){
String datecuso[]= wmOmNoticeH.getOcusCode().split("-"); String datecuso[]= wmOmNoticeH.getOcusCode().split("-");
MdCusOtherEntity mdcusother = systemService.findUniqueByProperty(MdCusOtherEntity.class, "keHuBianMa", datecuso[0]); MdCusOtherEntity mdcusother = systemService.findUniqueByProperty(MdCusOtherEntity.class, "keHuBianMa", datecuso[0]);
@ -668,18 +637,14 @@ public class WmOmNoticeHController extends BaseController {
wmOmNoticeH.setOcusName(mdcusother.getZhongWenQch()); wmOmNoticeH.setOcusName(mdcusother.getZhongWenQch());
} }
} }
wmOmNoticeHService.addMain(wmOmNoticeH, wmomNoticeIListnew); wmOmNoticeHService.addMain(wmOmNoticeH, wmomNoticeIListnew);
Map<String ,Object> map = new HashMap<String ,Object>(); Map<String ,Object> map = new HashMap<String ,Object>();
map.put("id", wmOmNoticeH.getOmNoticeId()); map.put("id", wmOmNoticeH.getOmNoticeId());
try { try {
TuiSongMsgUtil.sendMessage("出货通知", Constants.SMS_SEND_TYPE_3, "CKYYTZ", map, "admin", ResourceUtil.getSessionUserName().getUserName()); TuiSongMsgUtil.sendMessage("出货通知", Constants.SMS_SEND_TYPE_3, "CKYYTZ", map, "admin", ResourceUtil.getSessionUserName().getUserName());
} catch (Exception e) { } catch (Exception e) {
// TODO: handle exception // TODO: handle exception
} }
systemService.addLog(message, Globals.Log_Type_INSERT, Globals.Log_Leavel_INFO); systemService.addLog(message, Globals.Log_Type_INSERT, Globals.Log_Leavel_INFO);
}catch(Exception e){ }catch(Exception e){
e.printStackTrace(); e.printStackTrace();