Commit 96389b59 authored by suhuiguang's avatar suhuiguang

1.安装告知、使用登记、车用登记分页接口,增加按照不同端显示不同数据,审批的监管机构按照接收机构过滤、不审批的监管机构按照属地监管部门

parent 402d5d54
......@@ -26,6 +26,7 @@ public interface JgInstallationNoticeMapper extends CustomBaseMapper<JgInstallat
* @param model 查询参数
* @param type 类型:enterprise-企业端、supervision-监管端
* @param orgCode 公司的orgCode
* @param client 使用类型
* @return 安装告知列表
*/
Page<Map<String, Object>> queryForPage(Page<JgInstallationNotice> page,
......@@ -33,7 +34,8 @@ public interface JgInstallationNoticeMapper extends CustomBaseMapper<JgInstallat
@Param("type") String type,
@Param("sort") SortVo sort,
@Param("companyCode") String companyCode,
@Param("orgCode") String orgCode);
@Param("orgCode") String orgCode,
@Param("client") String client);
/**
* 根据安装告知编号查询设备、设计、制造等信息
......
......@@ -29,7 +29,8 @@ public interface JgUseRegistrationMapper extends BaseMapper<JgUseRegistration> {
Page<Map<String, Object>> getListPage(@Param("page") Page<Map<String, Object>> page,
@Param("sort") SortVo sortMap,
@Param("dto") JgUseRegistrationDto dto,
@Param("roleIds") List<String> roleIds);
@Param("roleIds") List<String> roleIds,
@Param("client") String client);
List<RegistrationVo> queryRegistrationInIds(@Param("dto") JgUseRegistrationDto dto);
......
......@@ -26,7 +26,8 @@ public interface JgVehicleInformationMapper extends BaseMapper<JgVehicleInformat
Page<Map<String, Object>> getListPage(@Param("page")Page<Map<String, Object>> page,
@Param("sort") SortVo sortMap,
@Param("dto") JgVehicleInformationDto dto ,
@Param("roleIds") List<String> roleIds);
@Param("roleIds") List<String> roleIds,
@Param("client") String client);
List<VehicleInformationVo> queryVehicleInformationInIds(@Param("ids") List<String> ids);
......
......@@ -39,12 +39,13 @@ public interface IJgInstallationNoticeService extends IService<JgInstallationNot
/**
* 分页查询
*
* @param page 分页对象
* @param model 查询参数
* @param type 类型:enterprise-企业端、supervision-监管端
* @param page 分页对象
* @param model 查询参数
* @param type 类型:enterprise-企业端、supervision-监管端
* @param client 类型:jgAudit-监管审核;jgLook-监管查看
* @return 安装告知列表
*/
Page<Map<String, Object>> queryForJgInstallationNoticePage(Page<JgInstallationNotice> page, JgInstallationNoticeDto model, String type,String sort, ReginParams reginParams);
Page<Map<String, Object>> queryForJgInstallationNoticePage(Page<JgInstallationNotice> page, JgInstallationNoticeDto model, String type, String sort, ReginParams reginParams, String client);
/**
* 批量删除
......
......@@ -75,11 +75,14 @@
</if>
</if>
<if test="type == 'supervision'">
AND (
isn.receive_org_credit_code = #{companyCode}
or isn.transfer_to_user_ids like concat('%',#{param.transferToUserIds},'%')
or isn.org_branch_code like concat(#{orgCode}, '%')
)
<choose>
<when test="client == 'jgAudit'">
AND ( isn.receive_org_credit_code = #{companyCode} or isn.transfer_to_user_ids like concat('%',#{param.transferToUserIds},'%') )
</when>
<otherwise>
AND isn.org_branch_code like concat(#{orgCode}, '%')
</otherwise>
</choose>
AND isn.instance_id <![CDATA[<>]]> ''
</if>
<if test="type == 'company'">
......
......@@ -184,9 +184,18 @@
AND auditPassDate BETWEEN #{dto.auditPassDateStart} AND #{dto.auditPassDateEnd}
</if>
<if test="dto.dataType == 'supervision' ">
AND (receive_company_code = #{dto.receiveCompanyCode}
OR transfer_to_user_ids LIKE concat ('%',#{dto.currentUserId}, '%')
OR supervision_org_code LIKE concat (#{dto.supervisionOrgCode}, '%'))
<choose>
<when test="client == 'jgAudit'">
AND
(
receive_company_code = #{dto.receiveCompanyCode}
OR transfer_to_user_ids LIKE concat ('%',#{dto.currentUserId}, '%')
)
</when>
<otherwise>
and supervision_org_code LIKE concat (#{dto.supervisionOrgCode}, '%')
</otherwise>
</choose>
AND status <![CDATA[<>]]> '使用单位待提交'
</if>
<if test="dto.dataType == 'company' ">
......
......@@ -36,11 +36,14 @@
and tjvi.use_unit_credit_code = #{dto.useUnitCode}
</if>
<if test="dto.dataType == 'supervision' ">
and
(
tjvi.receive_company_code = #{dto.useUnitCreditCode}
or tjvi.org_branch_code like concat(#{dto.orgBranchCode}, '%')
)
<choose>
<when test="client == 'jgAudit'">
AND tjvi.receive_company_code = #{dto.useUnitCreditCode}
</when>
<otherwise>
and tjvi.org_branch_code like concat(#{dto.orgBranchCode}, '%')
</otherwise>
</choose>
AND tjvi.status <![CDATA[<>]]> '使用单位待提交'
</if>
<if test="dto.dataType == 'company' ">
......
......@@ -136,14 +136,16 @@ public class JgInstallationNoticeController extends BaseController {
@RequestParam(value = "type", defaultValue = "enterprise") String type,
@ApiParam(value = "排序字段", required = false)
@RequestParam(value = "sort", required = false) String sort,
@RequestBody(required = false) JgInstallationNoticeDto model
@RequestBody(required = false) JgInstallationNoticeDto model,
@ApiParam(value = "客户端类型: jgAudit-监管审核;jgLook-监管查看") @RequestParam(value = "client", required = false, defaultValue = "jgAudit") String client
) {
Page<JgInstallationNotice> page = new Page<>(current, size);
ReginParams reginParams = getSelectedOrgInfo();
type = (String) iJgInstallationNoticeService.getCompanyType().get("companyLevel");
return ResponseHelper.buildResponse(iJgInstallationNoticeService.queryForJgInstallationNoticePage(page, model, type, sort, reginParams));
return ResponseHelper.buildResponse(iJgInstallationNoticeService.queryForJgInstallationNoticePage(page, model, type, sort, reginParams, client));
}
/**
* 生成告知单
*/
......
......@@ -104,7 +104,9 @@ public class JgUseRegistrationController extends BaseController {
public ResponseModel<Page<Map<String, Object>>> getList(JgUseRegistrationDto dto,
@ApiParam(value = "排序字段") @RequestParam(value = "sort", required = false) String sort,
@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size) {
@RequestParam(value = "size") int size,
@ApiParam(value = "客户端类型: jgAudit-监管审核;jgLook-监管查看")
@RequestParam(value = "client", required = false, defaultValue = "jgAudit") String client) {
Page<Map<String, Object>> page = new Page<>(current, size);
ReginParams info = getSelectedOrgInfo();
dto.setCurrentUserId(info.getUserModel().getUserId());
......@@ -137,7 +139,7 @@ public class JgUseRegistrationController extends BaseController {
dto.setAuditPassDateStart(start);
dto.setAuditPassDateEnd(end);
}
Page<Map<String, Object>> list = jgUseRegistrationServiceImpl.getList(dto, sort, page, dto.getRoleIds());
Page<Map<String, Object>> list = jgUseRegistrationServiceImpl.getList(dto, sort, page, dto.getRoleIds(), client);
list.getRecords().forEach(x -> {
x.put("companyType", info.getCompany().getCompanyType());
x.put("regType", "1".equals(x.get("regType")) ? "历史登记": "2".equals(x.get("regType")) ? "特殊历史登记": "新增登记");
......
......@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.module.jg.api.entity.JgVehicleInformation;
import com.yeejoin.amos.boot.module.jg.api.vo.JgVehicleInformationVo;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api;
......@@ -128,7 +129,8 @@ public class JgVehicleInformationController extends BaseController {
public ResponseModel<Page<Map<String, Object>>> getPageList(JgVehicleInformationDto dto,
@RequestParam(value = "sort", required = false) String sort,
@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size) {
@RequestParam(value = "size") int size,
@ApiParam(value = "客户端类型: jgAudit-监管审核;jgLook-监管查看") @RequestParam(value = "client", required = false, defaultValue = "jgAudit") String client) {
Page<Map<String, Object>> page = new Page<>(current, size);
ReginParams info = getSelectedOrgInfo();
String companyCode = info.getCompany().getCompanyCode();
......@@ -144,7 +146,7 @@ public class JgVehicleInformationController extends BaseController {
dto.setDataType(BaseController.COMPANY_TYPE_SUPERVISION);
dto.setOrgBranchCode(info.getCompany().getOrgCode());
}
Page<Map<String, Object>> list = jgVehicleInformationServiceImpl.getPageList(dto,sort, page, dto.getRoleIds());
Page<Map<String, Object>> list = jgVehicleInformationServiceImpl.getPageList(dto,sort, page, dto.getRoleIds(), client);
list.getRecords().forEach(x -> {
x.put("companyType", info.getCompany().getCompanyType());
x.put("regTypeDesc", "1".equals(x.get("regType")) ? "历史登记" : "新增登记");
......
......@@ -552,9 +552,10 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
/**
* 分页查询
*
* @param page 分页对象
* @param model 查询参数
* @param type 类型:enterprise-企业端、supervision-监管端
* @param page 分页对象
* @param model 查询参数
* @param type 类型:enterprise-企业端、supervision-监管端
* @param client 类型:jgAudit-监管审核;jgLook-监管查看
* @return 安装告知列表
*/
@Override
......@@ -562,13 +563,13 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
JgInstallationNoticeDto model,
String type,
String sort,
ReginParams reginParams) {
ReginParams reginParams, String client) {
String companyCode = reginParams.getCompany().getCompanyCode();
SortVo sortMap = commonService.sortFieldConversion(sort);
model.setTransferToUserIds(reginParams.getUserModel().getUserId());
String orgCode = reginParams.getCompany().getOrgCode();
Page<Map<String, Object>> noticePage = jgInstallationNoticeMapper.queryForPage(page, model, type, sortMap, companyCode, orgCode);
Page<Map<String, Object>> noticePage = jgInstallationNoticeMapper.queryForPage(page, model, type, sortMap, companyCode, orgCode, client);
List<Map<String, Object>> mappedRecords = noticePage.getRecords().stream().peek(notice -> {
Optional<Long> noticeStatusOpt = Optional.ofNullable((String) notice.get("noticeStatus")).map(Long::valueOf);
noticeStatusOpt.ifPresent(status -> {
......
......@@ -296,9 +296,9 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
return date.format(outputFormatter);
}
public Page<Map<String, Object>> getList(JgUseRegistrationDto dto, String sort, Page<Map<String, Object>> page, List<String> roleIds) {
public Page<Map<String, Object>> getList(JgUseRegistrationDto dto, String sort, Page<Map<String, Object>> page, List<String> roleIds, String client) {
SortVo sortMap = commonServiceImpl.sortFieldConversionNoToUnderline(sort);
return this.baseMapper.getListPage(page, sortMap, dto, roleIds);
return this.baseMapper.getListPage(page, sortMap, dto, roleIds, client);
}
public Page<Map<String, Object>> getEquipList(Page<Map<String, Object>> page, String factoryNum, String equList, String equCategory) {
......
......@@ -1015,9 +1015,9 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
});
}
public Page<Map<String, Object>> getPageList(JgVehicleInformationDto dto, String sort, Page<Map<String, Object>> page, List<String> roleIds) {
public Page<Map<String, Object>> getPageList(JgVehicleInformationDto dto, String sort, Page<Map<String, Object>> page, List<String> roleIds, String client) {
SortVo sortMap = commonService.sortFieldConversion(sort);
return this.baseMapper.getListPage(page, sortMap, dto, roleIds);
return this.baseMapper.getListPage(page, sortMap, dto, roleIds, client);
}
private void updateEquipMessage(JgVehicleInformation jgVehicleInformation, JSONObject map, IdxBizJgRegisterInfo registerInfo, IdxBizJgOtherInfo otherInfo) {
......
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