Commit 33c3acab authored by chenzhao's avatar chenzhao

修改代码

parent d3e7cee5
...@@ -3112,26 +3112,26 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -3112,26 +3112,26 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
if ("gender".equals(dynamicFormInstance.getFieldCode())){ if ("gender".equals(dynamicFormInstance.getFieldCode())){
dynamicFormInstance.setFieldValueLabel("346".equals(String.valueOf(dynamicFormInstance.getFieldValue()))?"男":"女"); dynamicFormInstance.setFieldValueLabel("346".equals(String.valueOf(dynamicFormInstance.getFieldValue()))?"男":"女");
} }
if ("peopleType".equals(dynamicFormInstance.getFieldCode())){ if ("peopleType".equals(dynamicFormInstance.getFieldCode()) && dynamicFormInstance.getFieldValue() != null){
dynamicFormInstance.setFieldValueLabel(dataDictionaryService.getById(dynamicFormInstance.getFieldValue()).getName()); dynamicFormInstance.setFieldValueLabel(dataDictionaryService.getById(dynamicFormInstance.getFieldValue()).getName());
} }
if ("positionType".equals(dynamicFormInstance.getFieldCode())){ if ("positionType".equals(dynamicFormInstance.getFieldCode()) && peopleInfoDto.getFirefighters().getJobTitleCode() != null){
dynamicFormInstance.setFieldValueLabel(dataDictionaryService.getById(peopleInfoDto.getFirefighters().getJobTitleCode()).getName()); dynamicFormInstance.setFieldValueLabel(dataDictionaryService.getById(peopleInfoDto.getFirefighters().getJobTitleCode()).getName());
} }
if ("administrativePositionCode".equals(dynamicFormInstance.getFieldCode())){ if ("administrativePositionCode".equals(dynamicFormInstance.getFieldCode())){
dynamicFormInstance.setFieldValueLabel(dataDictionaryService.getById(map1.get("administrativePositionCode").toString()).getName()); dynamicFormInstance.setFieldValueLabel(dataDictionaryService.getById(map1.get("administrativePositionCode").toString()).getName());
} }
String fieldCode = dynamicFormInstance.getFieldCode(); String fieldCode = dynamicFormInstance.getFieldCode();
if ("auditCycle".equals(dynamicFormInstance.getFieldCode())){ if ("auditCycle".equals(dynamicFormInstance.getFieldCode()) && dynamicFormInstance.getFieldValue() != null){
dynamicFormInstance.setFieldValue(map1.get(fieldCode).toString()); dynamicFormInstance.setFieldValue(map1.get(fieldCode).toString());
dynamicFormInstance.setFieldValueLabel(dataDictionaryService.getById(dynamicFormInstance.getFieldValue()).getName()); dynamicFormInstance.setFieldValueLabel(dataDictionaryService.getById(dynamicFormInstance.getFieldValue()).getName());
} }
if ("certificateType".equals(dynamicFormInstance.getFieldCode())){ if ("certificateType".equals(dynamicFormInstance.getFieldCode())){
dynamicFormInstance.setFieldValue(map1.get(fieldCode).toString()); dynamicFormInstance.setFieldValue(map1.get(fieldCode) == null ? "" :map1.get(fieldCode).toString());
dynamicFormInstance.setFieldValueLabel(map1.get("certificateTypeCode").toString()); dynamicFormInstance.setFieldValueLabel(map1.get("certificateTypeCode") == null ? "":map1.get("certificateTypeCode").toString());
} }
if (map1.containsKey(fieldCode) && fieldCode.contains("Code") ){ if (map1.containsKey(fieldCode) && fieldCode.contains("Code") ){
dynamicFormInstance.setFieldValue(map1.get(fieldCode).toString()); dynamicFormInstance.setFieldValue(map1.get(fieldCode) == null ? "" :map1.get(fieldCode).toString());
} }
if (map1.containsKey(fieldCode.substring(0,fieldCode.length()-4))){ if (map1.containsKey(fieldCode.substring(0,fieldCode.length()-4))){
dynamicFormInstance.setFieldValueLabel(map1.get(fieldCode.substring(0,fieldCode.length()-4)).toString()); dynamicFormInstance.setFieldValueLabel(map1.get(fieldCode.substring(0,fieldCode.length()-4)).toString());
......
...@@ -9,12 +9,7 @@ import java.util.Map; ...@@ -9,12 +9,7 @@ import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
...@@ -203,7 +198,10 @@ public class SafetyPreCtrlController extends AbstractBaseController { ...@@ -203,7 +198,10 @@ public class SafetyPreCtrlController extends AbstractBaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "巡检执行情况查询", notes = "巡检执行情况查询") @ApiOperation(value = "巡检执行情况查询", notes = "巡检执行情况查询")
@RequestMapping(value = "/checkExecute/listNew", produces = "application/json;charset=UTF-8", method = RequestMethod.GET) @RequestMapping(value = "/checkExecute/listNew", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
public HashMap<String, Object> findChkExListNew(@ApiParam(value = "分页参数", required = true) CommonPageable commonPageable) { public HashMap<String, Object> findChkExListNew( @RequestParam(value = "pageSize") int pageSize,@RequestParam(value = "pageNumber") int pageNumber ) {
CommonPageable commonPageable = new CommonPageable();
commonPageable.setPageNumber(pageNumber-1);
commonPageable.setPageSize(pageSize);
ReginParams reginParams = getSelectedOrgInfo(); ReginParams reginParams = getSelectedOrgInfo();
String loginOrgCode =reginParams.getPersonIdentity().getCompanyBizOrgCode(); String loginOrgCode =reginParams.getPersonIdentity().getCompanyBizOrgCode();
HashMap<String, Object> checkChkExListBo= iPlanTaskService.getChkExListNew(loginOrgCode,commonPageable); HashMap<String, Object> checkChkExListBo= iPlanTaskService.getChkExListNew(loginOrgCode,commonPageable);
...@@ -221,7 +219,10 @@ public class SafetyPreCtrlController extends AbstractBaseController { ...@@ -221,7 +219,10 @@ public class SafetyPreCtrlController extends AbstractBaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "风险点查询", notes = "风险点查询") @ApiOperation(value = "风险点查询", notes = "风险点查询")
@RequestMapping(value = "/point/listNew", produces = "application/json;charset=UTF-8", method = RequestMethod.GET) @RequestMapping(value = "/point/listNew", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
public HashMap<String, Object> findPointListNew(@ApiParam(value = "分页参数", required = false) CommonPageable commonPageable) { public HashMap<String, Object> findPointListNew( @RequestParam(value = "pageSize") int pageSize,@RequestParam(value = "pageNumber") int pageNumber ) {
CommonPageable commonPageable = new CommonPageable();
commonPageable.setPageNumber(pageNumber-1);
commonPageable.setPageSize(pageSize);
ReginParams reginParams = getSelectedOrgInfo(); ReginParams reginParams = getSelectedOrgInfo();
String loginOrgCode =reginParams.getPersonIdentity().getCompanyBizOrgCode(); String loginOrgCode =reginParams.getPersonIdentity().getCompanyBizOrgCode();
HashMap<String, Object> checkChkExListBo= pointService.getCheckPtListNew(loginOrgCode,commonPageable); HashMap<String, Object> checkChkExListBo= pointService.getCheckPtListNew(loginOrgCode,commonPageable);
......
...@@ -1353,6 +1353,7 @@ public class PlanTaskServiceImpl implements IPlanTaskService { ...@@ -1353,6 +1353,7 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
CheckPtListPageParam param =new CheckPtListPageParam(); CheckPtListPageParam param =new CheckPtListPageParam();
param.setPageNumber(commonPageable.getPageNumber()); param.setPageNumber(commonPageable.getPageNumber());
param.setPageSize(commonPageable.getPageSize()); param.setPageSize(commonPageable.getPageSize());
param.setOffset((int)commonPageable.getOffset());
param.setOrgCode(orgCode); param.setOrgCode(orgCode);
DateFormat dateFormat = new SimpleDateFormat("yyyyMMdd"); DateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
Date date = new Date(); Date date = new Date();
......
...@@ -1370,10 +1370,11 @@ public class PointServiceImpl implements IPointService { ...@@ -1370,10 +1370,11 @@ public class PointServiceImpl implements IPointService {
public HashMap<String, Object> getCheckPtListNew(String orgCode, CommonPageable commonPageable) { public HashMap<String, Object> getCheckPtListNew(String orgCode, CommonPageable commonPageable) {
CheckPtListPageParam param =new CheckPtListPageParam(); CheckPtListPageParam param =new CheckPtListPageParam();
long total = pointMapper.getCheckPointCountNew(param); long total = pointMapper.getCheckPointCountNew(param);
List<CheckPtListBo> content = pointMapper.getCheckPointListNew(param);
param.setPageNumber(commonPageable.getPageNumber()); param.setPageNumber(commonPageable.getPageNumber());
param.setOffset((int)commonPageable.getOffset());
param.setPageSize(commonPageable.getPageSize()); param.setPageSize(commonPageable.getPageSize());
param.setOrgCode(orgCode); param.setOrgCode(orgCode);
List<CheckPtListBo> content = pointMapper.getCheckPointListNew(param);
Page<CheckPtListBo> result = new PageImpl<CheckPtListBo>(content, param, total); Page<CheckPtListBo> result = new PageImpl<CheckPtListBo>(content, param, total);
List< HashMap<String, Object>> colModel=new ArrayList<>(); List< HashMap<String, Object>> colModel=new ArrayList<>();
......
...@@ -23,6 +23,7 @@ import org.slf4j.LoggerFactory; ...@@ -23,6 +23,7 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
...@@ -299,6 +300,7 @@ public class PointController extends AbstractBaseController { ...@@ -299,6 +300,7 @@ public class PointController extends AbstractBaseController {
* @return * @return
*/ */
@ApiOperation(value = "上传巡检点", notes = "上传巡检点") @ApiOperation(value = "上传巡检点", notes = "上传巡检点")
@Transactional(rollbackFor = Exception.class)
@RequestMapping(value = "/import", produces = "application/json;charset=UTF-8", method = RequestMethod.POST) @RequestMapping(value = "/import", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
public CommonResponse importPoint(@ApiParam(value = "导入数据文件", required = true) @RequestBody(required = true) MultipartFile file) { public CommonResponse importPoint(@ApiParam(value = "导入数据文件", required = true) @RequestBody(required = true) MultipartFile file) {
String fileName = file.getOriginalFilename(); String fileName = file.getOriginalFilename();
......
...@@ -49,6 +49,7 @@ import org.springframework.util.CollectionUtils; ...@@ -49,6 +49,7 @@ import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.utils.Bean; import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.persistence.criteria.CriteriaBuilder; import javax.persistence.criteria.CriteriaBuilder;
...@@ -165,7 +166,7 @@ public class PointServiceImpl implements IPointService { ...@@ -165,7 +166,7 @@ public class PointServiceImpl implements IPointService {
int count = iPointDao.findByPointNo(param.getPointNo(), orgCode); int count = iPointDao.findByPointNo(param.getPointNo(), orgCode);
// 该单位已存在该编号的点 // 该单位已存在该编号的点
if (count > 0) { if (count > 0) {
continue; throw new BadRequest("导入失败,该编号已存在");
} }
point.setAddress(param.getAddress()); point.setAddress(param.getAddress());
point.setCatalogId(param.getCatalogId() == null ? 0 : param.getCatalogId()); point.setCatalogId(param.getCatalogId() == null ? 0 : param.getCatalogId());
......
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