Commit df5b8652 authored by suhuiguang's avatar suhuiguang

feat(jyjc):检验检测业务管理初始代码

1.初始代码提交
parent 326d9b28
...@@ -16,6 +16,7 @@ import com.yeejoin.amos.boot.module.jyjc.api.model.JyjcBizManageModel; ...@@ -16,6 +16,7 @@ import com.yeejoin.amos.boot.module.jyjc.api.model.JyjcBizManageModel;
import com.yeejoin.amos.boot.module.jyjc.api.model.JyjcOpeningApplicationModel; import com.yeejoin.amos.boot.module.jyjc.api.model.JyjcOpeningApplicationModel;
import com.yeejoin.amos.boot.module.ymt.api.entity.BaseUnitLicence; import com.yeejoin.amos.boot.module.ymt.api.entity.BaseUnitLicence;
import com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum; import com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum;
import com.yeejoin.amos.boot.module.ymt.api.mapper.BaseUnitLicenceMapper;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
...@@ -25,6 +26,7 @@ import org.springframework.stereotype.Service; ...@@ -25,6 +26,7 @@ import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity; import org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest; import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import java.util.ArrayList;
import java.util.HashSet; import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
...@@ -42,8 +44,12 @@ public class JyjcBizManageServiceImpl { ...@@ -42,8 +44,12 @@ public class JyjcBizManageServiceImpl {
private final JyjcOpeningApplicationServiceImpl openingApplicationService; private final JyjcOpeningApplicationServiceImpl openingApplicationService;
private final JyjcInspectionHistoryServiceImpl inspectionHistoryService;
private final RedissonClient redissonClient; private final RedissonClient redissonClient;
private final BaseUnitLicenceMapper baseUnitLicenceMapper;
public IPage<?> pageList(Page<JyjcBizManageModel> page, CompanyBo company, JyjcOpeningApplicationModel model) { public IPage<?> pageList(Page<JyjcBizManageModel> page, CompanyBo company, JyjcOpeningApplicationModel model) {
Page<JyjcOpeningApplication> pageApp = new Page<>(page.getCurrent(), page.getSize()); Page<JyjcOpeningApplication> pageApp = new Page<>(page.getCurrent(), page.getSize());
LambdaQueryWrapper<JyjcOpeningApplication> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<JyjcOpeningApplication> queryWrapper = new LambdaQueryWrapper<>();
...@@ -149,17 +155,34 @@ public class JyjcBizManageServiceImpl { ...@@ -149,17 +155,34 @@ public class JyjcBizManageServiceImpl {
} }
public Boolean licenceEdit(String appSeq, List<BaseUnitLicence> licences) { public Boolean licenceEdit(String appSeq, List<BaseUnitLicence> licences) {
JyjcOpeningApplication openingApplication = openingApplicationService.getById(appSeq);
// openingApplications.forEach(jyjcOpeningApplication -> { if (!openingApplication.getStatus().equals(FlowStatusEnum.TO_BE_FINISHED.getName())) {
// JyjcInspectionHistory history = inspectionHistoryService.getBySSeq(jyjcOpeningApplication.getSequenceNbr()); throw new BadRequest("开通状态已经变化,请刷新后重试!");
// if (history != null) { }
// JSONObject hisData = history.getHistoryData(); licences.forEach(licence -> {
// List<BaseEnterpriseCertDto> certDtos = hisData.getJSONArray(BizCommonConstant.UNIT_LICENCE_KEY).toJavaList(BaseEnterpriseCertDto.class); LambdaUpdateWrapper<BaseUnitLicence> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(com.yeejoin.amos.boot.biz.common.entity.BaseEntity::getSequenceNbr, licence.getSequenceNbr());
updateWrapper.set(BaseUnitLicence::getLicenceState, licence.getLicenceState());
baseUnitLicenceMapper.update(null, updateWrapper);
});
return Boolean.TRUE; return Boolean.TRUE;
} }
public List<BaseUnitLicence> licenceDetail(String appSeq) { public List<BaseUnitLicence> licenceDetail(String appSeq) {
return null; List<BaseUnitLicence> baseUnitLicences = new ArrayList<>();
JyjcOpeningApplication openingApplication = openingApplicationService.getById(appSeq);
JyjcInspectionHistory history = inspectionHistoryService.getBySSeq(appSeq);
if (history != null) {
JSONObject hisData = history.getHistoryData();
List<BaseEnterpriseCertDto> certDtos = hisData.getJSONArray(BizCommonConstant.UNIT_LICENCE_KEY).toJavaList(BaseEnterpriseCertDto.class);
certDtos.forEach(certDto -> {
List<Long> certSeqList = openingApplicationService.getCertFromHisData(openingApplication, certDto);
if (!certSeqList.isEmpty()) {
List<BaseUnitLicence> baseUnitLicenceOne = baseUnitLicenceMapper.selectList(new LambdaQueryWrapper<BaseUnitLicence>().in(BaseUnitLicence::getEnterpriseCertSeq, certSeqList));
baseUnitLicences.addAll(baseUnitLicenceOne);
}
});
}
return baseUnitLicences;
} }
} }
...@@ -24,6 +24,10 @@ public class JyjcInspectionHistoryServiceImpl extends BaseService<JyjcInspection ...@@ -24,6 +24,10 @@ public class JyjcInspectionHistoryServiceImpl extends BaseService<JyjcInspection
return this.getOne(new LambdaQueryWrapper<JyjcInspectionHistory>().eq(JyjcInspectionHistory::getSSeq, sSeq)); return this.getOne(new LambdaQueryWrapper<JyjcInspectionHistory>().eq(JyjcInspectionHistory::getSSeq, sSeq));
} }
public JyjcInspectionHistory getBySSeq(String sSeq) {
return this.getOne(new LambdaQueryWrapper<JyjcInspectionHistory>().eq(JyjcInspectionHistory::getSSeq, sSeq));
}
public void saveBySeq(Long sSeq, JSONObject hisData, String sType) { public void saveBySeq(Long sSeq, JSONObject hisData, String sType) {
JyjcInspectionHistory history = this.getBySSeq(sSeq); JyjcInspectionHistory history = this.getBySSeq(sSeq);
if (history != null) { if (history != null) {
......
...@@ -306,6 +306,7 @@ ...@@ -306,6 +306,7 @@
</if> </if>
<if test="city != null and city != ''"> <if test="city != null and city != ''">
and tjoa.detection_region like concat('%',#{city},'%') and tjoa.detection_region like concat('%',#{city},'%')
and (tjoa.exclusion_region IS NULL or not (tjoa.exclusion_region like concat('%',#{city},'%')))
</if> </if>
group by info.sequence_nbr group by info.sequence_nbr
</select> </select>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment