|
|
@@ -82,14 +82,14 @@ public class ContractController extends BaseController {
|
|
|
@Autowired
|
|
|
private BuildTypeService buildTypeService;
|
|
|
|
|
|
-
|
|
|
+
|
|
|
@Autowired
|
|
|
private ElectricReadService electricReadService;
|
|
|
|
|
|
@GetMapping(value = "/list")
|
|
|
public String list(
|
|
|
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
|
|
|
- String keyword, ModelMap modelMap,String item_selected) throws Exception {
|
|
|
+ String keyword, ModelMap modelMap, String item_selected) throws Exception {
|
|
|
try {
|
|
|
log.debug("分页查询合同列表参数! pageNum = {}, keyword = {}", pageNum, keyword);
|
|
|
PageInfo<Contract> pageInfo = contractService.findPage(pageNum, PAGESIZE, keyword, false);
|
|
|
@@ -106,7 +106,7 @@ public class ContractController extends BaseController {
|
|
|
@GetMapping(value = "/listByStatus")
|
|
|
public String listByStatus(
|
|
|
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
|
|
|
- String keyword, ModelMap modelMap,String item_selected) throws Exception {
|
|
|
+ String keyword, ModelMap modelMap, String item_selected) throws Exception {
|
|
|
try {
|
|
|
log.debug("分页查询合同列表参数! pageNum = {}, keyword = {}", pageNum, keyword);
|
|
|
PageInfo<Contract> pageInfo = contractService.findPage(pageNum, PAGESIZE, keyword, true);
|
|
|
@@ -123,7 +123,7 @@ public class ContractController extends BaseController {
|
|
|
@GetMapping(value = "/endList")
|
|
|
public String endList(
|
|
|
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
|
|
|
- String keyword, ModelMap modelMap,String item_selected) throws Exception {
|
|
|
+ String keyword, ModelMap modelMap, String item_selected) throws Exception {
|
|
|
try {
|
|
|
log.debug("分页查询合同列表参数! pageNum = {}, keyword = {}", pageNum, keyword);
|
|
|
PageInfo<Contract> pageInfo = contractService.findEndContractPage(pageNum, PAGESIZE, keyword);
|
|
|
@@ -167,13 +167,13 @@ public class ContractController extends BaseController {
|
|
|
ModelMap messagesMap = new ModelMap();
|
|
|
//是否存在相同合同编号,是则是重复提交
|
|
|
Contract existContract = contractService.findByContractNo(contract.getContract_no());
|
|
|
- if( null != existContract) {
|
|
|
- messagesMap.put("status", FAILURE);
|
|
|
+ if (null != existContract) {
|
|
|
+ messagesMap.put("status", FAILURE);
|
|
|
messagesMap.put("message", "请勿重复提交!");
|
|
|
return messagesMap;
|
|
|
- }
|
|
|
+ }
|
|
|
log.debug("添加合同参数! contract = {}", contract);
|
|
|
-
|
|
|
+
|
|
|
Boolean flag = contractService.saveContract(contract);
|
|
|
|
|
|
if (flag) {
|
|
|
@@ -672,12 +672,12 @@ public class ContractController extends BaseController {
|
|
|
|
|
|
Company company = companyService.findByCompanyName(company_name);
|
|
|
if (null != company) {
|
|
|
- if(null != company.getType_id()) {
|
|
|
- BuildType buildType = buildTypeService.findById(company.getType_id());
|
|
|
+ if (null != company.getType_id()) {
|
|
|
+ BuildType buildType = buildTypeService.findById(company.getType_id());
|
|
|
if (null != buildType) {
|
|
|
company.setType_name(buildType.getType());
|
|
|
}
|
|
|
- }
|
|
|
+ }
|
|
|
}
|
|
|
if (null != company) {
|
|
|
company.setCompanyContacts(companyContactService.findByCompanyId(company.getId()));
|
|
|
@@ -689,7 +689,6 @@ public class ContractController extends BaseController {
|
|
|
return ResponseMessage.error("不存在所输入公司,请先新增公司。");
|
|
|
}
|
|
|
|
|
|
-
|
|
|
/***
|
|
|
* 选择客户(公司)
|
|
|
* @return
|
|
|
@@ -702,7 +701,7 @@ public class ContractController extends BaseController {
|
|
|
log.debug("分页查询合同列表参数! pageNum = {}, keyword = {}", pageNum, keyword);
|
|
|
CompanyDto companyDto = new CompanyDto();
|
|
|
companyDto.setIs_start(true);
|
|
|
- PageInfo<Company> pageInfo = companyService.findPage(pageNum, PAGESIZE, keyword, companyDto);
|
|
|
+ PageInfo<Company> pageInfo = companyService.findPage(pageNum, PAGESIZE, keyword, true, companyDto);
|
|
|
log.info("分页查询合同列表结果! pageInfo = {}", pageInfo);
|
|
|
modelMap.put("pageInfo", pageInfo);
|
|
|
modelMap.put("keyword", keyword);
|
|
|
@@ -717,7 +716,7 @@ public class ContractController extends BaseController {
|
|
|
if (null != contract) {
|
|
|
List<Attachment> attachments = attachmentService.selectByIdAndBusinessId(Constant.Attachment.CONTRACT, contract.getId(), null);
|
|
|
if (null != attachments && attachments.size() > 0) {
|
|
|
- FileDown fileDown = new FileDown(attachments.get(0).getId(), attachments.get(0).getFile_name(), attachments.get(0).getFile_url(),attachments.get(0).getDownload_uri());
|
|
|
+ FileDown fileDown = new FileDown(attachments.get(0).getId(), attachments.get(0).getFile_name(), attachments.get(0).getFile_url(), attachments.get(0).getDownload_uri());
|
|
|
contract.setFileDown(fileDown);
|
|
|
return fileDown;
|
|
|
}
|