Ver código fonte

Merge branch 'master' of http://47.100.37.243:10080/ZHOU/yunsu

# Conflicts:
#	cloud-model/src/main/java/com/hssx/cloudmodel/service/impl/MouldFileServiceImpl.java
5 anos atrás
pai
commit
615186101d

+ 8 - 4
cloud-model/src/main/java/com/hssx/cloudmodel/service/impl/CompanyServiceImpl.java

@@ -69,7 +69,7 @@ public class CompanyServiceImpl extends ServiceImpl<CompanyMapper, Company> impl
                     //资产方直接添加
                     BeanUtils.copyProperties(companyVO, company);
                     companyMapper.insert(company);
-                    if (companyIds != null) {
+                    if (companyIds != null && !"".equals(companyIds)) {
                         List<Integer> ides = ListUtil.convertIntegerIdsArrayToList(companyIds);
                         for (Integer ide : ides) {
                             if (assetCustomCompanyMapper.selectCount(new QueryWrapper<AssetCustomCompany>().eq("assert_id", company.getId()).eq("custom_id", ide)) == 0) {
@@ -84,7 +84,7 @@ public class CompanyServiceImpl extends ServiceImpl<CompanyMapper, Company> impl
                     //生产方
                     BeanUtils.copyProperties(companyVO, company);
                     companyMapper.insert(company);
-                    if (companyIds != null) {
+                    if (companyIds != null && !"".equals(companyIds)) {
                         List<Integer> ides = ListUtil.convertIntegerIdsArrayToList(companyIds);
                         for (Integer ide : ides) {
                             if (assetCustomCompanyMapper.selectCount(new QueryWrapper<AssetCustomCompany>().eq("assert_id", ide).eq("custom_id", company.getId())) == 0) {
@@ -121,7 +121,9 @@ public class CompanyServiceImpl extends ServiceImpl<CompanyMapper, Company> impl
                     msg.setError("当前公司所生产方公司已被用用到项目,不可执行修改操作。");
                     return msg;
                 }
-                if (companyIds != null) {
+                //删除之前的关联公司
+                assetCustomCompanyMapper.delete(new QueryWrapper<AssetCustomCompany>().eq("assert_id",companyVO.getId()));
+                if (companyIds != null && !"".equals(companyIds)) {
                     List<Integer> ides = ListUtil.convertIntegerIdsArrayToList(companyIds);
                     for (Integer ide : ides) {
                         if (assetCustomCompanyMapper.selectCount(new QueryWrapper<AssetCustomCompany>().eq("assert_id", company.getId()).eq("custom_id", ide)) == 0) {
@@ -158,7 +160,9 @@ public class CompanyServiceImpl extends ServiceImpl<CompanyMapper, Company> impl
                     msg.setError("当前公司已和所关联的资产方合作相关项目,不可执行修改操作。");
                     return msg;
                 }
-                if (companyIds != null) {
+                //删除之前的关联公司
+                assetCustomCompanyMapper.delete(new QueryWrapper<AssetCustomCompany>().eq("custom_id",companyVO.getId()));
+                if (companyIds != null && !"".equals(companyIds)) {
                     List<Integer> ides = ListUtil.convertIntegerIdsArrayToList(companyIds);
                     for (Integer ide : ides) {
                         if (assetCustomCompanyMapper.selectCount(new QueryWrapper<AssetCustomCompany>().eq("assert_id", company.getId()).eq("custom_id", ide)) == 0) {

+ 3 - 2
cloud-model/src/main/java/com/hssx/cloudmodel/service/impl/MouldFileServiceImpl.java

@@ -230,6 +230,9 @@ public class MouldFileServiceImpl extends ServiceImpl<MouldFileMapper, MouldFile
                     mf.setState(-1);
                 }
                 mouldFileMapper.updateById(mf);
+                //添加审批记录
+                MouldOperationDynamics dynamics = new MouldOperationDynamics();
+                dynamics.setMouldId(oldData.getId());
             } else if (user.getSubordinateType() == 1) {
                 //生产方
                 if (isPass == 1) {
@@ -252,8 +255,6 @@ public class MouldFileServiceImpl extends ServiceImpl<MouldFileMapper, MouldFile
             } else {
                 msg.setError("只有生产方和资产方才能审核, subordinteType = " + user.getSubordinateType() + ", 无效!");
             }
-
-
         }
         return msg;
     }