Browse Source

Merge branch 'master' of http://139.196.39.194:9021/chenc/sen-yu-new-service

chenchuang 3 years ago
parent
commit
19632c2bc5

+ 5 - 5
jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/controller/MOMainController.java

@@ -92,8 +92,8 @@ public class MOMainController implements ApplicationContextAware {
             for (String str : pkorgSplit) {
                 String pkorgStr = str;
                 String pkorgValue[] = pkorgStr.split(":");
-                String ac = pkorgValue[1];
-                if (pkorgValue[0].equals("one")) {//mo.cPersonCode as 'salerId',hr.cPsn_Num as 'buyerId',
+                String ac = pkorgValue[1]; //or mo.dChangeVerifyTime >'"+lasttimeSf+"'
+                if (pkorgValue[0].equals("one")) {
                     String sql = "select mo.MOID as 'moId',mo.MOID as 'moId','"+ac+"' as accId,'"+pkorgValue[0]+"' as pkorg,mo.cState as 'poStatus'," +
                             "mo.cCode as 'poNum','SUBCONTRACTOR_PO' as 'poType',mo.cVenCode as 'supplierNumber',ven.cVenName as 'supplierName'," +
                             "ven.cVenPerson as 'supplierContacts',ven.cVenBranchPhone as 'supplierContactsPhone',mo.cPersonCode as 'salerCode',hr.cPsn_Num as 'headerAttributeString9'," +
@@ -112,7 +112,7 @@ public class MOMainController implements ApplicationContextAware {
                             " on mo.cPersonCode = hr1.cPsn_Num " +
                             " left join foreigncurrency curr " +
                             " on mo.cexch_name = curr.cexch_name " +
-                            " where  mo.iVerifyStateNew = 2 and ((mo.dVerifyTime>'"+lasttimeSf+"' or mo.dChangeVerifyTime >'"+lasttimeSf+"' and cDefine16 is null) or (mo.dVerifyTime>'"+lasttimeSf+"' or mo.dChangeVerifyTime >'"+lasttimeSf+"' and cDefine16 =1))  order by mo.dCreateTime desc";
+                            " where  mo.iVerifyStateNew = 2 and ((mo.dVerifyTime>'"+lasttimeSf+"'  and cDefine16 is null) or (mo.dVerifyTime>'"+lasttimeSf+"' and cDefine16 =1)) and mo.dChangeVerifyTime is null  order by mo.dCreateTime desc";
 
                     List<Map<String, Object>> list = senYuDataSourceOne.queryForList(sql);
                     for(Map<String, Object> map:list){
@@ -137,7 +137,7 @@ public class MOMainController implements ApplicationContextAware {
                             " on mo.cPersonCode = hr1.cPsn_Num " +
                             " left join foreigncurrency curr " +
                             " on mo.cexch_name = curr.cexch_name " +
-                            " where  mo.iVerifyStateNew = 2 and ((mo.dVerifyTime>'"+lasttimeSf+"' or mo.dChangeVerifyTime >'"+lasttimeSf+"' and cDefine16 is null) or (mo.dVerifyTime>'"+lasttimeSf+"' or mo.dChangeVerifyTime >'"+lasttimeSf+"' and cDefine16 =1))  order by mo.dCreateTime desc";
+                            " where  mo.iVerifyStateNew = 2 and ((mo.dVerifyTime>'"+lasttimeSf+"'  and cDefine16 is null) or (mo.dVerifyTime>'"+lasttimeSf+"'  and cDefine16 =1))  and mo.dChangeVerifyTime is null order by mo.dCreateTime desc";
 
                     List<Map<String, Object>> list = senYuDataSourceTwo.queryForList(sql);
                     for(Map<String, Object> map:list){
@@ -162,7 +162,7 @@ public class MOMainController implements ApplicationContextAware {
                             " on mo.cPersonCode = hr1.cPsn_Num " +
                             " left join foreigncurrency curr " +
                             " on mo.cexch_name = curr.cexch_name " +
-                            " where  mo.iVerifyStateNew = 2 and ((mo.dVerifyTime>'"+lasttimeSf+"' or mo.dChangeVerifyTime >'"+lasttimeSf+"' and cDefine16 is null) or (mo.dVerifyTime>'"+lasttimeSf+"' or mo.dChangeVerifyTime >'"+lasttimeSf+"' and cDefine16 =1))  order by mo.dCreateTime desc";
+                            " where  mo.iVerifyStateNew = 2 and ((mo.dVerifyTime>'"+lasttimeSf+"'  and cDefine16 is null) or (mo.dVerifyTime>'"+lasttimeSf+"'  and cDefine16 =1))  and mo.dChangeVerifyTime is null order by mo.dCreateTime desc";
 
                     List<Map<String, Object>> list = iSenYuDataSourceThree.queryForList(sql);
                     for(Map<String, Object> map:list){

+ 4 - 5
jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/controller/POPomainController.java

@@ -87,8 +87,7 @@ public class POPomainController implements ApplicationContextAware {
                 String pkorgValue[] = pkorgStr.split(":");
                 String ac = pkorgValue[1];
                 if (pkorgValue[0].equals("one")) {
-                    //ven.cVenName,mo.cVenCode mo.cPersonCode as salerId,hr.cPsn_Num as 'buyerId',
-                    //cAuditTime>'"+lasttimeSf+"' and mo.iverifystateex = 2
+                    //or cChangAuditTime >'"+lasttimeSf+"'
                     String sql = "select mo.POID as 'moId','"+ac+"' as accId,'"+pkorgValue[0]+"' as pkorg,mo.cState as 'poStatus',mo.cPOID as 'poNum','STANDARD_PO' as 'poType'," +
                             "mo.cVenCode as 'supplierNumber','采购业务实体名称' as 'poBusinessUnitCode',ven.cVenName as 'supplierName',mo.cPersonCode as salerCode,hr.cPsn_Num as 'headerAttributeString9'," +
                             "ven.cVenPerson as 'supplierContacts',ven.cVenBranchPhone as 'supplierContactsPhone'," +
@@ -106,7 +105,7 @@ public class POPomainController implements ApplicationContextAware {
                             "on mo.cPersonCode = hr1.cPsn_Num " +
                             "left join foreigncurrency curr " +
                             "on mo.cexch_name = curr.cexch_name " +
-                            "where ((cAuditTime>'"+lasttimeSf+"' or cChangAuditTime >'"+lasttimeSf+"' and cDefine16 is null) or(cAuditTime>'"+lasttimeSf+"' or cChangAuditTime >'"+lasttimeSf+"' and cDefine16 = 1)) and mo.iverifystateex = 2 order by mo.cAuditTime desc";
+                            "where ((cAuditTime>'"+lasttimeSf+"' and cDefine16 is null) or(cAuditTime>'"+lasttimeSf+"' and cDefine16 = 1)) and mo.iverifystateex = 2 and mo.cChangAuditTime is null order by mo.cAuditTime desc";
                     List<Map<String, Object>> list = senYuDataSourceOne.queryForList(sql);
                     for(Map<String, Object> map:list){
                         sumlist.add(map);
@@ -131,7 +130,7 @@ public class POPomainController implements ApplicationContextAware {
                             "on mo.cPersonCode = hr1.cPsn_Num " +
                             "left join foreigncurrency curr " +
                             "on mo.cexch_name = curr.cexch_name " +
-                            "where ((cAuditTime>'"+lasttimeSf+"' or cChangAuditTime >'"+lasttimeSf+"' and cDefine16 is null) or(cAuditTime>'"+lasttimeSf+"' or cChangAuditTime >'"+lasttimeSf+"' and cDefine16 = 1)) and mo.iverifystateex = 2 order by mo.cAuditTime desc";
+                            "where ((cAuditTime>'"+lasttimeSf+"' and cDefine16 is null) or(cAuditTime>'"+lasttimeSf+"' and cDefine16 = 1)) and mo.iverifystateex = 2  and mo.cChangAuditTime is null order by mo.cAuditTime desc";
                     List<Map<String, Object>> list = senYuDataSourceTwo.queryForList(sql);
                     for(Map<String, Object> map:list){
                         sumlist.add(map);
@@ -155,7 +154,7 @@ public class POPomainController implements ApplicationContextAware {
                             "on mo.cPersonCode = hr1.cPsn_Num " +
                             "left join foreigncurrency curr " +
                             "on mo.cexch_name = curr.cexch_name " +
-                            "where ((cAuditTime>'"+lasttimeSf+"' or cChangAuditTime >'"+lasttimeSf+"' and cDefine16 is null) or(cAuditTime>'"+lasttimeSf+"' or cChangAuditTime >'"+lasttimeSf+"' and cDefine16 = 1)) and mo.iverifystateex = 2 order by mo.cAuditTime desc";
+                            "where ((cAuditTime>'"+lasttimeSf+"' and cDefine16 is null) or(cAuditTime>'"+lasttimeSf+"' and cDefine16 = 1)) and mo.iverifystateex = 2  and mo.cChangAuditTime is null order by mo.cAuditTime desc";
                     List<Map<String, Object>> list = iSenYuDataSourceThree.queryForList(sql);
                     for(Map<String, Object> map:list){
                         sumlist.add(map);

+ 2 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/mapper/SubcontractingOrderMapper.java

@@ -87,10 +87,10 @@ public interface SubcontractingOrderMapper extends BaseMapper<SubcontractingOrde
     Map<String,Object> selectRdAllByBar(String cbSysBarCode);
     /**
      * 审核入库单
-     * @param cbSysBarCode
+     * @param id
      * @return
      */
-    int toExamine(@Param("id") String cbSysBarCode,@Param("cHandler")String cHandler);
+    int toExamine(@Param("id") String id,@Param("cHandler")String cHandler);
 
     /**
      * 更新入库单审核标记

+ 48 - 16
jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/service/impl/Rdrecord11ServiceImpl.java

@@ -3,6 +3,8 @@ package org.jeecg.modules.openApi.service.impl;
 import com.alibaba.fastjson.JSONObject;
 import org.jeecg.modules.openApi.service.IRdrecord11Service;
 import org.jeecg.modules.openApi.service.ISenYuDataSourceThree;
+import org.jeecg.modules.system.entity.SysDictItem;
+import org.jeecg.modules.system.mapper.SysDictItemMapper;
 import org.jeecg.modules.system.util.JsonChangeUtils;
 import org.jeecg.modules.system.util.oConvertUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -21,9 +23,13 @@ import java.util.Map;
 @Service
 public class Rdrecord11ServiceImpl  implements IRdrecord11Service {
 
+
     @Autowired
     private ISenYuDataSourceThree senYuDataSourceThree;
 
+    @Autowired
+    private SysDictItemMapper sysDictItemMapper;
+
     @Override
     public JSONObject getRdrecord(String org, String cCode) throws Exception{
         JSONObject resultJson=new JSONObject();
@@ -52,6 +58,33 @@ public class Rdrecord11ServiceImpl  implements IRdrecord11Service {
     public JSONObject getRdrecordToPrint(String org, String cCode) throws Exception {
         JSONObject resultJson=new JSONObject();
 
+        //获取字典里打印参数
+        SysDictItem sysDictItemBySplit=null;
+        SysDictItem sysDictItemByPrint=null;
+        List<SysDictItem> listSysDictItem=sysDictItemMapper.selectItemsByMaincode("pda_setting");
+        for (SysDictItem item:listSysDictItem){
+            if(item.getItemText().equals("print_split_sum")){
+                sysDictItemBySplit=item;
+            }else if(item.getItemText().equals("print_imageParam")){
+                sysDictItemByPrint=item;
+            }
+        }
+        if(null==sysDictItemBySplit||null==sysDictItemByPrint){
+           throw new Exception("获取打印参数失败,请检查字典配置-PDA设置!");
+        }
+        int splitNum=Integer.parseInt(sysDictItemBySplit.getItemValue());//分割数量
+        String[] printParam=sysDictItemByPrint.getItemValue().split(",");
+        int backImageWidth=Integer.parseInt(printParam[0]);
+        int backImageHeight=Integer.parseInt(printParam[1]);
+        int qrWidth=Integer.parseInt(printParam[2]);
+        int qrHeight=Integer.parseInt(printParam[3]);
+        int x_text=Integer.parseInt(printParam[4]);
+        int y_text=Integer.parseInt(printParam[5]);
+        int x_image=Integer.parseInt(printParam[6]);
+        int spacing=Integer.parseInt(printParam[7]);
+        int fintSize=Integer.parseInt(printParam[8]);
+
+
         FileSystemView fsv = FileSystemView.getFileSystemView();
         File com = fsv.getHomeDirectory(); //这两行行是获取桌面路径的具体方法
         String finalPath=com.getPath()+"/imagePrint";//数据缓存位置,默认放在桌面
@@ -81,7 +114,7 @@ public class Rdrecord11ServiceImpl  implements IRdrecord11Service {
             for(int i=0;i<pljf.size();i++){
                 JSONObject onejson=pljf.get(i);
                 //生成二维码数量=
-                int num=(onejson.getBigDecimal("数量").divide(new BigDecimal("15000"),0,BigDecimal.ROUND_UP)).intValue();
+                int num=(onejson.getBigDecimal("数量").divide(new BigDecimal(splitNum),0,BigDecimal.ROUND_UP)).intValue();
                 sum=sum+num;
                 for(int j=0;j<num;j++){
                     serialNum=serialNum+1;
@@ -89,35 +122,34 @@ public class Rdrecord11ServiceImpl  implements IRdrecord11Service {
                     String newFilePath=finalPath+"/"+serialNum+".png";
                     pathList.add(newFilePath);
                     //生成二维码图片
-                    BufferedImage bufferedImage=oConvertUtils.getBufferedImage(onejson.toJSONString(),200,200);
+                    BufferedImage bufferedImage=oConvertUtils.getBufferedImage(onejson.toJSONString(),qrWidth,qrHeight);
                     //背景图片
-                    BufferedImage backImage = new BufferedImage(400, 400,BufferedImage.TYPE_INT_RGB);
+                    BufferedImage backImage = new BufferedImage(backImageWidth, backImageHeight,BufferedImage.TYPE_INT_RGB);
                     //显示文字 缸号,委外订单号,匹数,物料,描述,关键属性,供应商,接收方
 
                     //绘制合成
                     Graphics2D backGraphics=backImage.createGraphics();
-                    backGraphics.setClip(0, 0, 400, 400);//设置绘画的区域,默认背景是黑色,也叫做获取画笔,指定画笔可画的范围
+                    backGraphics.setClip(0, 0, backImageWidth, backImageHeight);//设置绘画的区域,默认背景是黑色,也叫做获取画笔,指定画笔可画的范围
                     backGraphics.setColor(Color.white);//设置画笔颜色
-                    backGraphics.fillRect(0, 0, 400, 400);//画一个矩形块,颜色是白色,因为画笔颜色是白色
+                    backGraphics.fillRect(0, 0, backImageWidth, backImageHeight);//画一个矩形块,颜色是白色,因为画笔颜色是白色
 
                     //放文字
                     backGraphics.setColor(Color.black);
-                    int bTextSize=15;
-                    Font font=new Font("宋体",Font.BOLD,bTextSize);
+                    Font font=new Font("宋体",Font.BOLD,fintSize);
                     backGraphics.setFont(font);
                     backGraphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
 
-                    backGraphics.drawString("缸号:"+onejson.getString("缸单条码"),0,30+bTextSize*0);
-                    backGraphics.drawString("委外订单号:"+onejson.getString("下游订单"),0,30+(bTextSize+5)*1);
-                    backGraphics.drawString("匹数:"+onejson.getString("匹数"),0,30+(bTextSize+5)*2);
-                    backGraphics.drawString("物料:"+onejson.getString("物料"),0,30+(bTextSize+5)*3);
-                    backGraphics.drawString("描述:"+onejson.getString("描述"),0,30+(bTextSize+5)*4);
-                    backGraphics.drawString("关键属性:",0,30+(bTextSize+5)*5);
-                    backGraphics.drawString("供应商:"+onejson.getString("供应商"),0,30+(bTextSize+5)*6);
-                    backGraphics.drawString("接收方:"+onejson.getString("接收方"),0,30+(bTextSize+5)*7);
+                    backGraphics.drawString("缸号:"+onejson.getString("缸单条码"),x_text,y_text+fintSize*0);
+                    backGraphics.drawString("委外订单号:"+onejson.getString("下游订单"),x_text,y_text+(spacing+fintSize)*1);
+                    backGraphics.drawString("匹数:"+onejson.getString("匹数"),x_text,y_text+(spacing+fintSize)*2);
+                    backGraphics.drawString("物料:"+onejson.getString("物料"),x_text,y_text+(spacing+fintSize)*3);
+                    backGraphics.drawString("描述:"+onejson.getString("描述"),x_text,y_text+(spacing+fintSize)*4);
+                    backGraphics.drawString("关键属性:",x_text,y_text+(spacing+fintSize)*5);
+                    backGraphics.drawString("供应商:"+onejson.getString("供应商"),x_text,y_text+(spacing+fintSize)*6);
+                    backGraphics.drawString("接收方:"+onejson.getString("接收方"),x_text,y_text+(spacing+fintSize)*7);
 
                     //放图片
-                    backGraphics.drawImage(bufferedImage, 0,180, bufferedImage.getWidth(), bufferedImage.getHeight(),null);
+                    backGraphics.drawImage(bufferedImage, x_image,y_text+spacing+(spacing+fintSize)*7, bufferedImage.getWidth(), bufferedImage.getHeight(),null);
 
                     backGraphics.dispose();// 释放对象
 

+ 3 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/mapper/SysDictItemMapper.java

@@ -17,4 +17,7 @@ import java.util.List;
 public interface SysDictItemMapper extends BaseMapper<SysDictItem> {
     @Select("SELECT * FROM sys_dict_item WHERE DICT_ID = #{mainId} order by sort_order asc, item_value asc")
     public List<SysDictItem> selectItemsByMainId(String mainId);
+
+    @Select("select*From sys_dict_item where dict_id=(select id From sys_dict where dict_code=#{mainCode})")
+    public List<SysDictItem> selectItemsByMaincode(String mainCode);
 }