|
@@ -44,7 +44,7 @@ import java.util.stream.Collectors;
|
|
|
|
|
|
import static com.dayou.common.Constants.*;
|
|
import static com.dayou.common.Constants.*;
|
|
import static com.dayou.enums.CertificateEnum.*;
|
|
import static com.dayou.enums.CertificateEnum.*;
|
|
-import static com.dayou.enums.ProductionEnum.STATEMENT;
|
|
|
|
|
|
+import static com.dayou.enums.ProductionEnum.*;
|
|
|
|
|
|
/**
|
|
/**
|
|
* <p>
|
|
* <p>
|
|
@@ -152,15 +152,15 @@ public class PersonalProductionServiceImpl extends ServiceImpl<PersonalProductio
|
|
textMap.put("rightsType",calculate.getRightsType());
|
|
textMap.put("rightsType",calculate.getRightsType());
|
|
if (tag == 1){
|
|
if (tag == 1){
|
|
NameUrlDTO statementPath = genStatement(orderId,target,textMap,certificateEnum);
|
|
NameUrlDTO statementPath = genStatement(orderId,target,textMap,certificateEnum);
|
|
- return createPro(target.getId(),statementPath,tag);
|
|
|
|
|
|
+ return createPro(target.getId(),statementPath,tag,true);
|
|
}
|
|
}
|
|
if (tag == 2){
|
|
if (tag == 2){
|
|
NameUrlDTO technicPath = genTechnic(orderId,target,textMap,calculate,certificateEnum);
|
|
NameUrlDTO technicPath = genTechnic(orderId,target,textMap,calculate,certificateEnum);
|
|
- return createPro(target.getId(),technicPath,tag);
|
|
|
|
|
|
+ return createPro(target.getId(),technicPath,tag,true);
|
|
}
|
|
}
|
|
if (tag == 3){
|
|
if (tag == 3){
|
|
NameUrlDTO finalPath = genFinal(orderId,target,textMap,certificateEnum);
|
|
NameUrlDTO finalPath = genFinal(orderId,target,textMap,certificateEnum);
|
|
- return createPro(target.getId(),finalPath,tag);
|
|
|
|
|
|
+ return createPro(target.getId(),finalPath,tag,true);
|
|
}
|
|
}
|
|
|
|
|
|
return Boolean.FALSE;
|
|
return Boolean.FALSE;
|
|
@@ -352,7 +352,7 @@ public class PersonalProductionServiceImpl extends ServiceImpl<PersonalProductio
|
|
String url = dfsConfig.getDomain() + upload;
|
|
String url = dfsConfig.getDomain() + upload;
|
|
nameUrlDTO.setName(originalFilename);
|
|
nameUrlDTO.setName(originalFilename);
|
|
nameUrlDTO.setUrl(url);
|
|
nameUrlDTO.setUrl(url);
|
|
- return createPro(targetId,nameUrlDTO,tag);
|
|
|
|
|
|
+ return createPro(targetId,nameUrlDTO,tag,false);
|
|
} catch (InvalidExtensionException e) {
|
|
} catch (InvalidExtensionException e) {
|
|
throw new RuntimeException(e);
|
|
throw new RuntimeException(e);
|
|
} catch (IOException e) {
|
|
} catch (IOException e) {
|
|
@@ -371,9 +371,35 @@ public class PersonalProductionServiceImpl extends ServiceImpl<PersonalProductio
|
|
Long targetId = production.getTargetId();
|
|
Long targetId = production.getTargetId();
|
|
String type = production.getProduction();
|
|
String type = production.getProduction();
|
|
if (STATEMENT.name().equals(type)){
|
|
if (STATEMENT.name().equals(type)){
|
|
|
|
+ PersonalProduction pp = this.getOne(new LambdaQueryWrapper<PersonalProduction>().eq(PersonalProduction::getProduction, type)
|
|
|
|
+ .eq(PersonalProduction::getTargetId, targetId).eq(BaseEntity::getDeleted, Boolean.FALSE));
|
|
|
|
+ if (pp==null){
|
|
|
|
+ createPro(targetId,null,1,false);
|
|
|
|
+ }
|
|
|
|
+ return this.update(new LambdaUpdateWrapper<PersonalProduction>().eq(PersonalProduction::getProduction,type)
|
|
|
|
+ .eq(PersonalProduction::getTargetId,targetId).set(PersonalProduction::getCheckState, ReportStatus.已审核));
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ else if(LETTER.name().equals(type)){
|
|
|
|
+ PersonalProduction pp = this.getOne(new LambdaQueryWrapper<PersonalProduction>().eq(PersonalProduction::getProduction, type)
|
|
|
|
+ .eq(PersonalProduction::getTargetId, targetId).eq(BaseEntity::getDeleted, Boolean.FALSE));
|
|
|
|
+ if (pp==null){
|
|
|
|
+ createPro(targetId,null,4,false);
|
|
|
|
+ }
|
|
return this.update(new LambdaUpdateWrapper<PersonalProduction>().eq(PersonalProduction::getProduction,type)
|
|
return this.update(new LambdaUpdateWrapper<PersonalProduction>().eq(PersonalProduction::getProduction,type)
|
|
.eq(PersonalProduction::getTargetId,targetId).set(PersonalProduction::getCheckState, ReportStatus.已审核));
|
|
.eq(PersonalProduction::getTargetId,targetId).set(PersonalProduction::getCheckState, ReportStatus.已审核));
|
|
- }else{
|
|
|
|
|
|
+ }
|
|
|
|
+ else{
|
|
|
|
+ PersonalProduction pp1 = this.getOne(new LambdaQueryWrapper<PersonalProduction>().eq(PersonalProduction::getProduction, FINAL.name())
|
|
|
|
+ .eq(PersonalProduction::getTargetId, targetId).eq(BaseEntity::getDeleted, Boolean.FALSE));
|
|
|
|
+ PersonalProduction pp2 = this.getOne(new LambdaQueryWrapper<PersonalProduction>().eq(PersonalProduction::getProduction, TECHNIC.name())
|
|
|
|
+ .eq(PersonalProduction::getTargetId, targetId).eq(BaseEntity::getDeleted, Boolean.FALSE));
|
|
|
|
+ if (pp1==null){
|
|
|
|
+ createPro(targetId,null,3,false);
|
|
|
|
+ }
|
|
|
|
+ if (pp2==null){
|
|
|
|
+ createPro(targetId,null,2,false);
|
|
|
|
+ }
|
|
return this.update(new LambdaUpdateWrapper<PersonalProduction>().ne(PersonalProduction::getProduction,STATEMENT.name())
|
|
return this.update(new LambdaUpdateWrapper<PersonalProduction>().ne(PersonalProduction::getProduction,STATEMENT.name())
|
|
.eq(PersonalProduction::getTargetId,targetId).set(PersonalProduction::getCheckState, ReportStatus.已审核));
|
|
.eq(PersonalProduction::getTargetId,targetId).set(PersonalProduction::getCheckState, ReportStatus.已审核));
|
|
}
|
|
}
|
|
@@ -485,7 +511,7 @@ public class PersonalProductionServiceImpl extends ServiceImpl<PersonalProductio
|
|
* @param tag
|
|
* @param tag
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
- private Boolean createPro(Long targetId,NameUrlDTO nameUrlDTO,Integer tag){
|
|
|
|
|
|
+ private Boolean createPro(Long targetId,NameUrlDTO nameUrlDTO,Integer tag,Boolean isOnline){
|
|
PersonalProduction pp = null;
|
|
PersonalProduction pp = null;
|
|
String productionType = null;
|
|
String productionType = null;
|
|
if (tag ==1){
|
|
if (tag ==1){
|
|
@@ -506,12 +532,17 @@ public class PersonalProductionServiceImpl extends ServiceImpl<PersonalProductio
|
|
if (pp==null){
|
|
if (pp==null){
|
|
PersonalProduction personalProduction = new PersonalProduction();
|
|
PersonalProduction personalProduction = new PersonalProduction();
|
|
personalProduction.setTargetId(targetId);
|
|
personalProduction.setTargetId(targetId);
|
|
- personalProduction.setFilePath(JSON.toJSONString(nameUrlDTO));
|
|
|
|
|
|
+ if (nameUrlDTO!=null){
|
|
|
|
+ personalProduction.setFilePath(JSON.toJSONString(nameUrlDTO));
|
|
|
|
+ }
|
|
personalProduction.setProduction(productionType);
|
|
personalProduction.setProduction(productionType);
|
|
personalProduction.setUserId(LoginContext.getCurrentUserId());
|
|
personalProduction.setUserId(LoginContext.getCurrentUserId());
|
|
|
|
+ personalProduction.setIsOnline(isOnline);
|
|
return this.add(personalProduction);
|
|
return this.add(personalProduction);
|
|
}else {
|
|
}else {
|
|
- pp.setFilePath(JSON.toJSONString(nameUrlDTO));
|
|
|
|
|
|
+ if (nameUrlDTO!=null){
|
|
|
|
+ pp.setFilePath(JSON.toJSONString(nameUrlDTO));
|
|
|
|
+ }
|
|
pp.setModified(DateUtils.getNowDate());
|
|
pp.setModified(DateUtils.getNowDate());
|
|
return this.update(pp);
|
|
return this.update(pp);
|
|
}
|
|
}
|