|
|
@ -15,6 +15,7 @@ import com.jianwei.common.core.domain.entity.SysUser; |
|
|
|
import com.jianwei.common.utils.BeanUtils; |
|
|
|
import com.jianwei.common.utils.poi.ExcelUtil; |
|
|
|
import com.kms.build.domain.BsSgcjsjdBuiProInfo; |
|
|
|
import com.kms.build.domain.vo.BsSgcJsjdBuiAttendanceInformationExcel; |
|
|
|
import com.kms.build.service.BsSgcjsjdBuiProInfoService; |
|
|
|
import com.kms.common.utils.BaseEntityUtils; |
|
|
|
|
|
|
@ -30,21 +31,15 @@ import com.kms.system.service.SysXzqhService; |
|
|
|
import io.swagger.annotations.Api; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.web.bind.annotation.GetMapping; |
|
|
|
import org.springframework.web.bind.annotation.PostMapping; |
|
|
|
import org.springframework.web.bind.annotation.PutMapping; |
|
|
|
import org.springframework.web.bind.annotation.DeleteMapping; |
|
|
|
import org.springframework.web.bind.annotation.PathVariable; |
|
|
|
import org.springframework.web.bind.annotation.RequestBody; |
|
|
|
import org.springframework.web.bind.annotation.RequestMapping; |
|
|
|
import org.springframework.web.bind.annotation.RestController; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
|
|
|
|
import com.jianwei.common.annotation.Log; |
|
|
|
import com.jianwei.common.core.domain.AjaxResult; |
|
|
|
import com.jianwei.common.enums.BusinessType; |
|
|
|
|
|
|
|
import org.springframework.web.multipart.MultipartFile; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
@ -154,9 +149,10 @@ public class BsSgcjsjdBuiProInfoController extends BaseController |
|
|
|
.eq(SpecialProjectProposal::getProNo, byId.getProNo()) |
|
|
|
.eq(SpecialProjectProposal::getProjectCode, byId.getProCode())); |
|
|
|
|
|
|
|
if (ObjectUtil.isNotEmpty(one)){ |
|
|
|
byId.setProjectName(one.getProjectName()); |
|
|
|
byId.setAdcd(one.getAdcd()); |
|
|
|
|
|
|
|
} |
|
|
|
return AjaxResult.success(byId); |
|
|
|
} |
|
|
|
|
|
|
@ -171,21 +167,15 @@ public class BsSgcjsjdBuiProInfoController extends BaseController |
|
|
|
public AjaxResult add(@RequestBody BsSgcjsjdBuiProInfo bsSgcjsjdBuiProInfo) |
|
|
|
{ |
|
|
|
BaseEntityUtils.preInsert(bsSgcjsjdBuiProInfo); |
|
|
|
if (bsSgcjsjdBuiProInfo.getIsApproval().equals("1")){ |
|
|
|
QueryWrapper<SpecialProjectProposal> qw=new QueryWrapper<>(); |
|
|
|
SpecialProjectProposal one = specialProjectProposalService.getOne(qw.eq("project_code", bsSgcjsjdBuiProInfo.getProCode()).eq("pro_no", bsSgcjsjdBuiProInfo.getProNo())); |
|
|
|
if (ObjectUtil.isNotEmpty(one)){ |
|
|
|
//设置项目在建状态
|
|
|
|
UpdateWrapper<SpecialProjectProposal> updateWrapper = new UpdateWrapper<>(); |
|
|
|
updateWrapper.set("is_construction", "1"); |
|
|
|
updateWrapper.eq("project_code", bsSgcjsjdBuiProInfo.getProCode()); |
|
|
|
updateWrapper.eq("pro_no", bsSgcjsjdBuiProInfo.getProNo()); |
|
|
|
specialProjectProposalService.update(updateWrapper); |
|
|
|
}else { |
|
|
|
SpecialProjectProposal specialProjectProposal=new SpecialProjectProposal(); |
|
|
|
BeanUtils.copyBeanProp(specialProjectProposal,bsSgcjsjdBuiProInfo); |
|
|
|
specialProjectProposal.setProjectCode(bsSgcjsjdBuiProInfo.getProCode()); |
|
|
|
specialProjectProposal.setIsConstruction("1"); |
|
|
|
specialProjectProposalService.save(specialProjectProposal); |
|
|
|
} |
|
|
|
|
|
|
|
//设置总金额
|
|
|
@ -262,4 +252,37 @@ public class BsSgcjsjdBuiProInfoController extends BaseController |
|
|
|
{ |
|
|
|
return toAjax(bsSgcjsjdBuiProInfoService.removeByIds(Arrays.asList(ids))); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("/importData") |
|
|
|
@Transactional |
|
|
|
public AjaxResult importData(@RequestParam(value = "file") MultipartFile file) { |
|
|
|
ExcelUtil<BsSgcjsjdBuiProInfo> util = new ExcelUtil<>(BsSgcjsjdBuiProInfo.class); |
|
|
|
try { |
|
|
|
List<BsSgcjsjdBuiProInfo> list = util.importExcel(file.getInputStream()); |
|
|
|
list.remove(0); |
|
|
|
for (BsSgcjsjdBuiProInfo bsSgcjsjdBuiProInfo:list){ |
|
|
|
if (bsSgcjsjdBuiProInfo.getProjectUnitLegal().contains("1")) { |
|
|
|
String[] split = bsSgcjsjdBuiProInfo.getProjectUnitLegal().split( |
|
|
|
bsSgcjsjdBuiProInfo.getProjectUnitLegal().substring(bsSgcjsjdBuiProInfo.getProjectUnitLegal().indexOf("1") - 1, bsSgcjsjdBuiProInfo.getProjectUnitLegal().indexOf("1"))); |
|
|
|
|
|
|
|
if (split.length>=2){ |
|
|
|
bsSgcjsjdBuiProInfo.setProjectUnitLegal(split[0]); |
|
|
|
bsSgcjsjdBuiProInfo.setProjectUnitLegalPhone(split[1]); |
|
|
|
} |
|
|
|
SysXzqh one = sysXzqhService.getOne(new QueryWrapper<SysXzqh>().eq("NAME",bsSgcjsjdBuiProInfo.getParentAcad())); |
|
|
|
if (ObjectUtil.isNotEmpty(one)){ |
|
|
|
SysXzqh adcd = sysXzqhService.getOne(new QueryWrapper<SysXzqh>().eq("NAME",bsSgcjsjdBuiProInfo.getAdcd()).eq("PARENTID",one.getXzqhdm())); |
|
|
|
if (ObjectUtil.isNotEmpty(adcd)){ |
|
|
|
bsSgcjsjdBuiProInfo.setAdcd(adcd.getXzqhdm()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
bsSgcjsjdBuiProInfoService.saveOrUpdate(bsSgcjsjdBuiProInfo); |
|
|
|
} |
|
|
|
return AjaxResult.success(list); |
|
|
|
} catch (Exception e) { |
|
|
|
throw new RuntimeException(e); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|