|  | @@ -1,11 +1,17 @@
 | 
	
		
			
				|  |  |  package com.xunmei.core.resumption.service;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  import cn.hutool.core.collection.CollectionUtil;
 | 
	
		
			
				|  |  | +import cn.hutool.core.date.DateField;
 | 
	
		
			
				|  |  | +import cn.hutool.core.date.DateUtil;
 | 
	
		
			
				|  |  | +import cn.hutool.core.util.NumberUtil;
 | 
	
		
			
				|  |  |  import cn.hutool.core.util.ObjectUtil;
 | 
	
		
			
				|  |  |  import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 | 
	
		
			
				|  |  |  import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 | 
	
		
			
				|  |  |  import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 | 
	
		
			
				|  |  | +import com.xunmei.common.core.constant.SecurityConstants;
 | 
	
		
			
				|  |  |  import com.xunmei.common.core.utils.IDHelper;
 | 
	
		
			
				|  |  | +import com.xunmei.common.security.utils.SecurityUtils;
 | 
	
		
			
				|  |  | +import com.xunmei.core.question.QuestionSrcType;
 | 
	
		
			
				|  |  |  import com.xunmei.core.resumption.domain.*;
 | 
	
		
			
				|  |  |  import com.xunmei.core.resumption.dto.AppResumptionDataDto;
 | 
	
		
			
				|  |  |  import com.xunmei.core.resumption.dto.resumptionRegister.ResumptionTaskDataDto;
 | 
	
	
		
			
				|  | @@ -13,13 +19,18 @@ import com.xunmei.core.resumption.dto.TaskDetailsDto;
 | 
	
		
			
				|  |  |  import com.xunmei.core.resumption.vo.*;
 | 
	
		
			
				|  |  |  import com.xunmei.core.resumption.vo.resumptionRegister.*;
 | 
	
		
			
				|  |  |  import com.xunmei.system.api.RemoteConfigService;
 | 
	
		
			
				|  |  | +import com.xunmei.system.api.RemoteOrgService;
 | 
	
		
			
				|  |  | +import com.xunmei.system.api.domain.SysOrg;
 | 
	
		
			
				|  |  |  import com.xunmei.system.api.model.LoginUser;
 | 
	
		
			
				|  |  | +import com.xunmei.core.question.domain.Question;
 | 
	
		
			
				|  |  | +import com.xunmei.core.question.service.IQuestionService;
 | 
	
		
			
				|  |  |  import org.apache.commons.lang3.StringUtils;
 | 
	
		
			
				|  |  |  import org.springframework.beans.BeanUtils;
 | 
	
		
			
				|  |  |  import org.springframework.beans.factory.annotation.Autowired;
 | 
	
		
			
				|  |  |  import org.springframework.stereotype.Component;
 | 
	
		
			
				|  |  |  import org.springframework.transaction.annotation.Transactional;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +import java.rmi.ServerException;
 | 
	
		
			
				|  |  |  import java.text.ParseException;
 | 
	
		
			
				|  |  |  import java.text.SimpleDateFormat;
 | 
	
		
			
				|  |  |  import java.time.LocalDateTime;
 | 
	
	
		
			
				|  | @@ -36,17 +47,20 @@ public class ResumptionBusiness {
 | 
	
		
			
				|  |  |      private AppResumptionDataNfcService appResumptionDataNfcService;
 | 
	
		
			
				|  |  |      @Autowired
 | 
	
		
			
				|  |  |      private IAppResumptionDataRemarkimgService appResumptionTaskDataRemarkimgService;
 | 
	
		
			
				|  |  | -    @Autowired
 | 
	
		
			
				|  |  | -    private RemoteConfigService systemParameService;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |      @Autowired
 | 
	
		
			
				|  |  |      private IAppRulePointService appRulePointService;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |      @Autowired
 | 
	
		
			
				|  |  |      private AppResumptionDataService appResumptionDataService;
 | 
	
		
			
				|  |  | -    @Autowired
 | 
	
		
			
				|  |  | -    private IProtectionService protectionService;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |      @Autowired
 | 
	
		
			
				|  |  |      private ICoreResumptionDataProtectionService coreResumptionDataProtectionService;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +    @Autowired
 | 
	
		
			
				|  |  | +    private RemoteOrgService remoteOrgService;
 | 
	
		
			
				|  |  | +    @Autowired
 | 
	
		
			
				|  |  | +    private IQuestionService questionService;
 | 
	
		
			
				|  |  |  //    public Map<String, Object> tasktotal(ResumptionTaskDto request) throws ParseException {
 | 
	
		
			
				|  |  |  //        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
 | 
	
		
			
				|  |  |  //        final DateHelper dateTime = new DateHelper(sdf.parse(request.getDateTime()));
 | 
	
	
		
			
				|  | @@ -201,18 +215,18 @@ public class ResumptionBusiness {
 | 
	
		
			
				|  |  |              ResumptionTaskListVo vo = new ResumptionTaskListVo();
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |              vo.setId(map.get("id").toString());
 | 
	
		
			
				|  |  | -            SimpleDateFormat currentFormat=sdft;
 | 
	
		
			
				|  |  | +            SimpleDateFormat currentFormat = sdft;
 | 
	
		
			
				|  |  |              if (ObjectUtil.equal(type, 3)) {
 | 
	
		
			
				|  |  | -                currentFormat=sdfta;
 | 
	
		
			
				|  |  | +                currentFormat = sdfta;
 | 
	
		
			
				|  |  |                  vo.setTitle(map.get("ymd_year") + "年第" + map.get("ymd_week") + "周-" + map.get("title"));
 | 
	
		
			
				|  |  |              } else if (ObjectUtil.equal(type, 4)) {
 | 
	
		
			
				|  |  | -                currentFormat=sdfta;
 | 
	
		
			
				|  |  | +                currentFormat = sdfta;
 | 
	
		
			
				|  |  |                  vo.setTitle(map.get("ymd_year") + "年第" + map.get("ymd_month") + "月-" + map.get("title"));
 | 
	
		
			
				|  |  |              } else if (ObjectUtil.equal(type, 5)) {
 | 
	
		
			
				|  |  | -                currentFormat=sdfta;
 | 
	
		
			
				|  |  | +                currentFormat = sdfta;
 | 
	
		
			
				|  |  |                  vo.setTitle(map.get("ymd_year") + "年第" + map.get("ymd_quarter") + "季度-" + map.get("title"));
 | 
	
		
			
				|  |  |              } else if (ObjectUtil.equal(type, 6)) {
 | 
	
		
			
				|  |  | -                currentFormat=sdfta;
 | 
	
		
			
				|  |  | +                currentFormat = sdfta;
 | 
	
		
			
				|  |  |                  int ymd_halfyear = (int) map.get("ymd_halfyear");
 | 
	
		
			
				|  |  |                  String strhalfyear = "";
 | 
	
		
			
				|  |  |                  switch (ymd_halfyear) {
 | 
	
	
		
			
				|  | @@ -224,7 +238,7 @@ public class ResumptionBusiness {
 | 
	
		
			
				|  |  |                          break;
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |              } else if (ObjectUtil.equal(type, 7)) {
 | 
	
		
			
				|  |  | -                currentFormat=sdfta;
 | 
	
		
			
				|  |  | +                currentFormat = sdfta;
 | 
	
		
			
				|  |  |                  vo.setTitle(map.get("ymd_year") + "年-" + map.get("title"));
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |              vo.setPlanstarttime(map.get("planstarttime") == null ? "" : currentFormat.format(LocalDateTimeToDate((LocalDateTime) map.get("planstarttime"))));
 | 
	
	
		
			
				|  | @@ -492,7 +506,7 @@ public class ResumptionBusiness {
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @Transactional(rollbackFor = Exception.class)
 | 
	
		
			
				|  |  | -    public int submitTaskData(ResumptionTaskDataDto request, LoginUser user, Resumption resumption) throws ParseException {
 | 
	
		
			
				|  |  | +    public int submitTaskData(ResumptionTaskDataDto request, LoginUser user, Resumption resumption) throws Exception {
 | 
	
		
			
				|  |  |          int result = 0;
 | 
	
		
			
				|  |  |          Date time = new Date();
 | 
	
		
			
				|  |  |          List<AppResumptionDataNfc> nfcList = request.getNfcData();
 | 
	
	
		
			
				|  | @@ -506,6 +520,7 @@ public class ResumptionBusiness {
 | 
	
		
			
				|  |  |          SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
 | 
	
		
			
				|  |  |          sdf.setTimeZone(TimeZone.getTimeZone("Asia/Shanghai"));
 | 
	
		
			
				|  |  |          List<CoreResumptionDataProtection> resumptionProtections = new ArrayList<>();
 | 
	
		
			
				|  |  | +        SysOrg org=  remoteOrgService.selectSysOrgById(resumption.getOrgId(), SecurityConstants.INNER);
 | 
	
		
			
				|  |  |  //        List<AppResumptionTaskDataRemark> remarkDtoList = new ArrayList<>();
 | 
	
		
			
				|  |  |          for (AppResumptionDataDto appResumptionDataDto : resumptionDataList) {
 | 
	
		
			
				|  |  |              AppResumptionData data = new AppResumptionData();
 | 
	
	
		
			
				|  | @@ -560,6 +575,32 @@ public class ResumptionBusiness {
 | 
	
		
			
				|  |  |                  }).collect(Collectors.toList());
 | 
	
		
			
				|  |  |                  resumptionProtections.addAll(dataProtections);
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            if (ObjectUtil.equal(request.getIsSubmit(), 1) && ObjectUtil.equal(appResumptionDataDto.getResValue(), 1)) {
 | 
	
		
			
				|  |  | +               if(! NumberUtil.isNumber(appResumptionDataDto.getRectificationDeadline())){
 | 
	
		
			
				|  |  | +                   throw new ServerException(String.format("履职内容‘%s’的整改期限值错误",appResumptionDataDto.getPointname()));
 | 
	
		
			
				|  |  | +               }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +                Question question = Question.builder()
 | 
	
		
			
				|  |  | +                        .srcTaskId(resumption.getId())
 | 
	
		
			
				|  |  | +                        .orgId(resumption.getOrgId())
 | 
	
		
			
				|  |  | +                        .orgName(org.getShortName())
 | 
	
		
			
				|  |  | +                        .orgPath(org.getPath())
 | 
	
		
			
				|  |  | +                        .SrcPointId(appResumptionDataDto.getPointId())
 | 
	
		
			
				|  |  | +                        .srcDataPointId(appResumptionDataDto.getId())
 | 
	
		
			
				|  |  | +                        .srcType(QuestionSrcType.Resumption.getValue())
 | 
	
		
			
				|  |  | +                        .srcTaskName(resumption.getName())
 | 
	
		
			
				|  |  | +                        .checkItem(appResumptionDataDto.getItemname())
 | 
	
		
			
				|  |  | +                        .checkContent(appResumptionDataDto.getPointname())
 | 
	
		
			
				|  |  | +                        .questionDesc(appResumptionDataDto.getResRemark())
 | 
	
		
			
				|  |  | +                        .submitorId(ObjectUtil.isNull(appResumptionDataDto.getSubmitBy()) ? user.getUserid() : appResumptionDataDto.getSubmitBy())
 | 
	
		
			
				|  |  | +                        .submitorName(ObjectUtil.isNull(appResumptionDataDto.getSubmitName()) ? user.getName() : appResumptionDataDto.getSubmitName())
 | 
	
		
			
				|  |  | +                        .submitTime(ObjectUtil.isNull(appResumptionDataDto.getSubmitTime()) ? new Date() : appResumptionDataDto.getSubmitTime())
 | 
	
		
			
				|  |  | +                        .reformDeadline(DateUtil.endOfDay(DateUtil.offsetDay(new Date(), Integer.parseInt(appResumptionDataDto.getRectificationDeadline()))))
 | 
	
		
			
				|  |  | +                        .build();
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +                questionService.insertQuestion(question);
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          appResumptionDataService.saveBatch(list);
 | 
	
		
			
				|  |  |          //获取未提交的履职数据当未提交的履职数据为0时,修改履职任务为已完成
 | 
	
	
		
			
				|  | @@ -597,6 +638,8 @@ public class ResumptionBusiness {
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          //清除代办
 | 
	
		
			
				|  |  |  //        this.todoService.remove(resumption.getId());
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |          return result;
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  }
 |