LAPTOP-FO2T5SIU\35838 8 달 전
부모
커밋
2b95905305

+ 36 - 0
pro-base/src/main/java/com/idea/customerManagement/controller/BuyerController.java

@@ -0,0 +1,36 @@
+package com.idea.customerManagement.controller;
+
+import com.github.pagehelper.PageInfo;
+import com.idea.customerManagement.dto.CustomerManagementDto;
+import com.idea.customerManagement.model.Buyer;
+import com.idea.customerManagement.service.BuyerService;
+import com.rockstar.common.base.BaseController;
+import com.rockstar.frame.model.extend.DateTrans;
+import com.rockstar.frame.model.extend.TableSplitResult;
+import com.rockstar.frame.model.extend.Tablepar;
+import io.swagger.annotations.Api;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import java.util.List;
+
+@Controller
+@RequestMapping(value = "BuyerController")
+@Api(tags = "买受人管理")
+public class BuyerController extends BaseController {
+
+    @Autowired
+    private BuyerService modelService;
+
+    @PostMapping(value = "listAll",produces = {"application/json;charset=UTF-8"})
+    @ResponseBody
+    public Object listAll(Buyer model, DateTrans dt){
+        List<Buyer> buyers = modelService.listAll(model, dt);
+        return buyers;
+    }
+
+
+}

+ 5 - 1
pro-base/src/main/java/com/idea/customerManagement/controller/ContractManageController.java

@@ -57,7 +57,11 @@ public class ContractManageController extends BaseController {
         return result(result);
     }
 
-
+    @PostMapping(value = "getById",produces = {"application/json;charset=UTF-8"})
+    @ResponseBody
+    public Object getById(String id) {
+        return modelService.getById(id);
+    }
 
 
 

+ 10 - 0
pro-base/src/main/java/com/idea/customerManagement/model/ContractManage.java

@@ -1,6 +1,8 @@
 package com.idea.customerManagement.model;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
 
 import java.io.Serializable;
 import java.math.BigDecimal;
@@ -28,6 +30,8 @@ public class ContractManage implements Serializable {
 
     private String institution;
 
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
     private Date signingDate;
 
     private BigDecimal housePrice;
@@ -42,6 +46,8 @@ public class ContractManage implements Serializable {
 
     private Integer paymentMethod;
 
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
     private Date deadline;
 
     private BigDecimal maintenanceFunds;
@@ -56,8 +62,12 @@ public class ContractManage implements Serializable {
 
     private String createdId;
 
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
     private Date createdAt;
 
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
     private Date updatedAt;
 
     private String updatedId;

+ 26 - 0
pro-base/src/main/java/com/idea/customerManagement/service/BuyerService.java

@@ -5,6 +5,8 @@ import com.idea.customerManagement.mapper.BuyerMapper;
 import com.idea.customerManagement.model.Buyer;
 import com.idea.customerManagement.model.BuyerExample;
 import com.rockstar.common.base.BaseService;
+import com.rockstar.frame.model.extend.DateTrans;
+import com.rockstar.util.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -62,4 +64,28 @@ public class BuyerService implements BaseService<Buyer, BuyerExample> {
     public int deleteByExample(BuyerExample buyerExample) {
         return modelMapper.deleteByExample(buyerExample);
     }
+
+    public List<Buyer> listAll(Buyer model,DateTrans dt){
+        List<Buyer> buyers = modelMapper.selectByExample(getCondition(model, dt));
+        return buyers;
+    }
+
+    public BuyerExample getCondition(Buyer model, DateTrans dt){
+
+        BuyerExample example = new BuyerExample();
+        example.setOrderByClause("order_num asc");
+        BuyerExample.Criteria criteria = example.createCriteria();
+        if(StringUtils.isNotEmpty(model.getCustomerManagementId())){
+            criteria.andCustomerManagementIdEqualTo(model.getCustomerManagementId());
+        }
+        return example;
+    }
+
+
+
+
+
+
+
+
 }

+ 10 - 0
pro-base/src/main/java/com/idea/customerManagement/service/ContractManageService.java

@@ -1,5 +1,6 @@
 package com.idea.customerManagement.service;
 
+import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.util.IdUtil;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
@@ -161,4 +162,13 @@ public class ContractManageService implements BaseService<ContractManage, Contra
         return result;
     }
 
+
+    public ContractManageDto getById(String id) {
+        ContractManage contractManage = selectByPrimaryKey(id);
+        ContractManageDto result = new ContractManageDto();
+        BeanUtil.copyProperties(contractManage,result);
+        return result;
+    }
+
+
 }