Commit aef757f2 authored by chenzhao's avatar chenzhao

合同省份增加

parent 4fdb1e06
...@@ -263,4 +263,6 @@ public class HouseholdContract extends BaseEntity { ...@@ -263,4 +263,6 @@ public class HouseholdContract extends BaseEntity {
@TableField(exist = false) @TableField(exist = false)
private String realScale; private String realScale;
@TableField(exist = false)
private String province;
} }
...@@ -162,4 +162,6 @@ public class WorkOrder extends BaseEntity { ...@@ -162,4 +162,6 @@ public class WorkOrder extends BaseEntity {
int current; int current;
@TableField(exist = false) @TableField(exist = false)
int size; int size;
@TableField(exist = false)
private String ownersName;
} }
...@@ -10,8 +10,8 @@ ...@@ -10,8 +10,8 @@
END FROM hygf_household_contract AS hhc END FROM hygf_household_contract AS hhc
WHERE WHERE
hhc.peasant_household_id = hygf_household_contract.peasant_household_id hhc.peasant_household_id = hygf_household_contract.peasant_household_id
) AS isAllDisuse ) AS isAllDisuse,
SUBSTRING_INDEX(php.project_address_name, '/', 1) AS province
from hygf_household_contract from hygf_household_contract
LEFT JOIN hygf_peasant_household php ON php.sequence_nbr = hygf_household_contract.peasant_household_id LEFT JOIN hygf_peasant_household php ON php.sequence_nbr = hygf_household_contract.peasant_household_id
<where> <where>
......
...@@ -12,8 +12,17 @@ ...@@ -12,8 +12,17 @@
and hygf_work_order_power_station.power_station_construction_status in ('待登记','未通过','已完工','待审核') and hygf_work_order_power_station.power_station_construction_status in ('待登记','未通过','已完工','待审核')
) peasantHouseholdSgNum ) peasantHouseholdSgNum,
(
SELECT
GROUP_CONCAT( owners_name ORDER BY owners_name ASC SEPARATOR ', ' ) AS ownersName
FROM
hygf_work_order_power_station ps
LEFT JOIN hygf_peasant_household ph ON ps.peasant_household_id = ph.sequence_nbr
WHERE
ps.work_order_id = hygf_work_order.sequence_nbr
) as ownersName
FROM hygf_work_order FROM hygf_work_order
WHERE hygf_work_order.is_delete=0 WHERE hygf_work_order.is_delete=0
<if test="dto.workOrderNum!=null and dto.workOrderNum!=''"> <if test="dto.workOrderNum!=null and dto.workOrderNum!=''">
...@@ -31,6 +40,9 @@ ...@@ -31,6 +40,9 @@
<if test="dto.regionCompanyId!=null and dto.regionCompanyId!=''"> <if test="dto.regionCompanyId!=null and dto.regionCompanyId!=''">
and hygf_work_order.region_company_id =#{dto.regionCompanyId} and hygf_work_order.region_company_id =#{dto.regionCompanyId}
</if> </if>
<if test="dto.dto.ownersName!=null and dto.dto.ownersName!=''">
and ownersName like concat ('%',#{dto.ownersName},'%')
</if>
ORDER BY ORDER BY
hygf_work_order.rec_date DESC, hygf_work_order.rec_date DESC,
......
...@@ -516,6 +516,15 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W ...@@ -516,6 +516,15 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W
public Page<WorkOrder> selectPage(int pageNum, int pageSize, WorkOrder workOrder) { public Page<WorkOrder> selectPage(int pageNum, int pageSize, WorkOrder workOrder) {
PageHelper.startPage(pageNum, pageSize); PageHelper.startPage(pageNum, pageSize);
List<WorkOrder> list = workOrderMapper.selectWorkOrderList(workOrder); List<WorkOrder> list = workOrderMapper.selectWorkOrderList(workOrder);
list.stream().forEach(e->{
if (!e.getOwnersName().isEmpty()) {
if (e.getOwnersName().split(",").length > 3){
e.setOwnersName(String.join(",", Arrays.copyOfRange(e.getOwnersName().split(","), 0, 3)));
}
}
});
PageInfo<WorkOrder> page = new PageInfo(list); PageInfo<WorkOrder> page = new PageInfo(list);
Page<WorkOrder> pagenew = new Page<WorkOrder>(); Page<WorkOrder> pagenew = new Page<WorkOrder>();
pagenew.setCurrent(pageNum); pagenew.setCurrent(pageNum);
......
...@@ -257,8 +257,8 @@ public class PrivilegeController extends BaseController { ...@@ -257,8 +257,8 @@ public class PrivilegeController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@GetMapping(value = "/getAreaCompany") @GetMapping(value = "/getAreaCompany")
@ApiOperation(httpMethod = "GET", value = "查询所有区域公司", notes = "查询所有区域公司") @ApiOperation(httpMethod = "GET", value = "查询所有区域公司", notes = "查询所有区域公司")
public ResponseModel<List<PrivilegeCompany>> getAreaCompany(String type) { public ResponseModel<List<PrivilegeCompany>> getAreaCompany(String type,@RequestParam(required = false) String province) {
return ResponseHelper.buildResponse(permissionService.getAreaCompany(type)); return ResponseHelper.buildResponse(permissionService.getAreaCompany(type,province));
} }
} }
...@@ -10,6 +10,7 @@ import java.util.stream.Collectors; ...@@ -10,6 +10,7 @@ import java.util.stream.Collectors;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import org.typroject.tyboot.core.foundation.context.RequestContext; import org.typroject.tyboot.core.foundation.context.RequestContext;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
...@@ -188,7 +189,7 @@ public class IPermissionServiceImpl implements IPermissionService { ...@@ -188,7 +189,7 @@ public class IPermissionServiceImpl implements IPermissionService {
public List<PrivilegeCompany> getAreaCompany(String type){ public List<PrivilegeCompany> getAreaCompany(String type,String province){
List<PrivilegeCompany> areaCompany = privilegeCompanyMapper.getAreaCompany(); List<PrivilegeCompany> areaCompany = privilegeCompanyMapper.getAreaCompany();
//outer_company 外部公司 当前特殊区域公司标记为 级别为 外部公司来区分 //outer_company 外部公司 当前特殊区域公司标记为 级别为 外部公司来区分
...@@ -202,7 +203,9 @@ public class IPermissionServiceImpl implements IPermissionService { ...@@ -202,7 +203,9 @@ public class IPermissionServiceImpl implements IPermissionService {
// all.setSequenceNbr(0L); // all.setSequenceNbr(0L);
// areaCompany.add(0,all); // areaCompany.add(0,all);
} }
if (!StringUtils.isEmpty(province)){
areaCompany= areaCompany.stream().filter(e -> e.getAddress().contains(province)).collect(Collectors.toList());
}
return areaCompany; return areaCompany;
......
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