Commit 1f51dbda authored by chenyuefang's avatar chenyuefang

update

parent 866c1b33
...@@ -59,8 +59,8 @@ public class CbQuantitySummaryController extends BaseController { ...@@ -59,8 +59,8 @@ public class CbQuantitySummaryController extends BaseController {
*/ */
@GetMapping(value = "/conversionNotice") @GetMapping(value = "/conversionNotice")
public R conversionNotice(CbQuantitySummaryListBo bo) { public R conversionNotice(CbQuantitySummaryListBo bo) {
baseService.conversionNotice(bo);
return R.ok(); return baseService.conversionNotice(bo);
} }
/** /**
......
package com.dsk.cscec.service; package com.dsk.cscec.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.dsk.common.core.domain.R;
import com.dsk.cscec.domain.CbQuantitySummary; import com.dsk.cscec.domain.CbQuantitySummary;
import com.dsk.cscec.domain.CbQuantitySummaryActual; import com.dsk.cscec.domain.CbQuantitySummaryActual;
import com.dsk.cscec.domain.bo.CbProjectBaseBo; import com.dsk.cscec.domain.bo.CbProjectBaseBo;
...@@ -30,6 +31,6 @@ public interface ICbQuantitySummaryService extends IService<CbQuantitySummary> { ...@@ -30,6 +31,6 @@ public interface ICbQuantitySummaryService extends IService<CbQuantitySummary> {
boolean batchInsert(List<CbQuantitySummary> list); boolean batchInsert(List<CbQuantitySummary> list);
void conversionNotice(CbQuantitySummaryListBo bo); R conversionNotice(CbQuantitySummaryListBo bo);
} }
...@@ -12,6 +12,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; ...@@ -12,6 +12,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dsk.common.constant.GlobalConstants; import com.dsk.common.constant.GlobalConstants;
import com.dsk.common.core.domain.R;
import com.dsk.common.exception.ServiceException; import com.dsk.common.exception.ServiceException;
import com.dsk.common.helper.LoginHelper; import com.dsk.common.helper.LoginHelper;
import com.dsk.common.utils.redis.RedisUtils; import com.dsk.common.utils.redis.RedisUtils;
...@@ -161,7 +162,7 @@ public class CbQuantitySummaryServiceImpl extends ServiceImpl<CbQuantitySummaryM ...@@ -161,7 +162,7 @@ public class CbQuantitySummaryServiceImpl extends ServiceImpl<CbQuantitySummaryM
} }
@Override @Override
public void conversionNotice(CbQuantitySummaryListBo bo) { public R conversionNotice(CbQuantitySummaryListBo bo) {
if (StringUtil.isBlank(bo.getRecordDate())) { if (StringUtil.isBlank(bo.getRecordDate())) {
//默认当前月 //默认当前月
bo.setRecordDate(DatePattern.SIMPLE_MONTH_FORMAT.format(new Date())); bo.setRecordDate(DatePattern.SIMPLE_MONTH_FORMAT.format(new Date()));
...@@ -169,13 +170,13 @@ public class CbQuantitySummaryServiceImpl extends ServiceImpl<CbQuantitySummaryM ...@@ -169,13 +170,13 @@ public class CbQuantitySummaryServiceImpl extends ServiceImpl<CbQuantitySummaryM
//是否是实体工程材料 //是否是实体工程材料
CbSubject cbSubject = cbSubjectMapper.selectOne(new LambdaQueryWrapper<CbSubject>().eq(CbSubject::getCbSubjectName, bo.getCbSubjectName())); CbSubject cbSubject = cbSubjectMapper.selectOne(new LambdaQueryWrapper<CbSubject>().eq(CbSubject::getCbSubjectName, bo.getCbSubjectName()));
if (ObjectUtil.isNull(cbSubject)) { if (ObjectUtil.isNull(cbSubject)) {
return; return R.ok();
} }
if (cbSubject.getCbSubjectNo().startsWith("FG") || cbSubject.getCbSubjectNo().startsWith("JD")) { if (cbSubject.getCbSubjectNo().startsWith("FG") || cbSubject.getCbSubjectNo().startsWith("JD")) {
//是否存在未换算数据 //是否存在未换算数据
List<CbQuantitySummaryListVo> unconvertedList = baseMapper.unconvertedList(bo); List<CbQuantitySummaryListVo> unconvertedList = baseMapper.unconvertedList(bo);
if (CollectionUtil.isEmpty(unconvertedList)) { if (CollectionUtil.isEmpty(unconvertedList)) {
return; return R.ok();
} }
//是否提示 //是否提示
String key = GlobalConstants.UNIT_CONVERSION_NOTICE + LoginHelper.getUserId() + "_" + bo.getProjectId() + "_" + bo.getCbSubjectName() + "_" + bo.getRecordDate(); String key = GlobalConstants.UNIT_CONVERSION_NOTICE + LoginHelper.getUserId() + "_" + bo.getProjectId() + "_" + bo.getCbSubjectName() + "_" + bo.getRecordDate();
...@@ -183,11 +184,11 @@ public class CbQuantitySummaryServiceImpl extends ServiceImpl<CbQuantitySummaryM ...@@ -183,11 +184,11 @@ public class CbQuantitySummaryServiceImpl extends ServiceImpl<CbQuantitySummaryM
Date now = new Date(); Date now = new Date();
long expireTime = DateUtil.between(now, DateUtil.endOfDay(now), DateUnit.SECOND); long expireTime = DateUtil.between(now, DateUtil.endOfDay(now), DateUnit.SECOND);
RedisUtils.setCacheObject(key, "noticed", Duration.ofSeconds(expireTime)); RedisUtils.setCacheObject(key, "noticed", Duration.ofSeconds(expireTime));
Assert.isTrue(false, "系统检测到您近期未进行物料单位换算,请立即进行换算。"); return R.ok("系统检测到您近期未进行物料单位换算,请立即进行换算。", 500);
} }
} }
return R.ok();
} }
} }
...@@ -474,7 +474,7 @@ public class CbSummaryServiceImpl extends ServiceImpl<CbSummaryMapper, CbSummary ...@@ -474,7 +474,7 @@ public class CbSummaryServiceImpl extends ServiceImpl<CbSummaryMapper, CbSummary
if (unfilled.length() > 0) { if (unfilled.length() > 0) {
unfilled.deleteCharAt(unfilled.lastIndexOf("、")); unfilled.deleteCharAt(unfilled.lastIndexOf("、"));
unfilled.append(" 未填写成本,是否继续锁定?"); unfilled.append(" 未填写成本,是否继续锁定?");
return R.fail(unfilled.toString()); return R.ok(unfilled.toString(),500);
} else { } else {
return R.ok(); return R.ok();
} }
......
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