| | |
| | | import com.gk.hotwork.Domain.Exception.BusinessException; |
| | | import com.gk.hotwork.Domain.Utils.StringUtils; |
| | | import com.gk.hotwork.Mapper.*; |
| | | import com.gk.hotwork.Service.CompanyService; |
| | | import com.gk.hotwork.Service.SafetySelfInspectionService; |
| | | import com.gk.hotwork.Service.UserService; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | private SafetySelfInspectionItemDeductionMapper safetySelfInspectionItemDeductionMapper; |
| | | @Autowired |
| | | private SafetyInspectionItemDeductionMapper safetyInspectionItemDeductionMapper; |
| | | @Autowired |
| | | private CompanyService companyService; |
| | | /** |
| | | * @Description: 分页 |
| | | */ |
| | | @Override |
| | | public IPage<SafetySelfInspection> selectPage(Page<SafetySelfInspection> page, Map<String, Object> filter, UserInfo user) { |
| | | Integer type = user.getType(); |
| | | if (!type.equals(1) || !type.equals(2)) { |
| | | //普通用户 |
| | | if (type.equals(3)) { |
| | | Long companyid = user.getCompanyid(); |
| | | filter.put("companyid",companyid); |
| | | } |
| | | //监管用户 |
| | | if (type.equals(2)) { |
| | | Long companyid = user.getCompanyid(); |
| | | //获取企业信息 |
| | | CompanyInfo companyInfo = companyService.getById(companyid); |
| | | filter.put("province",companyInfo.getProvince()); |
| | | filter.put("city",companyInfo.getCity()); |
| | | filter.put("area",companyInfo.getArea()); |
| | | } |
| | | |
| | | IPage<SafetySelfInspection> res = safetySelfInspectionMapper.selectPages(page, filter); |
| | | List<SafetySelfInspection> records = res.getRecords(); |
| | | if (CollectionUtils.isNotEmpty(records)){ |
| | |
| | | * @Description: 新增 |
| | | */ |
| | | @Override |
| | | @Transactional |
| | | public void addOne(SafetySelfInspection param, UserInfo user) { |
| | | requiredVerification(param); |
| | | |