nidapeng
2024-03-29 55fbb9724c8f69f3516ac293c4dfa67e2a1d9620
提交一把
已修改3个文件
54 ■■■■ 文件已修改
server/service/src/main/java/com/doumee/dao/business/model/Solutions.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/service/business/impl/InsuranceApplyServiceImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/service/business/impl/SolutionsServiceImpl.java 47 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/dao/business/model/Solutions.java
@@ -177,5 +177,8 @@
    @ApiModelProperty(value = "委托商户名称", example = "1")
    @TableField(exist = false)
    private String shopName;
    @ApiModelProperty(value = "方案确认书对象", example = "1")
    @TableField(exist = false)
    private Multifile fanganFile;
}
server/service/src/main/java/com/doumee/service/business/impl/InsuranceApplyServiceImpl.java
@@ -2194,7 +2194,7 @@
                .selectAll(InsuranceApply.class)
                .selectAs(Solutions::getSignKeyword,InsuranceApply::getSignKeyword)
                .leftJoin(Solutions.class,Solutions::getId,InsuranceApply::getSolutionId)
                .eq(InsuranceApply::getId,smsCheckDTO.getCode())
                .eq(InsuranceApply::getId,smsCheckDTO.getBusinessId())
                .last("limit 1");
        InsuranceApply model = insuranceApplyJoinMapper.selectJoinOne(InsuranceApply.class,wrapper);
@@ -2205,7 +2205,7 @@
        if(Objects.isNull(solutions)){
            throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"未查询方案信息");
        }
        if(solutions.getType().equals(Constants.ZERO)){
        if(Constants.equalsInteger(solutions.getType(),(Constants.ZERO))){
            throw  new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,非委托保方案保单!");
        }
        LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal();
server/service/src/main/java/com/doumee/service/business/impl/SolutionsServiceImpl.java
@@ -27,10 +27,7 @@
import org.springframework.util.CollectionUtils;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Objects;
import java.util.UUID;
import java.util.*;
/**
 * 保险方案信息表Service实现
@@ -40,6 +37,8 @@
@Service
public class SolutionsServiceImpl implements SolutionsService {
    @Autowired
    private MultifileMapper multifileMapper;
    @Autowired
    private SolutionsMapper solutionsMapper;
    @Autowired
@@ -87,6 +86,20 @@
        solutionsMapper.insert(newModel);
        dealWorkType(solutions,newModel,solutions.getWorktypeIdList(),true);
        if(Constants.equalsObject(solutions.getType(),Constants.ONE) ){
           if  (solutions.getFanganFile()==null || StringUtils.isBlank(solutions.getFanganFile().getFileurl())){
             throw  new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"请上传方案确认书!");
            }
            Multifile file = solutions.getFanganFile();
            file.setIsdeleted(Constants.ZERO);
            file.setCreateDate(new Date());
            file.setCreator(user.getId());
            file.setObjId(solutions.getId());
            file.setObjType(Constants.MultiFile.SOLUTIONS_CONFIRMATION_LATTER.getKey());
            file.setType(Constants.formatIntegerNum(file.getType()));
            multifileMapper.insert(file);
        }
        return solutions.getId();
    }
@@ -216,7 +229,25 @@
                .lambda()
                .eq(SolutionWorktype::getSolutionId,solutions.getId())
        );
        if(Constants.equalsObject(solutions.getType(),Constants.ONE) ){
            if  (solutions.getFanganFile()!=null && StringUtils.isNotBlank(solutions.getFanganFile().getFileurl())){
                multifileMapper.update(null,new UpdateWrapper<Multifile>().lambda()
                                .set(Multifile::getIsdeleted,Constants.ONE)
                                .set(Multifile::getEditDate,solutions.getEditDate())
                                .set(Multifile::getEditor,solutions.getEditor())
                                .eq(Multifile::getObjId,solutions.getId())
                                .eq(Multifile::getIsdeleted,Constants.ZERO)
                                .eq(Multifile::getObjType,Constants.MultiFile.SOLUTIONS_CONFIRMATION_LATTER.getKey()));
                Multifile file = solutions.getFanganFile();
                file.setIsdeleted(Constants.ZERO);
                file.setCreateDate(solutions.getEditDate());
                file.setCreator(solutions.getEditor());
                file.setObjId(solutions.getId());
                file.setObjType(Constants.MultiFile.SOLUTIONS_CONFIRMATION_LATTER.getKey());
                file.setType(Constants.formatIntegerNum(file.getType()));
                multifileMapper.insert(file);
            }
        }
        solutionsMapper.update(null,new UpdateWrapper<Solutions>()
                .lambda()
@@ -303,6 +334,12 @@
        wrapper.orderByAsc(SolutionWorktype::getSortnum);
        List<SolutionWorktype> worktypeList = solutionWorktypeJoinMapper.selectJoinList(SolutionWorktype.class,wrapper);
        model.setWorktypeList(worktypeList);
        Multifile f = multifileMapper.selectOne(new QueryWrapper<Multifile>().lambda()
                .eq(Multifile::getObjId,model.getId())
                .eq(Multifile::getObjType,Constants.MultiFile.SOLUTIONS_CONFIRMATION_LATTER.getKey())
                .eq(Multifile::getIsdeleted,Constants.ZERO)
                .last("limit 1"));
        model.setFanganFile(f);//方案确认书
        return model;
    }