Browse Source

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

zhuth 7 years ago
parent
commit
243f50a59f

+ 6 - 6
applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/EmployeeMapper.java

@@ -20,16 +20,16 @@ public interface EmployeeMapper extends CommonBaseMapper<Employee> {
 
     List<EmployeeDTO> selectEmployeeListByCondition(@Param("con") String con,@Param("companyId") Long companyId);
 
-    Integer validateCodeWhenInsert(@Param("code") String code, @Param("companyId") Long companyId);
+    int validateCodeWhenInsert(@Param("code") String code, @Param("companyId") Long companyId);
 
-    Integer validateCodeWhenUpdate(@Param("code") String code, @Param("id") Long id, @Param("companyId") Long company);
+    int validateCodeWhenUpdate(@Param("code") String code, @Param("id") Long id, @Param("companyId") Long company);
 
-    Integer validatePhoneWhenInsert(@Param("phone") String phone, @Param("companyId") Long companyId);
+    int validatePhoneWhenInsert(@Param("phone") String phone, @Param("companyId") Long companyId);
 
-    Integer validatePhoneWhenUpdate(@Param("phone") String phone, @Param("id") Long id, @Param("companyId") Long company);
+    int validatePhoneWhenUpdate(@Param("phone") String phone, @Param("id") Long id, @Param("companyId") Long company);
 
 
-    Integer validateNameAndCodeWhenInsert(@Param("code") String code,@Param("name") String em_name,@Param("companyId") Long companyId);
+    int validateNameAndCodeWhenInsert(@Param("code") String code,@Param("name") String em_name,@Param("companyId") Long companyId);
 
-    Integer validateNameAndCodeWhenUpdate(@Param("code") String code,@Param("name") String em_name,@Param("id") Long em_id,@Param("companyId") Long id);
+    int validateNameAndCodeWhenUpdate(@Param("code") String code,@Param("name") String em_name,@Param("id") Long id,@Param("companyId") Long companyId);
 }

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

@@ -65,10 +65,12 @@ public class EmployeeServiceImpl extends CommonBaseServiceImpl<EmployeeMapper, E
     @Override
     public DocBaseDTO saveFormData(Employee employee) {
         DocBaseDTO docBaseDTO = null;
-        String code = pushMaxnubmer(employee.getEm_code(), employee.getId());
+        Long companyId = BaseContextHolder.getCompanyId();
+        employee.setCompanyId(companyId);
         if(employee.getId() == 0){
+            String code = pushMaxnubmer(employee.getEm_code(), employee.getId());
             //检查名称和编号
-            int count = getMapper().validateNameAndCodeWhenInsert(code,employee.getEm_name(),BaseContextHolder.getCompanyId());
+            int count = getMapper().validateNameAndCodeWhenInsert(code,employee.getEm_name(),companyId);
             if (count>0) {
                 throw new BizException(BizExceptionCode.REPEAT_EMNAMECODE);
             }
@@ -77,7 +79,6 @@ public class EmployeeServiceImpl extends CommonBaseServiceImpl<EmployeeMapper, E
             if (count>0) {
                 throw new BizException(BizExceptionCode.REPEAT_TEL);
             }
-            employee.setCompanyId(BaseContextHolder.getCompanyId());
             employee.setCreatorId(BaseContextHolder.getUserId());
             employee.setCreateTime(new Date());
             employee.setCreatorName(BaseContextHolder.getUserName());
@@ -87,7 +88,7 @@ public class EmployeeServiceImpl extends CommonBaseServiceImpl<EmployeeMapper, E
             messageLogService.save(docBaseDTO);
         }else{
             //检查名称和编号
-            int count = getMapper().validateNameAndCodeWhenUpdate(code,employee.getEm_name(),employee.getId(),BaseContextHolder.getCompanyId());
+            int count = getMapper().validateNameAndCodeWhenUpdate(employee.getEm_code(),employee.getEm_name(),employee.getId(),companyId);
             if (count>0) {
                 throw new BizException(BizExceptionCode.REPEAT_EMNAMECODE);
             }

+ 3 - 2
applications/document/document-server/src/main/resources/mapper/EmployeeMapper.xml

@@ -239,8 +239,9 @@
   <select id="validateNameAndCodeWhenInsert" resultType="int">
     select count(*) from Employee where (em_code = #{code} or em_name = #{name}) and companyId =#{companyId}
   </select>
-  <select id="validateNameAndCodeWhenUpdate" resultType="int" >
-    select count(*) from Employee where (em_code = #{code} or em_name = #{name}) and em_id !=#{id} and companyId =#{companyId}
+  
+  <select id="validateNameAndCodeWhenUpdate" resultType="int">
+    select count(*) from Employee where (em_code = #{code} or em_name = #{name}) and em_id !=#{id}  and companyId =#{companyId}
   </select>
 
 

+ 1 - 1
applications/purchase/purchase-server/src/main/resources/mapper/ProdInOutMapper.xml

@@ -415,7 +415,7 @@
     select count(1) from prodinout where pi_inoutno = #{pi_inoutno} and companyid = #{companyId}
   </select>
   <select id="validateCodeWhenUpdate" resultType="int" >
-    select count(1) from prodinout where pi_inoutno = #{pi_inoutno} and pi_id != #{id} and companyid != #{companyId}
+    select count(1) from prodinout where pi_inoutno = #{pi_inoutno} and pi_id != #{id} and companyid = #{companyId}
   </select>
 
   <select id="selectCodeById" resultType="string" parameterType="long">

+ 1 - 1
applications/sale/sale-server/src/main/resources/mapper/SaleMapper.xml

@@ -402,7 +402,7 @@
     and purchasedetail.companyid= #{companyid}
   </select>
   <select id="checkCustomer" parameterType="long" resultType="integer">
-    select count(1) from sale left join  customer on sa_custid=cu_id  where  cu_statuscode='CLOSE' and cu_statuscode='CLOSE'
+    select count(1) from sale left join  customer on sa_custid=cu_id  where  cu_statuscode='CLOSE' and sa_id=#{id}
   </select>
   
   <!-- 销售订单转采购单-->

+ 1 - 1
applications/storage/storage-server/src/main/resources/mapper/ProdInOutMapper.xml

@@ -403,7 +403,7 @@
     select count(1) from prodinout where pi_inoutno = #{pi_inoutno} and companyid = #{companyId}
   </select>
   <select id="validateCodeWhenUpdate" resultType="int" >
-    select count(1) from prodinout where pi_inoutno = #{pi_inoutno} and pi_id != #{id} and companyid != #{companyId}
+    select count(1) from prodinout where pi_inoutno = #{pi_inoutno} and pi_id != #{id} and companyid = #{companyId}
   </select>
 
   <select id="selectCodeById" resultType="string" parameterType="long">

+ 5 - 3
frontend/saas-web/app/view/core/query/QueryGridPanel.js

@@ -282,9 +282,11 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
             }
             if(c.xtype == 'datecolumn') {
                 Ext.applyIf(c, {
-                    exportStyle: {
-                        format: 'Medium Date'
-                    },
+                    format:'Y-m-d',
+                    //只导出年月日
+                    // exportStyle: {
+                    //     format: 'Medium Date'
+                    // },
                     exportRenderer: function (value) {
                         return Ext.Date.format(new Date(value), 'Y-m-d');
                     }