Просмотр исходного кода

Merge branch 'dev' of ssh://10.10.100.21/source/saas-platform into dev

guq 7 лет назад
Родитель
Сommit
4ebb69c40a

+ 9 - 4
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/CustomerServiceImpl.java

@@ -459,14 +459,19 @@ public class CustomerServiceImpl extends CommonBaseServiceImpl<CustomerMapper, C
         return baseDTO;
     }
 
-    private String pushMaxnubmer(String code, Long id) {
+    private  String pushMaxnubmer(String code, Long id) {
         if (null == code) {
             throw new BizException(BizExceptionCode.NULL_CODE);
         }
         Long companyId = BaseContextHolder.getCompanyId();
-        Integer count = "0".equals(String.valueOf(id)) ? getMapper().validateCodeWhenInsert(code, companyId) :
-                getMapper().validateCodeWhenUpdate(code, id, companyId);
-        return maxnumberService.pushMaxnubmer(count, code, BillCodeSeq.CUSTOMER.getCaller()).getData();
+
+        String cu_code = null;
+        synchronized (CustomerServiceImpl.class){
+            Integer count = "0".equals(String.valueOf(id)) ? getMapper().validateCodeWhenInsert(code, companyId) :
+                    getMapper().validateCodeWhenUpdate(code, id, companyId);
+            cu_code =  maxnumberService.pushMaxnubmer(count, code, BillCodeSeq.CUSTOMER.getCaller()).getData();
+        }
+        return cu_code;
     }
 
     /**

+ 8 - 4
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/EmployeeServiceImpl.java

@@ -136,14 +136,18 @@ public class EmployeeServiceImpl extends CommonBaseServiceImpl<EmployeeMapper, E
         return new DocBaseDTO(id, code, "Employee");
     }
 
-    private String pushMaxnubmer(String code, Long id) {
+    private  String pushMaxnubmer(String code, Long id) {
         if (null == code) {
             throw new BizException(BizExceptionCode.NULL_CODE);
         }
         Long companyId = BaseContextHolder.getCompanyId();
-        Integer count = "0".equals(String.valueOf(id)) ? getMapper().validateCodeWhenInsert(code, companyId) :
-                getMapper().validateCodeWhenUpdate(code, id, companyId);
-        return maxnumberService.pushMaxnubmer(count, code, BillCodeSeq.EMPLOYEE.getCaller()).getData();
+        String em_code = null;
+        synchronized (EmployeeServiceImpl.class){
+            Integer count = "0".equals(String.valueOf(id)) ? getMapper().validateCodeWhenInsert(code, companyId) :
+                    getMapper().validateCodeWhenUpdate(code, id, companyId);
+            em_code =  maxnumberService.pushMaxnubmer(count, code, BillCodeSeq.EMPLOYEE.getCaller()).getData();
+        }
+        return em_code;
     }
 
 }

+ 2 - 6
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/impl/ProdInOutServiceImpl.java

@@ -14,7 +14,6 @@ import com.usoftchina.saas.commons.po.BillCodeSeq;
 import com.usoftchina.saas.commons.po.Operation;
 import com.usoftchina.saas.commons.po.Status;
 import com.usoftchina.saas.context.BaseContextHolder;
-import com.usoftchina.saas.document.api.EmployeeApi;
 import com.usoftchina.saas.document.api.WarehouseApi;
 import com.usoftchina.saas.exception.BizException;
 import com.usoftchina.saas.exception.ExceptionCode;
@@ -55,9 +54,6 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
     private ProdInOutListMapper prodInOutListMapper;
     @Autowired
     private WarehouseApi warehouseApi;
-    @Autowired
-    private EmployeeApi employeeApi;
-
     @Autowired
     private MaxnumberService maxnumberService;
 
@@ -139,8 +135,8 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         prodInOut.setPi_recordmanid(userId.intValue());
 //        prodInOut.setPi_recordman(emp.get("em_name").toString());
         prodInOut.setCreatorId(userId);
-        prodInOut.setCreateTime(new Date());
-        prodInOut.setPi_date(new Date());
+        prodInOut.setCreateTime(prodInOut.getPi_recorddate()==null?new Date():prodInOut.getPi_recorddate());
+        prodInOut.setPi_date(prodInOut.getPi_date()==null?new Date():prodInOut.getPi_date());
         prodInOut.setPi_puid(main.getPi_puid());
         prodInOut.setPi_pucode(main.getPi_pucode());
         baseDTO.setCode(pi_inoutno);

+ 1 - 9
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/impl/PurchaseServiceImpl.java

@@ -13,7 +13,6 @@ import com.usoftchina.saas.commons.exception.BizExceptionCode;
 import com.usoftchina.saas.commons.po.BillCodeSeq;
 import com.usoftchina.saas.commons.po.Status;
 import com.usoftchina.saas.context.BaseContextHolder;
-import com.usoftchina.saas.document.api.EmployeeApi;
 import com.usoftchina.saas.document.api.ProductApi;
 import com.usoftchina.saas.exception.BizException;
 import com.usoftchina.saas.exception.ExceptionCode;
@@ -34,7 +33,6 @@ import org.springframework.util.StringUtils;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
-import java.util.Map;
 
 
 /**
@@ -53,8 +51,6 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
     @Autowired
     private ProductApi productApi;
     @Autowired
-    private EmployeeApi employeeApi;
-    @Autowired
     private MaxnumberService maxnumberService;
     @Autowired
     private ProdInOutMapper prodInOutMapper;
@@ -111,11 +107,6 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
         Long companyId = BaseContextHolder.getCompanyId();
         //人员Id
         Long userId = BaseContextHolder.getUserId();
-
-
-        Map<String,Object> emp = employeeApi.getEmployeeByAccount();
-
-
         //获取主表信息
         PurchaseDTO main = formdata.getMain();
         List<PurchaseDetailDTO> items = formdata.getItems();
@@ -171,6 +162,7 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
             PurchaseDetail detail = BeanMapper.map(item, PurchaseDetail.class);
             detail.setPd_puid(pu_id);
             detail.setPd_code(pu_code);
+            detail.setPd_delivery(item.getPd_delivery()==null?purchase.getPu_delivery():item.getPd_delivery());
             detail.setCompanyId(companyId);
             detail.setCreatorId(userId);
             detail.setCreateTime(new Date());

+ 33 - 27
applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/service/impl/MakeServiceImpl.java

@@ -551,12 +551,8 @@ public class MakeServiceImpl extends CommonBaseServiceImpl<MakeMapper, Make> imp
     }
 
     @Override
-    public DocBaseDTO resAudit(Long id) {
-        return singleUnAudit(id);
-    }
-
     @Transactional(rollbackFor = Exception.class)
-    public DocBaseDTO singleUnAudit(Long id) {
+    public DocBaseDTO resAudit(Long id) {
         //1.获取主从表数据
         Make make = getMapper().selectByPrimaryKey(id);
         List<MakeMaterial> items = makeMaterialMapper.selectByFK(id, BaseContextHolder.getCompanyId());
@@ -578,26 +574,11 @@ public class MakeServiceImpl extends CommonBaseServiceImpl<MakeMapper, Make> imp
         //6.记录LOG
         messageLogService.unAudit(docBaseDTO);
         return docBaseDTO;
-    };
-
-    @Override
-    public String batchUnAudit(BatchDealBaseDTO baseDTOs) {
-        if (null == baseDTOs || null == baseDTOs.getBaseDTOs() ||
-                baseDTOs.getBaseDTOs().size() == 0) {
-            return "无可反审核单据。";
-        }
-        StringBuffer errorMsg = new StringBuffer();
-        for (DocBaseDTO base : baseDTOs.getBaseDTOs()) {
-            try {
-                Long id =  base.getId();
-                singleUnAudit(id);
-            }catch (Exception e) {
-                errorMsg.append("编号:" + base.getCode() + "处理失败," + e.getMessage());
-            }
-        }
-        return errorMsg.toString();
     }
 
+
+
+
     @Override
     public String batchClose(BatchDealBaseDTO batchDealBaseDTO) {
         StringBuilder errorMsg = new StringBuilder();
@@ -637,6 +618,27 @@ public class MakeServiceImpl extends CommonBaseServiceImpl<MakeMapper, Make> imp
     }
 
 
+
+    @Override
+    public String batchUnAudit(BatchDealBaseDTO baseDTOs) {
+        if (null == baseDTOs || null == baseDTOs.getBaseDTOs() ||
+                baseDTOs.getBaseDTOs().size() == 0) {
+            return "无可反审核单据。";
+        }
+        StringBuffer errorMsg = new StringBuffer();
+        for (DocBaseDTO base : baseDTOs.getBaseDTOs()) {
+            try {
+                Long id =  base.getId();
+
+//                ProdInOutDTO prodInOutDTO = BeanMapper.map(prodInOut,ProdInOutDTO.class);
+//                singleUnAudit(prodInOutDTO);
+            }catch (Exception e) {
+                errorMsg.append("编号:" + base.getCode() + "处理失败," + e.getMessage());
+            }
+        }
+        return errorMsg.toString();
+    }
+
     /**
      * 1.查找制造单关联的出入库单据
      * 2.反过账
@@ -705,13 +707,17 @@ public class MakeServiceImpl extends CommonBaseServiceImpl<MakeMapper, Make> imp
      * @Author: chenwei
      * @Date: 2018/10/26
      */
-    private synchronized String pushMaxnubmer(String code, Long id) {
+    private String pushMaxnubmer(String code, Long id) {
         if (null == code) {
             throw new BizException(BizExceptionCode.NULL_CODE);
         }
         Long companyId = BaseContextHolder.getCompanyId();
-        Integer count = "0".equals(String.valueOf(id)) ? getMapper().validateCodeWhenInsert(code, companyId) :
-                getMapper().validateCodeWhenUpdate(code, id, companyId);
-        return maxnumberService.pushMaxnubmer(count, code, BillCodeSeq.MAKE.getCaller()).getData();
+        String ma_code = null;
+        synchronized (MakeServiceImpl.class){
+            Integer count = "0".equals(String.valueOf(id)) ? getMapper().validateCodeWhenInsert(code, companyId) :
+                    getMapper().validateCodeWhenUpdate(code, id, companyId);
+            ma_code =  maxnumberService.pushMaxnubmer(count, code, BillCodeSeq.MAKE.getCaller()).getData();
+        }
+        return ma_code;
     }
 }

+ 17 - 13
applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/service/impl/ProdInOutServiceImpl.java

@@ -126,8 +126,8 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         ProdInOut prodInOut = BeanMapper.map(main,ProdInOut.class);
         prodInOut.setCompanyId(companyId);
         prodInOut.setCreatorId(userId);
-        prodInOut.setCreateTime(new Date());
-        prodInOut.setPi_date(new Date());
+        prodInOut.setCreateTime(prodInOut.getPi_recorddate()==null?new Date():prodInOut.getPi_recorddate());
+        prodInOut.setPi_date(prodInOut.getPi_date()==null?new Date():prodInOut.getPi_date());
         prodInOut.setPi_puid(main.getPi_puid());
         prodInOut.setPi_pucode(main.getPi_pucode());
         //编号获取
@@ -441,7 +441,7 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         return baseDTO;
     }
 
-    private synchronized String pushMaxnubmer(ProdInOut prodInOut) {
+    private  String pushMaxnubmer(ProdInOut prodInOut) {
         String pi_inoutno = prodInOut.getPi_inoutno();
         String pi_class = prodInOut.getPi_class();
         Long id = prodInOut.getId();
@@ -449,17 +449,21 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
             throw new BizException(BizExceptionCode.NULL_CODE);
         }
         Long companyId = BaseContextHolder.getCompanyId();
-        Integer count = "0".equals(String.valueOf(id)) ? getMapper().validateCodeWhenInsert(pi_inoutno, companyId) :
-                getMapper().validateCodeWhenUpdate(pi_inoutno, id, companyId);
-        String caller ="";
-        if("其它入库单".equals(pi_class)){
-            caller = BillCodeSeq.OTHERIN.getCaller();
-        }else if("其它出库单".equals(pi_class)) {
-            caller = BillCodeSeq.OTHEROUT.getCaller();
-        }else if("调拨单".equals(pi_class)) {
-            caller = BillCodeSeq.APPROPRIATIONINOUT.getCaller();
+        String code = null;
+        synchronized (ProdInOutServiceImpl.class){
+            Integer count = "0".equals(String.valueOf(id)) ? getMapper().validateCodeWhenInsert(pi_inoutno, companyId) :
+                    getMapper().validateCodeWhenUpdate(pi_inoutno, id, companyId);
+            String caller ="";
+            if("其它入库单".equals(pi_class)){
+                caller = BillCodeSeq.OTHERIN.getCaller();
+            }else if("其它出库单".equals(pi_class)) {
+                caller = BillCodeSeq.OTHEROUT.getCaller();
+            }else if("调拨单".equals(pi_class)) {
+                caller = BillCodeSeq.APPROPRIATIONINOUT.getCaller();
+            }
+            code = maxnumberService.pushMaxnubmer(count, pi_inoutno, caller).getData();
         }
-        return maxnumberService.pushMaxnubmer(count, pi_inoutno, caller).getData();
+        return code;
     }
 
 

+ 27 - 9
frontend/saas-web/app/view/purchase/purchase/FormPanel.js

@@ -201,12 +201,8 @@ Ext.define('saas.view.purchase.purchase.FormPanel', {
                     var arr = (v + '.').split('.');
                     var xr = (new Array(arr[1].length > 8 ? 8 : arr[1].length)).fill('0');
                     var format = '0,000.' + xr.join();
-                    if(v||v==0){
-                        return Ext.util.Format.number(v, '0.00');
-                    }else{
-                        return Ext.util.Format.number(v, format);
-                    }
-                }
+                    return Ext.util.Format.number(v, format);
+                },
             },
             {
                 text : "已转数", 
@@ -312,7 +308,7 @@ Ext.define('saas.view.purchase.purchase.FormPanel', {
                 width : 120.0
             },{
                 text : "备注", 
-                dataIndex : "sd_remark",
+                dataIndex : "pd_remark",
                 width : 250, 
                 items : null,
                 editor : {
@@ -351,17 +347,39 @@ Ext.define('saas.view.purchase.purchase.FormPanel', {
         name : "pu_buyerid", 
         fieldLabel : "采购员ID"
     },
+    {
+        xtype : "hidden", 
+        name : "creatorId", 
+        fieldLabel : "录入人ID", 
+        readOnly:true
+    },
     {
         xtype : "textfield", 
-        name : "pu_recorder", 
+        name : "creator", 
         fieldLabel : "录入人", 
         readOnly:true
     }, {
         xtype : "datefield", 
-        name : "pu_indate", 
+        name : "createtime", 
         fieldLabel : "录入日期",
         readOnly:true, 
         defaultValue: new Date()
+    },{
+        xtype : "hidden", 
+        name : "updaterId", 
+        fieldLabel : "更新人ID", 
+        readOnly:true
+    },{
+        xtype : "hidden", 
+        name : "updater", 
+        fieldLabel : "更新人", 
+        readOnly:true
+    }, {
+        xtype : "hidden", 
+        name : "updatetime", 
+        fieldLabel : "更新日期",
+        readOnly:true, 
+        defaultValue: new Date()
     }, {
         xtype : "textfield", 
         name : "pu_auditman", 

+ 26 - 0
frontend/saas-web/app/view/purchase/purchase/QueryPanel.js

@@ -137,6 +137,32 @@ Ext.define('saas.view.purchase.purchase.QueryPanel', {
             text: '关联销售单',
             dataIndex: 'pu_salecode',
             width: 120
+        }, {
+            text: '录入人ID',
+            dataIndex: 'creatorId',
+            width: 0
+        }, {
+            text: '录入人',
+            dataIndex: 'creator',
+            width: 0
+        }, {
+            text: '录入日期',
+            dataIndex: 'createTime',
+            xtype: 'datecolumn',
+            width: 0
+        }, {
+            text: '更新人ID',
+            dataIndex: 'updaterId',
+            width: 0
+        }, {
+            text: '更新人',
+            dataIndex: 'updater',
+            width: 0
+        }, {
+            text: '更新日期',
+            dataIndex: 'updateTime',
+            xtype: 'datecolumn',
+            width: 0
         }],
         relativeColumn: [{
             text: 'id',

+ 27 - 3
frontend/saas-web/app/view/purchase/purchaseIn/FormPanel.js

@@ -340,16 +340,40 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanel', {
         name : "pi_remark", 
         fieldLabel : "备注", 
         columnWidth : 1
-    },{
+    },
+    {
+        xtype : "hidden", 
+        name : "creatorId", 
+        fieldLabel : "录入人ID", 
+        readOnly:true
+    },
+    {
         xtype : "textfield", 
-        name : "pi_recordman", 
+        name : "creator", 
         fieldLabel : "录入人", 
         readOnly:true
     }, {
         xtype : "datefield", 
-        name : "createTime", 
+        name : "createtime", 
         fieldLabel : "录入日期",
+        readOnly:true, 
+        defaultValue: new Date()
+    },{
+        xtype : "hidden", 
+        name : "updaterId", 
+        fieldLabel : "更新人ID", 
         readOnly:true
+    },{
+        xtype : "hidden", 
+        name : "updater", 
+        fieldLabel : "更新人", 
+        readOnly:true
+    }, {
+        xtype : "hidden", 
+        name : "updatetime", 
+        fieldLabel : "更新日期",
+        readOnly:true, 
+        defaultValue: new Date()
     }, {
         xtype : "textfield", 
         name : "pi_auditman", 

+ 26 - 0
frontend/saas-web/app/view/purchase/purchaseIn/QueryPanel.js

@@ -127,6 +127,32 @@ Ext.define('saas.view.purchase.purchaseIn.QueryPanel', {
             text: '备注',
             dataIndex: 'pi_remark',
             width: 200
+        },{
+            text: '录入人ID',
+            dataIndex: 'creatorId',
+            width: 0
+        }, {
+            text: '录入人',
+            dataIndex: 'creator',
+            width: 0
+        }, {
+            text: '录入日期',
+            dataIndex: 'createTime',
+            xtype: 'datecolumn',
+            width: 0
+        }, {
+            text: '更新人ID',
+            dataIndex: 'updaterId',
+            width: 0
+        }, {
+            text: '更新人',
+            dataIndex: 'updater',
+            width: 0
+        }, {
+            text: '更新日期',
+            dataIndex: 'updateTime',
+            xtype: 'datecolumn',
+            width: 0
         }],
         relativeColumn: [{
             text: 'id',

+ 27 - 3
frontend/saas-web/app/view/purchase/purchaseOut/FormPanel.js

@@ -322,16 +322,40 @@ Ext.define('saas.view.purchase.purchaseOut.FormPanel', {
         name : "pi_remark", 
         fieldLabel : "备注", 
         columnWidth : 1
-    }, {
+    },
+    {
+        xtype : "hidden", 
+        name : "creatorId", 
+        fieldLabel : "录入人ID", 
+        readOnly:true
+    },
+    {
         xtype : "textfield", 
-        name : "pi_recordman", 
+        name : "creator", 
         fieldLabel : "录入人", 
         readOnly:true
     }, {
         xtype : "datefield", 
-        name : "createTime", 
+        name : "createtime", 
         fieldLabel : "录入日期",
+        readOnly:true, 
+        defaultValue: new Date()
+    },{
+        xtype : "hidden", 
+        name : "updaterId", 
+        fieldLabel : "更新人ID", 
         readOnly:true
+    },{
+        xtype : "hidden", 
+        name : "updater", 
+        fieldLabel : "更新人", 
+        readOnly:true
+    }, {
+        xtype : "hidden", 
+        name : "updatetime", 
+        fieldLabel : "更新日期",
+        readOnly:true, 
+        defaultValue: new Date()
     }, {
         xtype : "textfield", 
         name : "pi_auditman", 

+ 27 - 1
frontend/saas-web/app/view/purchase/purchaseOut/QueryPanel.js

@@ -13,7 +13,7 @@ Ext.define('saas.view.purchase.purchaseOut.QueryPanel', {
         fieldLabel: 'ID',
         allowBlank: true,
         columnWidth: 0
-    }, {
+    }, {    
         xtype: 'textfield',
         name: 'pi_inoutno',
         fieldLabel: '单据编号',
@@ -131,6 +131,32 @@ Ext.define('saas.view.purchase.purchaseOut.QueryPanel', {
             text: '备注',
             dataIndex: 'pi_remark',
             width: 200
+        }, {
+            text: '录入人ID',
+            dataIndex: 'creatorId',
+            width: 0
+        }, {
+            text: '录入人',
+            dataIndex: 'creator',
+            width: 0
+        }, {
+            text: '录入日期',
+            dataIndex: 'createTime',
+            xtype: 'datecolumn',
+            width: 0
+        }, {
+            text: '更新人ID',
+            dataIndex: 'updaterId',
+            width: 0
+        }, {
+            text: '更新人',
+            dataIndex: 'updater',
+            width: 0
+        }, {
+            text: '更新日期',
+            dataIndex: 'updateTime',
+            xtype: 'datecolumn',
+            width: 0
         }],
         relativeColumn: [{
             text: 'id',

+ 3 - 3
frontend/saas-web/app/view/purchase/report/PurchasePay.js

@@ -20,7 +20,7 @@ Ext.define('saas.view.purchase.report.PurchasePay', {
         columnWidth: 0.25
     }, {
         xtype: 'condatefield',
-        name: 'pb_recorddate',
+        name: 'createTime',
         fieldLabel: '单据日期',
         columnWidth: 0.5
     }],
@@ -44,11 +44,11 @@ Ext.define('saas.view.purchase.report.PurchasePay', {
         width: 200
     }, {
         text: '录入人',
-        dataIndex: 'pb_recorder',
+        dataIndex: 'creator',
         width: 200
     }, {
         text : "日期", 
-        dataIndex : "pb_recorddate", 
+        dataIndex : "createTime", 
         xtype:'datecolumn'
     }, {
         text: '来源单号',