|
@@ -52,6 +52,7 @@ import com.platform.service.sb.SbInfoService;
|
|
|
import com.platform.service.upms.SysConfigService;
|
|
|
import com.platform.service.upms.SysUserDeptService;
|
|
|
import com.platform.service.upms.SysUserService;
|
|
|
+import com.platform.service.util.SysFileUtils;
|
|
|
import com.platform.service.wechat.util.WeChatMessageUtil;
|
|
|
import freemarker.template.Configuration;
|
|
|
import freemarker.template.Template;
|
|
@@ -124,7 +125,7 @@ public class RepairApplicationFormServiceImpl extends BaseServiceImpl<RepairAppl
|
|
|
public MyVOPage<RepairApplicationFormVO> selectPageInfoVO(RepairApplicationFormDTO record, int pageNum, int pageSize) {
|
|
|
PageHelper.startPage(pageNum, pageSize);
|
|
|
|
|
|
- if(record.getSearchType() != null){
|
|
|
+ if (record.getSearchType() != null) {
|
|
|
// 获取报修人
|
|
|
if (record.getSearchType() == 1) {
|
|
|
if (record.getFilter() != null && DataFilterTypeEnum.SELF.getValue() == record.getFilter().intValue()) {
|
|
@@ -187,7 +188,7 @@ public class RepairApplicationFormServiceImpl extends BaseServiceImpl<RepairAppl
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public RepairApplicationForm saveModelByDTO(RepairApplicationFormDTO model) {
|
|
|
- if(StringUtils.isBlank(model.getSbId())){
|
|
|
+ if (StringUtils.isBlank(model.getSbId())) {
|
|
|
throw new BusinessException("请填写报修设备");
|
|
|
}
|
|
|
Integer type = model.getType();
|
|
@@ -204,35 +205,35 @@ public class RepairApplicationFormServiceImpl extends BaseServiceImpl<RepairAppl
|
|
|
if (sb == null) {
|
|
|
throw new BusinessException("设备不存在,无法报修");
|
|
|
}
|
|
|
- if(StringUtils.isBlank(model.getActualUser())){
|
|
|
+ if (StringUtils.isBlank(model.getActualUser())) {
|
|
|
SysUser sysUser = sysUserService.getModelById(sb.getSaveUser());
|
|
|
- if(sysUser != null){
|
|
|
+ if (sysUser != null) {
|
|
|
model.setUserId(sysUser.getUserId());
|
|
|
model.setActualUser(sysUser.getRealName());
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
model.setUserId("1");
|
|
|
model.setActualUser("superadmin");
|
|
|
}
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
SysUser sysUser = new SysUser();
|
|
|
sysUser.setRealName(model.getActualUser());
|
|
|
SysUser sysUser1 = sysUserService.getModelByModel(sysUser);
|
|
|
- if(sysUser1 == null){
|
|
|
+ if (sysUser1 == null) {
|
|
|
// 设置设备的使用人
|
|
|
model.setUserId(sb.getSaveUser());
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
model.setUserId(sysUser1.getUserId());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if(model.getSource() == null){
|
|
|
+ if (model.getSource() == null) {
|
|
|
model.setSource(1);
|
|
|
}
|
|
|
|
|
|
model.setModelId(sb.getModelId());
|
|
|
// 根据配置判断是否可以多个提交
|
|
|
String only = ConfigCache.getLabelByValueAllowNull(SysConfigEnum.REPAIR_ONLY_ONE.name());
|
|
|
- if(StringUtils.isNotBlank(only) && Integer.valueOf(only).equals(RepairOnlyOneEnum.ONLY_ONE.getValue())){
|
|
|
+ if (StringUtils.isNotBlank(only) && Integer.valueOf(only).equals(RepairOnlyOneEnum.ONLY_ONE.getValue())) {
|
|
|
if (sb.getStatus().intValue() == SbInfoStatusEnum.IN_MAINTAIN.getValue()) {
|
|
|
throw new BusinessException("设备已经在维修中,请等待维修完成, sbId" + model.getSbId());
|
|
|
}
|
|
@@ -241,16 +242,16 @@ public class RepairApplicationFormServiceImpl extends BaseServiceImpl<RepairAppl
|
|
|
// 如果保修的设备位置和设备本身不一样,则可以更新该设备
|
|
|
boolean updateSb = false;
|
|
|
SbInfoDTO info = BeanConverterUtil.copyObjectProperties(sb, SbInfoDTO.class);
|
|
|
- if(StringUtils.isNotBlank(model.getSbCph()) && !model.getSbCph().equalsIgnoreCase((sb.getCph()))){
|
|
|
+ if (StringUtils.isNotBlank(model.getSbCph()) && !model.getSbCph().equalsIgnoreCase((sb.getCph()))) {
|
|
|
info.setCph(model.getSbCph());
|
|
|
updateSb = true;
|
|
|
}
|
|
|
// 如果选择了设备停机,则要修改设备状态,记录设备状态变更变
|
|
|
- if (model.getNeedStop()!=null && model.getNeedStop().intValue() == RepairApplicationFormStopEnum.STOP.getValue()) {
|
|
|
+ if (model.getNeedStop() != null && model.getNeedStop().intValue() == RepairApplicationFormStopEnum.STOP.getValue()) {
|
|
|
info.setStatus(SbInfoStatusEnum.IN_STOP.getValue());
|
|
|
updateSb = true;
|
|
|
}
|
|
|
- if(updateSb){
|
|
|
+ if (updateSb) {
|
|
|
info.setChangeReason("维修停机");
|
|
|
info.setActualUser(model.getActualUser());
|
|
|
sbInfoService.updateStatus(info);
|
|
@@ -269,19 +270,19 @@ public class RepairApplicationFormServiceImpl extends BaseServiceImpl<RepairAppl
|
|
|
SysUserDTO sysUserDTO = new SysUserDTO();
|
|
|
sysUserDTO.setRoleCode(SysRoleCodeEnum.Maintenance.name());
|
|
|
List<SysUserVO> sysUserVOList = sysUserService.getDeptChildrenRoleUser(sysUserDTO);
|
|
|
- if(CollectionUtil.isNotEmpty(sysUserVOList)){
|
|
|
- for(SysUserVO sysUserVO:sysUserVOList){
|
|
|
+ if (CollectionUtil.isNotEmpty(sysUserVOList)) {
|
|
|
+ for (SysUserVO sysUserVO : sysUserVOList) {
|
|
|
// 站内信需要用户id
|
|
|
userIds.add(sysUserVO.getUserId());
|
|
|
- if(StringUtils.isNotBlank(sysUserVO.getWxOpenid())){
|
|
|
+ if (StringUtils.isNotBlank(sysUserVO.getWxOpenid())) {
|
|
|
// 微信id
|
|
|
openIds.add(sysUserVO.getWxOpenid());
|
|
|
}
|
|
|
- if(StringUtils.isNotBlank(sysUserVO.getWxOpenid())){
|
|
|
+ if (StringUtils.isNotBlank(sysUserVO.getWxOpenid())) {
|
|
|
// 手机
|
|
|
receiverList.add(sysUserVO.getPhone());
|
|
|
}
|
|
|
- if(StringUtils.isNotBlank(sysUserVO.getWxOpenid())){
|
|
|
+ if (StringUtils.isNotBlank(sysUserVO.getWxOpenid())) {
|
|
|
// 邮箱
|
|
|
mails.add(sysUserVO.getEmail());
|
|
|
}
|
|
@@ -298,10 +299,10 @@ public class RepairApplicationFormServiceImpl extends BaseServiceImpl<RepairAppl
|
|
|
int result = mapper.insert(form);
|
|
|
|
|
|
String domain = ConfigCache.getLabelByValueAllowNull(SysConfigEnum.SYSTEM_DOMAIN.name());
|
|
|
- if(StringUtils.isBlank(domain)){
|
|
|
+ if (StringUtils.isBlank(domain)) {
|
|
|
throw new BusinessException("请先设置系统域名地址,系统管理-》系统参数配置-》SYSTEM_DOMAIN");
|
|
|
}
|
|
|
- if(!domain.endsWith("/")){
|
|
|
+ if (!domain.endsWith("/")) {
|
|
|
domain = domain + "/";
|
|
|
}
|
|
|
String repairUrl = domain + "repair/form?no=" + model.getNo();
|
|
@@ -309,51 +310,51 @@ public class RepairApplicationFormServiceImpl extends BaseServiceImpl<RepairAppl
|
|
|
// 通过给当天值班维修人员
|
|
|
SpringContextHolder.publishEvent(new WorkplaceBacklogEvent(WorkplaceBacklogTypeEnum.REPAIR.getValue(), WorkplaceBacklogDetailTypeEnum.REPAIR_APPLICATION.getValue(),
|
|
|
model.getId(),
|
|
|
- MessageTemplateUtil.getFreemarkerHtmlContent(repairUrl,model,sb),
|
|
|
+ MessageTemplateUtil.getFreemarkerHtmlContent(repairUrl, model, sb),
|
|
|
model.getId(), userIds, mails));
|
|
|
|
|
|
// 发送微信通知给所有维修人角色
|
|
|
- if(CollectionUtil.isNotEmpty(openIds) && BeanUtils.isProd()){
|
|
|
+ if (CollectionUtil.isNotEmpty(openIds) && BeanUtils.isProd()) {
|
|
|
String mobileDomain = ConfigCache.getLabelByValueAllowNull(SysConfigEnum.SYSTEM_DOMAIN_MOBILE.name());
|
|
|
- if(StringUtils.isBlank(mobileDomain)){
|
|
|
+ if (StringUtils.isBlank(mobileDomain)) {
|
|
|
throw new BusinessException("请先设置系统域名地址,系统管理-》系统参数配置-》SYSTEM_DOMAIN_MOBILE");
|
|
|
}
|
|
|
- if(!mobileDomain.endsWith("/")){
|
|
|
+ if (!mobileDomain.endsWith("/")) {
|
|
|
mobileDomain = mobileDomain + "/";
|
|
|
}
|
|
|
String mobileRepairUrl = mobileDomain + "pages/repair-detail/repair-detail?detailId=" + model.getId();
|
|
|
- for(String openId : openIds){
|
|
|
- WeChatMessageUtil.repairMessage( openId, mobileRepairUrl,model,sb);
|
|
|
+ for (String openId : openIds) {
|
|
|
+ WeChatMessageUtil.repairMessage(openId, mobileRepairUrl, model, sb);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if(CollectionUtil.isNotEmpty(receiverList) && BeanUtils.isProd()){
|
|
|
+ if (CollectionUtil.isNotEmpty(receiverList) && BeanUtils.isProd()) {
|
|
|
// String templateParas_repair = "[\"C-001\",\"1号车间\",\"熊超\"]";
|
|
|
String no = sb.getNo();
|
|
|
- if(StringUtils.isNotBlank(no)){
|
|
|
+ if (StringUtils.isNotBlank(no)) {
|
|
|
no = no.replace("_", "").replace("-", "");
|
|
|
}
|
|
|
String sbCph = model.getSbCph();
|
|
|
String actualUser = model.getActualUser();
|
|
|
- if(StringUtils.isBlank(sbCph)){
|
|
|
+ if (StringUtils.isBlank(sbCph)) {
|
|
|
sbCph = "未知";
|
|
|
}
|
|
|
- if(StringUtils.isBlank(actualUser)){
|
|
|
+ if (StringUtils.isBlank(actualUser)) {
|
|
|
actualUser = "未知";
|
|
|
}
|
|
|
- String templateParas_repair = "[\"" + no + "\",\"" + sbCph + "\",\""+ actualUser + "\"]";
|
|
|
- for(String receiver: receiverList){
|
|
|
+ String templateParas_repair = "[\"" + no + "\",\"" + sbCph + "\",\"" + actualUser + "\"]";
|
|
|
+ for (String receiver : receiverList) {
|
|
|
try {
|
|
|
- String numStr = RedisUtils.getString(RedisKeyConstants.HW_SMS+ receiver);
|
|
|
+ String numStr = RedisUtils.getString(RedisKeyConstants.HW_SMS + receiver);
|
|
|
boolean isSend = false;
|
|
|
- if(StringUtils.isBlank(numStr)){
|
|
|
- isSend =true;
|
|
|
- RedisUtils.setString(RedisKeyConstants.HW_SMS + receiver, "1",24, TimeUnit.HOURS);
|
|
|
- }else if( Integer.valueOf(numStr)<5){
|
|
|
- isSend =true;
|
|
|
- RedisUtils.setString(RedisKeyConstants.HW_SMS + receiver, String.valueOf(Integer.valueOf(numStr) + 1),24, TimeUnit.HOURS);
|
|
|
+ if (StringUtils.isBlank(numStr)) {
|
|
|
+ isSend = true;
|
|
|
+ RedisUtils.setString(RedisKeyConstants.HW_SMS + receiver, "1", 24, TimeUnit.HOURS);
|
|
|
+ } else if (Integer.valueOf(numStr) < 5) {
|
|
|
+ isSend = true;
|
|
|
+ RedisUtils.setString(RedisKeyConstants.HW_SMS + receiver, String.valueOf(Integer.valueOf(numStr) + 1), 24, TimeUnit.HOURS);
|
|
|
}
|
|
|
- if(isSend){
|
|
|
+ if (isSend) {
|
|
|
System.out.println("templateParas_repair: " + templateParas_repair);
|
|
|
String template = "[\"369751\"]";
|
|
|
//SendSms.sendCodeSms(receiver, template);
|
|
@@ -368,37 +369,37 @@ public class RepairApplicationFormServiceImpl extends BaseServiceImpl<RepairAppl
|
|
|
// 启动接收超时监控
|
|
|
String minuteStr = ConfigCache.getLabelByValueAllowNull(SysConfigEnum.REPAIR_WARN_MINUTE.name());
|
|
|
int minute = 30;// 默认30分钟
|
|
|
- if(StringUtils.isNotBlank(minuteStr)){
|
|
|
+ if (StringUtils.isNotBlank(minuteStr)) {
|
|
|
minute = Integer.valueOf(minuteStr);
|
|
|
}
|
|
|
- RedisUtils.setString(RedisKeyConstants.EXPIRE_BUSINESS_KEY_REPAIR_STEP_FIRST + RedisKeyConstants.EXPIRE_BUSINESS_SEP + model.getId(),model.getId(),minute, TimeUnit.MINUTES);
|
|
|
+ RedisUtils.setString(RedisKeyConstants.EXPIRE_BUSINESS_KEY_REPAIR_STEP_FIRST + RedisKeyConstants.EXPIRE_BUSINESS_SEP + model.getId(), model.getId(), minute, TimeUnit.MINUTES);
|
|
|
|
|
|
// 启动维修超时监控,维修时间升级流程:超过3个小时没修好,升级给牛工,超过8个小时没修好,升级给相工,超过24 没修好,升级给田总,现在把三阶段的人员位置留好,可以先暂时升级给我,后期再改为具体的人。
|
|
|
String hourFirstStr = ConfigCache.getLabelByValueAllowNull(SysConfigEnum.REPAIR_OVERTIME_MINUTE_FIRST.name());
|
|
|
int hourFirst = 3;// 默认3小时
|
|
|
- if(StringUtils.isNotBlank(hourFirstStr)){
|
|
|
+ if (StringUtils.isNotBlank(hourFirstStr)) {
|
|
|
hourFirst = Integer.valueOf(hourFirstStr);
|
|
|
}
|
|
|
String hourSecondStr = ConfigCache.getLabelByValueAllowNull(SysConfigEnum.REPAIR_OVERTIME_MINUTE_SECOND.name());
|
|
|
int hourSecond = 8;// 默认8小时
|
|
|
- if(StringUtils.isNotBlank(hourSecondStr)){
|
|
|
+ if (StringUtils.isNotBlank(hourSecondStr)) {
|
|
|
hourSecond = Integer.valueOf(hourSecondStr);
|
|
|
}
|
|
|
String hourThirdStr = ConfigCache.getLabelByValueAllowNull(SysConfigEnum.REPAIR_OVERTIME_MINUTE_THIRD.name());
|
|
|
int hourThird = 24;// 默认24小时
|
|
|
- if(StringUtils.isNotBlank(hourThirdStr)){
|
|
|
+ if (StringUtils.isNotBlank(hourThirdStr)) {
|
|
|
hourThird = Integer.valueOf(hourThirdStr);
|
|
|
}
|
|
|
- RedisUtils.setString(RedisKeyConstants.EXPIRE_BUSINESS_KEY_REPAIR_OVERTIME_STEP_FIRST + RedisKeyConstants.EXPIRE_BUSINESS_SEP + model.getId(),model.getId(),hourFirst, TimeUnit.HOURS);
|
|
|
- RedisUtils.setString(RedisKeyConstants.EXPIRE_BUSINESS_KEY_REPAIR_OVERTIME_STEP_SECOND + RedisKeyConstants.EXPIRE_BUSINESS_SEP + model.getId(),model.getId(),hourSecond, TimeUnit.HOURS);
|
|
|
- RedisUtils.setString(RedisKeyConstants.EXPIRE_BUSINESS_KEY_REPAIR_OVERTIME_STEP_THIRD + RedisKeyConstants.EXPIRE_BUSINESS_SEP + model.getId(),model.getId(),hourThird, TimeUnit.HOURS);
|
|
|
+ RedisUtils.setString(RedisKeyConstants.EXPIRE_BUSINESS_KEY_REPAIR_OVERTIME_STEP_FIRST + RedisKeyConstants.EXPIRE_BUSINESS_SEP + model.getId(), model.getId(), hourFirst, TimeUnit.HOURS);
|
|
|
+ RedisUtils.setString(RedisKeyConstants.EXPIRE_BUSINESS_KEY_REPAIR_OVERTIME_STEP_SECOND + RedisKeyConstants.EXPIRE_BUSINESS_SEP + model.getId(), model.getId(), hourSecond, TimeUnit.HOURS);
|
|
|
+ RedisUtils.setString(RedisKeyConstants.EXPIRE_BUSINESS_KEY_REPAIR_OVERTIME_STEP_THIRD + RedisKeyConstants.EXPIRE_BUSINESS_SEP + model.getId(), model.getId(), hourThird, TimeUnit.HOURS);
|
|
|
|
|
|
return form;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public void modModelByDTO(RepairApplicationFormDTO model) {
|
|
|
- if(StringUtils.isBlank(model.getSbId())){
|
|
|
+ if (StringUtils.isBlank(model.getSbId())) {
|
|
|
throw new BusinessException("请选择报修的设备");
|
|
|
}
|
|
|
// 如果保修的设备位置和设备本身不一样,则可以更新该设备
|
|
@@ -406,16 +407,21 @@ public class RepairApplicationFormServiceImpl extends BaseServiceImpl<RepairAppl
|
|
|
SbInfoVO sb = sbInfoService.getById(model.getSbId());
|
|
|
SbInfoDTO info = new SbInfoDTO();
|
|
|
info.setId(model.getSbId());
|
|
|
- if(StringUtils.isBlank(sb.getCph()) || !model.getSbCph().equalsIgnoreCase((sb.getCph()))){
|
|
|
- info.setCph(model.getSbCph());
|
|
|
- updateSb = true;
|
|
|
+ if (StringUtils.isNotBlank(model.getSbCph())) {
|
|
|
+ if (StringUtils.isBlank(sb.getCph()) || !model.getSbCph().equalsIgnoreCase((sb.getCph()))) {
|
|
|
+ info.setCph(model.getSbCph());
|
|
|
+ updateSb = true;
|
|
|
+ }
|
|
|
}
|
|
|
// 如果选择了设备停机,则要修改设备状态
|
|
|
- if (model.getNeedStop().intValue() == RepairApplicationFormStopEnum.STOP.getValue()) {
|
|
|
- info.setStatus(SbInfoStatusEnum.IN_MAINTAIN.getValue());
|
|
|
- updateSb = true;
|
|
|
+ if (model.getNeedStop() != null) {
|
|
|
+ if (model.getNeedStop().intValue() == RepairApplicationFormStopEnum.STOP.getValue()) {
|
|
|
+ info.setStatus(SbInfoStatusEnum.IN_MAINTAIN.getValue());
|
|
|
+ updateSb = true;
|
|
|
+ }
|
|
|
}
|
|
|
- if(updateSb){
|
|
|
+ if (updateSb) {
|
|
|
+ info.setActualUser(model.getActualUser());
|
|
|
info.setChangeReason("维修停机");
|
|
|
sbInfoService.updateStatus(info);
|
|
|
}
|
|
@@ -423,40 +429,54 @@ public class RepairApplicationFormServiceImpl extends BaseServiceImpl<RepairAppl
|
|
|
super.modModelByDTO(model);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 保存报修图片
|
|
|
+ *
|
|
|
+ * @param model
|
|
|
+ */
|
|
|
private void saveFile(RepairApplicationFormDTO model) {
|
|
|
- Weekend<SysFile> weekend = new Weekend<>(SysFile.class);
|
|
|
- weekend.weekendCriteria().andEqualTo(SysFile::getTargetId, model.getId());
|
|
|
- sysFileMapper.deleteByExample(weekend);
|
|
|
- List<SysFile> applicationFileList = model.getApplicationFileList();
|
|
|
- List<SysFile> repairFileList = model.getRepairFileList();
|
|
|
- List<SysFile> checkFileList = model.getCheckFileList();
|
|
|
- List<SysFile> list = ListUtils.newArrayList();
|
|
|
- if (CollectionUtil.isNotEmpty(applicationFileList)) {
|
|
|
- applicationFileList.forEach(item -> {
|
|
|
- item.setType(SysFileTypeEnum.REPAIR_APPLICATION_IMGS.getValue());
|
|
|
- item.setId(IdGeneratorUtils.getObjectId());
|
|
|
- item.setTargetId(model.getId());
|
|
|
- list.add(item);
|
|
|
- });
|
|
|
- }
|
|
|
- if (CollectionUtil.isNotEmpty(repairFileList)) {
|
|
|
- repairFileList.forEach(item -> {
|
|
|
- item.setType(SysFileTypeEnum.REPAIR_REPAIR_IMGS.getValue());
|
|
|
- item.setId(IdGeneratorUtils.getObjectId());
|
|
|
- item.setTargetId(model.getId());
|
|
|
- list.add(item);
|
|
|
- });
|
|
|
+ if (CollectionUtil.isNotEmpty(model.getApplicationFileList())) {
|
|
|
+ Weekend<SysFile> weekend = new Weekend<>(SysFile.class);
|
|
|
+ weekend.weekendCriteria().andEqualTo(SysFile::getType, SysFileTypeEnum.REPAIR_APPLICATION_IMGS.getValue()).andEqualTo(SysFile::getTargetId, model.getId());
|
|
|
+ sysFileMapper.deleteByExample(weekend);
|
|
|
+ List<SysFile> list = SysFileUtils.changeFileList(model.getApplicationFileList(), model.getId(), SysFileTypeEnum.REPAIR_APPLICATION_IMGS.getValue());
|
|
|
+ if (CollectionUtil.isNotEmpty(list)) {
|
|
|
+ sysFileMapper.insertListforComplex(list);
|
|
|
+ }
|
|
|
}
|
|
|
- if (CollectionUtil.isNotEmpty(checkFileList)) {
|
|
|
- checkFileList.forEach(item -> {
|
|
|
- item.setType(SysFileTypeEnum.REPAIR_CHECK_IMGS.getValue());
|
|
|
- item.setId(IdGeneratorUtils.getObjectId());
|
|
|
- item.setTargetId(model.getId());
|
|
|
- list.add(item);
|
|
|
- });
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 保存维修图片
|
|
|
+ *
|
|
|
+ * @param model
|
|
|
+ */
|
|
|
+ private void saveRepairFile(RepairApplicationFormDTO model) {
|
|
|
+ if (CollectionUtil.isNotEmpty(model.getRepairFileList())) {
|
|
|
+ Weekend<SysFile> weekend = new Weekend<>(SysFile.class);
|
|
|
+ weekend.weekendCriteria().andEqualTo(SysFile::getType, SysFileTypeEnum.REPAIR_REPAIR_IMGS.getValue()).andEqualTo(SysFile::getTargetId, model.getId());
|
|
|
+ sysFileMapper.deleteByExample(weekend);
|
|
|
+ List<SysFile> list = SysFileUtils.changeFileList(model.getRepairFileList(), model.getId(), SysFileTypeEnum.REPAIR_REPAIR_IMGS.getValue());
|
|
|
+ if (CollectionUtil.isNotEmpty(list)) {
|
|
|
+ sysFileMapper.insertListforComplex(list);
|
|
|
+ }
|
|
|
}
|
|
|
- if (CollectionUtil.isNotEmpty(list)) {
|
|
|
- sysFileMapper.insertListforComplex(list);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 保存验收图片
|
|
|
+ *
|
|
|
+ * @param model
|
|
|
+ */
|
|
|
+ private void saveCheckFile(RepairApplicationFormDTO model) {
|
|
|
+ if (CollectionUtil.isNotEmpty(model.getCheckFileList())) {
|
|
|
+ Weekend<SysFile> weekend = new Weekend<>(SysFile.class);
|
|
|
+ weekend.weekendCriteria().andEqualTo(SysFile::getType, SysFileTypeEnum.REPAIR_CHECK_IMGS.getValue()).andEqualTo(SysFile::getTargetId, model.getId());
|
|
|
+ sysFileMapper.deleteByExample(weekend);
|
|
|
+ List<SysFile> list = SysFileUtils.changeFileList(model.getCheckFileList(), model.getId(), SysFileTypeEnum.REPAIR_CHECK_IMGS.getValue());
|
|
|
+ if (CollectionUtil.isNotEmpty(list)) {
|
|
|
+ sysFileMapper.insertListforComplex(list);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -473,16 +493,16 @@ public class RepairApplicationFormServiceImpl extends BaseServiceImpl<RepairAppl
|
|
|
}
|
|
|
UserInfo userInfo = SecurityUtils.getUser().getUserInfo();
|
|
|
SbInfo sbInfo = sbInfoService.getModelById(applicationForm.getSbId());
|
|
|
- if(sbInfo == null){
|
|
|
+ if (sbInfo == null) {
|
|
|
throw new BusinessException("设备不存在,无法接收");
|
|
|
}
|
|
|
- if(sbInfo.getRepairUser() == null){
|
|
|
+ if (sbInfo.getRepairUser() == null) {
|
|
|
throw new BusinessException("设备的第一维修人未设置,无法接受任务");
|
|
|
}
|
|
|
- if(sbInfo.getRepairUserSecond() == null){
|
|
|
+ if (sbInfo.getRepairUserSecond() == null) {
|
|
|
throw new BusinessException("设备的第二维修人未设置,无法接受任务");
|
|
|
}
|
|
|
- if(!SecurityUtils.isRole(SysRoleCodeEnum.MM.name()) && !SecurityUtils.isRole(SysRoleCodeEnum.Maintenance.name()) ){
|
|
|
+ if (!SecurityUtils.isRole(SysRoleCodeEnum.MM.name()) && !SecurityUtils.isRole(SysRoleCodeEnum.Maintenance.name())) {
|
|
|
throw new BusinessException("您不是维修人或维修主管,无法接受任务");
|
|
|
}
|
|
|
|
|
@@ -491,18 +511,18 @@ public class RepairApplicationFormServiceImpl extends BaseServiceImpl<RepairAppl
|
|
|
}*/
|
|
|
applicationForm.setRepairUserId(userInfo.getUserId());
|
|
|
applicationForm.setStatus(RepairApplicationFormStatusEnum.PROCESSING.getValue());
|
|
|
- if(applicationForm.getRepairStartTime() == null){
|
|
|
+ if (applicationForm.getRepairStartTime() == null) {
|
|
|
applicationForm.setRepairStartTime(LocalDateTime.now());
|
|
|
}
|
|
|
applicationForm.setReceiveMinutes(Double.valueOf(DateUtils.getDurationMinutesStr(applicationForm.getApplyTime(), applicationForm.getRepairStartTime())));
|
|
|
|
|
|
// 根据配置判断维修是否超时
|
|
|
String minuteStr = ConfigCache.getLabelByValueAllowNull(SysConfigEnum.REPAIR_WARN_MINUTE.name());
|
|
|
- if(StringUtils.isBlank(minuteStr)){
|
|
|
+ if (StringUtils.isBlank(minuteStr)) {
|
|
|
applicationForm.setReceiveOvertime(false);
|
|
|
- } else if(applicationForm.getReceiveMinutes() > Double.valueOf(minuteStr)){
|
|
|
+ } else if (applicationForm.getReceiveMinutes() > Double.valueOf(minuteStr)) {
|
|
|
applicationForm.setReceiveOvertime(true);
|
|
|
- } else{
|
|
|
+ } else {
|
|
|
applicationForm.setReceiveOvertime(false);
|
|
|
}
|
|
|
applicationForm.setUpdateTime(LocalDateTime.now());
|
|
@@ -562,6 +582,7 @@ public class RepairApplicationFormServiceImpl extends BaseServiceImpl<RepairAppl
|
|
|
/**
|
|
|
* 完成为待验收状态,此时需要再次编辑维修内容,最终提交审核
|
|
|
* 完成同时将设备状态为使用中
|
|
|
+ *
|
|
|
* @param dto
|
|
|
*/
|
|
|
@Override
|
|
@@ -573,10 +594,10 @@ public class RepairApplicationFormServiceImpl extends BaseServiceImpl<RepairAppl
|
|
|
applicationForm.setStatus(RepairApplicationFormStatusEnum.WAIT_SUBMIT.getValue());
|
|
|
|
|
|
// 驳回重新完成的,不用更新这个时间,驳回应该状态是完成待审核,不需要重新维修
|
|
|
- if(applicationForm.getRepairEndTime() == null){
|
|
|
+ if (applicationForm.getRepairEndTime() == null) {
|
|
|
applicationForm.setRepairEndTime(LocalDateTime.now());
|
|
|
}
|
|
|
- if(dto.getRepairEndTime() != null){
|
|
|
+ if (dto.getRepairEndTime() != null) {
|
|
|
applicationForm.setRepairEndTime(dto.getRepairEndTime());
|
|
|
}
|
|
|
|
|
@@ -586,12 +607,12 @@ public class RepairApplicationFormServiceImpl extends BaseServiceImpl<RepairAppl
|
|
|
// 根据配置判断维修是否超时
|
|
|
String hourFirstStr = ConfigCache.getLabelByValueAllowNull(SysConfigEnum.REPAIR_OVERTIME_MINUTE_FIRST.name());
|
|
|
int hourFirst = 180;// 默认3小时,180分钟
|
|
|
- if(StringUtils.isNotBlank(hourFirstStr)){
|
|
|
+ if (StringUtils.isNotBlank(hourFirstStr)) {
|
|
|
hourFirst = Integer.valueOf(hourFirstStr) * 60;
|
|
|
}
|
|
|
- if(applicationForm.getRepairMinutes()> hourFirst){
|
|
|
+ if (applicationForm.getRepairMinutes() > hourFirst) {
|
|
|
applicationForm.setRepairOvertime(true);
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
applicationForm.setRepairOvertime(false);
|
|
|
}
|
|
|
applicationForm.setRepairContent(dto.getRepairContent());
|
|
@@ -603,23 +624,7 @@ public class RepairApplicationFormServiceImpl extends BaseServiceImpl<RepairAppl
|
|
|
//applicationForm.setContent(dto.getContent());
|
|
|
applicationForm.setOutType(dto.getOutType());
|
|
|
|
|
|
- Weekend<SysFile> weekend = new Weekend<>(SysFile.class);
|
|
|
- weekend.weekendCriteria().andEqualTo(SysFile::getTargetId, dto.getId());
|
|
|
- weekend.weekendCriteria().andEqualTo(SysFile::getType, SysFileTypeEnum.REPAIR_REPAIR_IMGS.getValue());
|
|
|
- sysFileMapper.deleteByExample(weekend);
|
|
|
- List<SysFile> repairFileList = dto.getRepairFileList();
|
|
|
- List<SysFile> list = ListUtils.newArrayList();
|
|
|
- if (CollectionUtil.isNotEmpty(repairFileList)) {
|
|
|
- repairFileList.forEach(item -> {
|
|
|
- item.setType(SysFileTypeEnum.REPAIR_REPAIR_IMGS.getValue());
|
|
|
- item.setId(IdGeneratorUtils.getObjectId());
|
|
|
- item.setTargetId(dto.getId());
|
|
|
- list.add(item);
|
|
|
- });
|
|
|
- }
|
|
|
- if (CollectionUtil.isNotEmpty(list)) {
|
|
|
- sysFileMapper.insertListforComplex(list);
|
|
|
- }
|
|
|
+ this.saveRepairFile(dto);
|
|
|
super.modModelByPrimaryKey(applicationForm);
|
|
|
|
|
|
// 更新设备状态为使用中
|
|
@@ -633,8 +638,9 @@ public class RepairApplicationFormServiceImpl extends BaseServiceImpl<RepairAppl
|
|
|
* 给领导发邮件,领导通过邮件跳转到审核页面
|
|
|
* 判断接收人是设备的第一维修人,如果是要提交给第二维修人进行审核,这个时候维修单状态不变。
|
|
|
* 如果是第二维修人,则直接提报给牛工进行审核即可。
|
|
|
- *
|
|
|
+ * <p>
|
|
|
* TODO: 统一发给牛工,以免出问题,只审批一次,后面在完善2级审批的流程
|
|
|
+ *
|
|
|
* @param id :
|
|
|
*/
|
|
|
@Override
|
|
@@ -656,30 +662,30 @@ public class RepairApplicationFormServiceImpl extends BaseServiceImpl<RepairAppl
|
|
|
applicationForm.setCheckUserId(sbInfoVO.getRepairUserSecond());
|
|
|
userVO = BeanConverterUtil.copyObjectProperties(userMapper.selectByPrimaryKey(sbInfoVO.getRepairUserSecond()), SysUserVO.class);
|
|
|
}else{*/
|
|
|
- SysUserDTO query = new SysUserDTO();
|
|
|
- query.setRoleCode(SysRoleCodeEnum.REPAIR_EXAMINE.name());
|
|
|
- List<SysUserVO> users = userMapper.selectDeptRoleUser(query);
|
|
|
- if (CollectionUtil.isNotEmpty(users)) {
|
|
|
- userVO = users.get(0);
|
|
|
- }else{
|
|
|
- throw new BusinessException("审核角色:REPAIR_EXAMINE未绑定用户,REPAIR_EXAMINE为维修单最终验收人,请设置用户");
|
|
|
- }
|
|
|
- applicationForm.setCheckUserId(userVO.getUserId());
|
|
|
+ SysUserDTO query = new SysUserDTO();
|
|
|
+ query.setRoleCode(SysRoleCodeEnum.REPAIR_EXAMINE.name());
|
|
|
+ List<SysUserVO> users = userMapper.selectDeptRoleUser(query);
|
|
|
+ if (CollectionUtil.isNotEmpty(users)) {
|
|
|
+ userVO = users.get(0);
|
|
|
+ } else {
|
|
|
+ throw new BusinessException("审核角色:REPAIR_EXAMINE未绑定用户,REPAIR_EXAMINE为维修单最终验收人,请设置用户");
|
|
|
+ }
|
|
|
+ applicationForm.setCheckUserId(userVO.getUserId());
|
|
|
/*}*/
|
|
|
|
|
|
super.modModelByPrimaryKey(applicationForm);
|
|
|
|
|
|
// 发送邮件和通知
|
|
|
String domain = ConfigCache.getLabelByValueAllowNull(SysConfigEnum.SYSTEM_DOMAIN.name());
|
|
|
- if(StringUtils.isBlank(domain)){
|
|
|
+ if (StringUtils.isBlank(domain)) {
|
|
|
throw new BusinessException("请先设置系统域名地址,系统管理-》系统参数配置-》SYSTEM_DOMAIN");
|
|
|
}
|
|
|
- if(!domain.endsWith("/")){
|
|
|
+ if (!domain.endsWith("/")) {
|
|
|
domain = domain + "/";
|
|
|
}
|
|
|
String repairUrl = domain + "repair/application/form/check?no=" + applicationForm.getNo();
|
|
|
SpringContextHolder.publishEvent(new WorkplaceBacklogEvent(WorkplaceBacklogTypeEnum.REPAIR.getValue(), WorkplaceBacklogDetailTypeEnum.REPAIR_EXAMINE.getValue(),
|
|
|
- applicationForm.getId(), MessageTemplateUtil.getFreemarkerHtmlContentCheck(repairUrl,BeanConverterUtil.copyObjectProperties(applicationForm, RepairApplicationFormDTO.class), sbInfoVO),
|
|
|
+ applicationForm.getId(), MessageTemplateUtil.getFreemarkerHtmlContentCheck(repairUrl, BeanConverterUtil.copyObjectProperties(applicationForm, RepairApplicationFormDTO.class), sbInfoVO),
|
|
|
applicationForm.getId(), ListUtils.newArrayList(userVO.getUserId()), ListUtils.newArrayList(userVO.getEmail())));
|
|
|
}
|
|
|
|
|
@@ -688,9 +694,9 @@ public class RepairApplicationFormServiceImpl extends BaseServiceImpl<RepairAppl
|
|
|
* 2:如果不是当前年份,则统计全年的
|
|
|
*
|
|
|
* @param repairApplicationFormDTO
|
|
|
- * @param searchYear 查询年份
|
|
|
- * @param type 1:大于24的非计划性维修
|
|
|
- * 2:所有类型维修,不限维修时间,包括计划性和非计划性,单不包括其他(如:布线等完善性维修)
|
|
|
+ * @param searchYear 查询年份
|
|
|
+ * @param type 1:大于24的非计划性维修
|
|
|
+ * 2:所有类型维修,不限维修时间,包括计划性和非计划性,单不包括其他(如:布线等完善性维修)
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
@@ -698,12 +704,12 @@ public class RepairApplicationFormServiceImpl extends BaseServiceImpl<RepairAppl
|
|
|
List<Map<String, LocalDateTime>> monthStartAndEndList = new ArrayList<Map<String, LocalDateTime>>();
|
|
|
LocalDateTime searchStartTime = null;
|
|
|
LocalDateTime searchEndTime = null;
|
|
|
- if(searchYear != null){
|
|
|
+ if (searchYear != null) {
|
|
|
LocalDate localDate = LocalDate.now();
|
|
|
int year = localDate.getYear();
|
|
|
// 如2021-10-15号码,则month=10,需要计算到11月份,需要加1
|
|
|
int month = localDate.getMonthValue() + 1;
|
|
|
- if(searchYear<year){
|
|
|
+ if (searchYear < year) {
|
|
|
month = 12;
|
|
|
year = searchYear;
|
|
|
}
|
|
@@ -711,7 +717,7 @@ public class RepairApplicationFormServiceImpl extends BaseServiceImpl<RepairAppl
|
|
|
// 当前年份只统计到当前月,历史年份统计全年
|
|
|
searchStartTime = DateUtils.getFirstDayOfThisYear(year);
|
|
|
searchEndTime = DateUtils.getLastDayOfMonth(year, month);
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
monthStartAndEndList = DateUtils.getMonthStartAndEndByYear(startMonth, endMonth);
|
|
|
searchStartTime = DateUtils.getFirstDayOfMonth(startMonth);
|
|
|
searchEndTime = DateUtils.getLastDayOfMonth(endMonth);
|
|
@@ -723,22 +729,22 @@ public class RepairApplicationFormServiceImpl extends BaseServiceImpl<RepairAppl
|
|
|
repairApplicationFormDTO.setSearchEndTime(searchEndTime);
|
|
|
List<RepairApplicationFormVO> list = mapper.selectPageList(repairApplicationFormDTO);
|
|
|
List<RepairReport24VO> result = new ArrayList<RepairReport24VO>();
|
|
|
- for(Map<String, LocalDateTime> map: monthStartAndEndList){
|
|
|
+ for (Map<String, LocalDateTime> map : monthStartAndEndList) {
|
|
|
RepairReport24VO vo = new RepairReport24VO();
|
|
|
List<RepairApplicationFormVO> detailList = new ArrayList<RepairApplicationFormVO>();
|
|
|
vo.setMonth(map.get("searchStartTimeMonth").getYear() + "-" + map.get("searchStartTimeMonth").getMonthValue() + "月");
|
|
|
int i = 0;
|
|
|
- for(RepairApplicationFormVO repairApplicationForm: list){
|
|
|
- if(repairApplicationForm.getDealMinutes() == null){
|
|
|
+ for (RepairApplicationFormVO repairApplicationForm : list) {
|
|
|
+ if (repairApplicationForm.getDealMinutes() == null) {
|
|
|
continue;
|
|
|
}
|
|
|
- if(type == 1){
|
|
|
+ if (type == 1) {
|
|
|
double minites = repairApplicationForm.getDealMinutes();
|
|
|
- if(minites/60.0<24.0){
|
|
|
+ if (minites / 60.0 < 24.0) {
|
|
|
continue;
|
|
|
}
|
|
|
}
|
|
|
- if(repairApplicationForm.getApplyTime().isAfter(map.get("searchStartTimeMonth")) && repairApplicationForm.getApplyTime().isBefore(map.get("searchEndTimeMonth"))){
|
|
|
+ if (repairApplicationForm.getApplyTime().isAfter(map.get("searchStartTimeMonth")) && repairApplicationForm.getApplyTime().isBefore(map.get("searchEndTimeMonth"))) {
|
|
|
i++;
|
|
|
detailList.add(repairApplicationForm);
|
|
|
}
|
|
@@ -755,21 +761,21 @@ public class RepairApplicationFormServiceImpl extends BaseServiceImpl<RepairAppl
|
|
|
* 2:如果不是当前年份,则统计全年的
|
|
|
*
|
|
|
* @param repairApplicationFormDTO
|
|
|
- * @param searchYear 查询年份
|
|
|
+ * @param searchYear 查询年份
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
- public List<RepairReportMttr> getMonthReportMtrr(RepairApplicationFormDTO repairApplicationFormDTO, Integer searchYear, LocalDate startMonth, LocalDate endMonth ) {
|
|
|
+ public List<RepairReportMttr> getMonthReportMtrr(RepairApplicationFormDTO repairApplicationFormDTO, Integer searchYear, LocalDate startMonth, LocalDate endMonth) {
|
|
|
|
|
|
List<Map<String, LocalDateTime>> monthStartAndEndList = new ArrayList<Map<String, LocalDateTime>>();
|
|
|
LocalDateTime searchStartTime = null;
|
|
|
LocalDateTime searchEndTime = null;
|
|
|
- if(searchYear != null){
|
|
|
+ if (searchYear != null) {
|
|
|
LocalDate localDate = LocalDate.now();
|
|
|
int year = localDate.getYear();
|
|
|
// 如2021-10-15号码,则month=10,需要计算到11月份,需要加1
|
|
|
int month = localDate.getMonthValue() + 1;
|
|
|
- if(searchYear<year){
|
|
|
+ if (searchYear < year) {
|
|
|
month = 12;
|
|
|
year = searchYear;
|
|
|
}
|
|
@@ -777,7 +783,7 @@ public class RepairApplicationFormServiceImpl extends BaseServiceImpl<RepairAppl
|
|
|
// 当前年份只统计到当前月,历史年份统计全年
|
|
|
searchStartTime = DateUtils.getFirstDayOfThisYear(year);
|
|
|
searchEndTime = DateUtils.getLastDayOfMonth(year, month);
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
monthStartAndEndList = DateUtils.getMonthStartAndEndByYear(startMonth, endMonth);
|
|
|
searchStartTime = DateUtils.getFirstDayOfMonth(startMonth);
|
|
|
searchEndTime = DateUtils.getLastDayOfMonth(endMonth);
|
|
@@ -793,28 +799,28 @@ public class RepairApplicationFormServiceImpl extends BaseServiceImpl<RepairAppl
|
|
|
List<RepairApplicationFormVO> list = mapper.selectPageList(repairApplicationFormDTO);
|
|
|
|
|
|
List<RepairReportMttr> result = new ArrayList<RepairReportMttr>();
|
|
|
- for(Map<String, LocalDateTime> map: monthStartAndEndList){
|
|
|
+ for (Map<String, LocalDateTime> map : monthStartAndEndList) {
|
|
|
RepairReportMttr vo = new RepairReportMttr();
|
|
|
List<RepairApplicationFormVO> detailList = new ArrayList<RepairApplicationFormVO>();
|
|
|
vo.setMonth(map.get("searchStartTimeMonth").getYear() + "-" + map.get("searchStartTimeMonth").getMonthValue() + "月");
|
|
|
double totalMinuties = 0.0;
|
|
|
double meanMinuties = 0.0;
|
|
|
int i = 0;
|
|
|
- for(RepairApplicationFormVO repairApplicationForm: list){
|
|
|
- if(repairApplicationForm.getDealMinutes() == null || ((repairApplicationForm.getDealMinutes()/60.0)>24.0)){
|
|
|
+ for (RepairApplicationFormVO repairApplicationForm : list) {
|
|
|
+ if (repairApplicationForm.getDealMinutes() == null || ((repairApplicationForm.getDealMinutes() / 60.0) > 24.0)) {
|
|
|
continue;
|
|
|
}
|
|
|
- if(repairApplicationForm.getApplyTime().isAfter(map.get("searchStartTimeMonth")) && repairApplicationForm.getApplyTime().isBefore(map.get("searchEndTimeMonth"))){
|
|
|
+ if (repairApplicationForm.getApplyTime().isAfter(map.get("searchStartTimeMonth")) && repairApplicationForm.getApplyTime().isBefore(map.get("searchEndTimeMonth"))) {
|
|
|
i++;
|
|
|
detailList.add(repairApplicationForm);
|
|
|
totalMinuties = totalMinuties + repairApplicationForm.getDealMinutes();
|
|
|
}
|
|
|
}
|
|
|
- if(totalMinuties == 0.0){
|
|
|
+ if (totalMinuties == 0.0) {
|
|
|
meanMinuties = 0.0;
|
|
|
- }else{
|
|
|
- totalMinuties = BigDecimalUtil.decimal(totalMinuties/60, 2);
|
|
|
- meanMinuties = BigDecimalUtil.decimal(totalMinuties/i, 2);
|
|
|
+ } else {
|
|
|
+ totalMinuties = BigDecimalUtil.decimal(totalMinuties / 60, 2);
|
|
|
+ meanMinuties = BigDecimalUtil.decimal(totalMinuties / i, 2);
|
|
|
}
|
|
|
vo.setTotalHours(totalMinuties);
|
|
|
vo.setMttr(meanMinuties);
|
|
@@ -822,7 +828,7 @@ public class RepairApplicationFormServiceImpl extends BaseServiceImpl<RepairAppl
|
|
|
vo.setDetailList(detailList);
|
|
|
result.add(vo);
|
|
|
}
|
|
|
- for(RepairReportMttr r: result){
|
|
|
+ for (RepairReportMttr r : result) {
|
|
|
System.out.println(r.toString());
|
|
|
}
|
|
|
return result;
|
|
@@ -871,12 +877,13 @@ public class RepairApplicationFormServiceImpl extends BaseServiceImpl<RepairAppl
|
|
|
applicationForm.getId(), MessageTemplateUtil.getFreemarkerHtmlContentCheck(repairUrl,BeanConverterUtil.copyObjectProperties(applicationForm, RepairApplicationFormDTO.class), BeanConverterUtil.copyObjectProperties(info, SbInfoVO.class)),
|
|
|
applicationForm.getId(), ListUtils.newArrayList(userVO.getUserId()), ListUtils.newArrayList(userVO.getEmail())));
|
|
|
}else{*/
|
|
|
- applicationForm.setCheckEndTime(LocalDateTime.now());
|
|
|
- applicationForm.setStatus(RepairApplicationFormStatusEnum.FINISHED.getValue());
|
|
|
+ applicationForm.setCheckEndTime(LocalDateTime.now());
|
|
|
+ applicationForm.setStatus(RepairApplicationFormStatusEnum.FINISHED.getValue());
|
|
|
// }
|
|
|
applicationForm.setUpdateTime(applicationForm.getCheckEndTime());
|
|
|
super.modModelByPrimaryKey(applicationForm);
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 验收是主管验收,驳回到待审核状态
|
|
|
*
|
|
@@ -902,15 +909,15 @@ public class RepairApplicationFormServiceImpl extends BaseServiceImpl<RepairAppl
|
|
|
public int countTask(String sbId, String userId, Integer searchType) {
|
|
|
Weekend<RepairApplicationForm> weekend = new Weekend<>(RepairApplicationForm.class);
|
|
|
WeekendCriteria<RepairApplicationForm, Object> weekendCriteria = weekend.weekendCriteria();
|
|
|
- if(StringUtils.isNotBlank(sbId)){
|
|
|
+ if (StringUtils.isNotBlank(sbId)) {
|
|
|
weekendCriteria.andEqualTo(RepairApplicationForm::getSbId, sbId);
|
|
|
}
|
|
|
- if(StringUtils.isNotBlank(userId)){
|
|
|
- if(searchType == 1){
|
|
|
+ if (StringUtils.isNotBlank(userId)) {
|
|
|
+ if (searchType == 1) {
|
|
|
weekendCriteria.andEqualTo(RepairApplicationForm::getUserId, userId);
|
|
|
- }else if(searchType == 2){
|
|
|
+ } else if (searchType == 2) {
|
|
|
weekendCriteria.andEqualTo(RepairApplicationForm::getRepairUserId, userId);
|
|
|
- }else if(searchType == 3){
|
|
|
+ } else if (searchType == 3) {
|
|
|
weekendCriteria.andEqualTo(RepairApplicationForm::getCheckUserId, userId);
|
|
|
}
|
|
|
}
|