Commit 36c81675 authored by huyuchen's avatar huyuchen

项目基本信息推送

parent 20ff1922
...@@ -239,14 +239,14 @@ public class TSettleDomainController { ...@@ -239,14 +239,14 @@ public class TSettleDomainController {
/** /**
* 修改项目表 * 修改项目表
* *
* @param tSettleDomain 项目表 * @param list 项目表
* @return R * @return R
*/ */
@Operation(summary = "修改项目表", description = "修改项目表") @Operation(summary = "修改项目表", description = "修改项目表")
@SysLog("修改项目表") @SysLog("修改项目表")
@PostMapping("/updateProjectInfo") @PostMapping("/updateProjectInfo")
public R updateProjectInfo(@RequestBody TSettleDomain tSettleDomain) { public R updateProjectInfo(@RequestBody List<TSettleDomain> list) {
return tSettleDomainService.updateProjectInfo(tSettleDomain); return tSettleDomainService.updateProjectInfo(list);
} }
} }
...@@ -70,6 +70,6 @@ public interface TSettleDomainService extends IService<TSettleDomain> { ...@@ -70,6 +70,6 @@ public interface TSettleDomainService extends IService<TSettleDomain> {
**/ **/
List<TSettleDomainSelectVo> selectAllSettleDomainSelectVos(); List<TSettleDomainSelectVo> selectAllSettleDomainSelectVos();
R updateProjectInfo(TSettleDomain tSettleDomain); R updateProjectInfo(List<TSettleDomain> list);
} }
...@@ -117,32 +117,34 @@ public class TSettleDomainServiceImpl extends ServiceImpl<TSettleDomainMapper, T ...@@ -117,32 +117,34 @@ public class TSettleDomainServiceImpl extends ServiceImpl<TSettleDomainMapper, T
} }
@Override @Override
public R updateProjectInfo(TSettleDomain tSettleDomain) { public R updateProjectInfo(List<TSettleDomain> list) {
if (Common.isNotNull(tSettleDomain)) { if (Common.isNotNull(list)) {
for (TSettleDomain tSettleDomain:list) {
R<AreaVo> areaListR = upmsDaprUtils.getAreaListR(); R<AreaVo> areaListR = upmsDaprUtils.getAreaListR();
if (null == areaListR || areaListR.getCode() != CommonConstants.SUCCESS) { if (null == areaListR || areaListR.getCode() != CommonConstants.SUCCESS) {
return R.failed("获取区域数据失败!"); return R.failed("获取区域数据失败!");
} }
AreaVo areaList = areaListR.getData(); AreaVo areaList = areaListR.getData();
if (null != areaList && !areaList.getSysAreaList().isEmpty()) { if (null != areaList && !areaList.getSysAreaList().isEmpty()) {
for (SysArea area : areaList.getSysAreaList()) { for (SysArea area : areaList.getSysAreaList()) {
if (Common.isNotNull(tSettleDomain.getEProvince()) && area.getAreaName().equals(tSettleDomain.getEProvince())) { if (Common.isNotNull(tSettleDomain.getEProvince()) && area.getAreaName().equals(tSettleDomain.getEProvince())) {
tSettleDomain.setProvince(area.getId()); tSettleDomain.setProvince(area.getId());
} }
if (Common.isNotNull(tSettleDomain.getECity()) && area.getAreaName().equals(tSettleDomain.getECity())) { if (Common.isNotNull(tSettleDomain.getECity()) && area.getAreaName().equals(tSettleDomain.getECity())) {
tSettleDomain.setCity(area.getId()); tSettleDomain.setCity(area.getId());
} }
if (Common.isNotNull(tSettleDomain.getETown()) && area.getAreaName().equals(tSettleDomain.getETown())) { if (Common.isNotNull(tSettleDomain.getETown()) && area.getAreaName().equals(tSettleDomain.getETown())) {
tSettleDomain.setTown(area.getId()); tSettleDomain.setTown(area.getId());
}
} }
} }
} TSettleDomain tSettleDomainInfo = baseMapper.selectById(tSettleDomain.getId());
TSettleDomain tSettleDomainInfo = baseMapper.selectById(tSettleDomain.getId()); if (Common.isNotNull(tSettleDomainInfo)) {
if (Common.isNotNull(tSettleDomainInfo)) { baseMapper.updateById(tSettleDomain);
baseMapper.updateById(tSettleDomain); } else {
} else { baseMapper.insert(tSettleDomain);
baseMapper.insert(tSettleDomain); }
} }
return R.ok(); return R.ok();
} else { } else {
......
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