|
|
@@ -26,6 +26,7 @@ import org.sky.scientific.mapper.XmBgrzMapper;
|
|
|
import org.sky.scientific.pojo.entity.XmBgrzEntity;
|
|
|
import org.sky.scientific.pojo.vo.XmBgrzVO;
|
|
|
import org.sky.scientific.service.IXmBgrzService;
|
|
|
+import org.sky.scientific.service.IXmService;
|
|
|
import org.sky.scientific.utils.TemplateService;
|
|
|
import org.sky.system.cache.DictCache;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
@@ -53,12 +54,14 @@ public class XmBgrzServiceImpl extends BaseServiceImpl<XmBgrzMapper, XmBgrzEntit
|
|
|
private final DepartmentMapper departmentMapper;
|
|
|
private final TechnicianMapper technicianMapper;
|
|
|
private final TemplateService templateService;
|
|
|
+ private final IXmService xmService;
|
|
|
|
|
|
@Override
|
|
|
public boolean saveBgrz(XmBgrzEntity xmBgrz) {
|
|
|
if (xmBgrz.getXmId() == null) {
|
|
|
throw new ServiceException("请选择需要变更的项目");
|
|
|
}
|
|
|
+ xmService.judgeXmIsOver(xmBgrz.getXmId(), true);
|
|
|
xmBgrz.setBghdz(StringUtil.trimAllWhitespace(xmBgrz.getBghdz()));
|
|
|
return this.save(xmBgrz);
|
|
|
}
|
|
|
@@ -79,33 +82,33 @@ public class XmBgrzServiceImpl extends BaseServiceImpl<XmBgrzMapper, XmBgrzEntit
|
|
|
vo.setBgqdzStr(vo.getBgqdz());
|
|
|
vo.setBghdz(technicianMapper.getNameById(Long.parseLong(vo.getBghdz())));
|
|
|
vo.setBghdzStr(vo.getBghdz());
|
|
|
- }else if ( "STATUS".equalsIgnoreCase(vo.getZdmc())) {
|
|
|
+ } else if ("STATUS".equalsIgnoreCase(vo.getZdmc())) {
|
|
|
vo.setBgqdz(DictCache.getValue("project_state", vo.getBgqdz()));
|
|
|
vo.setBgqdzStr(vo.getBgqdz());
|
|
|
vo.setBghdz(DictCache.getValue("project_state", vo.getBghdz()));
|
|
|
vo.setBghdzStr(vo.getBghdz());
|
|
|
- }else if ("XMYSZEMX".equalsIgnoreCase(vo.getZdmc())) {
|
|
|
- if(Func.isNotBlank(vo.getBgqdz())){
|
|
|
+ } else if ("XMYSZEMX".equalsIgnoreCase(vo.getZdmc())) {
|
|
|
+ if (Func.isNotBlank(vo.getBgqdz())) {
|
|
|
List<JSONObject> arr = JSON.parseArray(vo.getBgqdz(), JSONObject.class);
|
|
|
List<String> desc = new ArrayList<>();
|
|
|
for (JSONObject tmp : arr) {
|
|
|
String year = tmp.getString("year");
|
|
|
String amount = tmp.getString("amount");
|
|
|
- desc.add(year+"年,"+amount+"万元");
|
|
|
+ desc.add(year + "年," + amount + "万元");
|
|
|
}
|
|
|
vo.setBgqdzStr(String.join(";", desc));
|
|
|
}
|
|
|
- if(Func.isNotBlank(vo.getBghdz())){
|
|
|
+ if (Func.isNotBlank(vo.getBghdz())) {
|
|
|
List<JSONObject> arr = JSON.parseArray(vo.getBghdz(), JSONObject.class);
|
|
|
List<String> desc = new ArrayList<>();
|
|
|
for (JSONObject tmp : arr) {
|
|
|
String year = tmp.getString("year");
|
|
|
String amount = tmp.getString("amount");
|
|
|
- desc.add(year+"年,"+amount+"万元");
|
|
|
+ desc.add(year + "年," + amount + "万元");
|
|
|
}
|
|
|
vo.setBghdzStr(String.join(";", desc));
|
|
|
}
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
vo.setBgqdzStr(vo.getBgqdz());
|
|
|
vo.setBghdzStr(vo.getBghdz());
|
|
|
}
|