|
|
@@ -14,62 +14,66 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
* @email 771190883@qq.com
|
|
|
* @date 2019/10/29
|
|
|
*/
|
|
|
-public class ContractServiceTest extends ZhumjApplicationTests {
|
|
|
+public class ContractServiceTest extends ZhumjApplicationTests {
|
|
|
|
|
|
@Autowired
|
|
|
private ContractService contractService;
|
|
|
|
|
|
@Test
|
|
|
- public void save(){
|
|
|
+ public void save() {
|
|
|
String contractJson =
|
|
|
-"{\n" +
|
|
|
- "\t\"contractNumber\": \"201910290001\",\n" +
|
|
|
- "\t\"coFullName\": \"北京科技有限服务公司\",\n" +
|
|
|
- "\t\"coSimpleName\": \"北京科技有限服务\",\n" +
|
|
|
- "\t\"deposit\": 800,\n" +
|
|
|
- "\t\"monthlyRent\": 1300,\n" +
|
|
|
- "\t\"contractTotalRent\": 13600,\n" +
|
|
|
- "\t\"contractBeginTime\": \"2019-10-01 00:00:00\",\n" +
|
|
|
- "\t\"contractEndTime\": \"2020-10-01 00:00:00\",\n" +
|
|
|
- "\t\"contractDays\": 360,\n" +
|
|
|
- "\t\"contractMonthly\": 12,\n" +
|
|
|
- "\t\"payType\": \"付二押一\",\n" +
|
|
|
- "\t\"contractRenewals\": 0,\n" +
|
|
|
- "\t\"saleName\": \"王昊\",\n" +
|
|
|
- "\t\"saleId\": 352,\n" +
|
|
|
- "\t\"departmentId\": 93952099,\n" +
|
|
|
- "\t\"departmentName\": \"销售1组\",\n" +
|
|
|
- "\t\"customerSource\": \"NETWORK\",\n" +
|
|
|
- "\t\"contactAddress\": \"北京科技大厦\",\n" +
|
|
|
- "\t\"status\": \"STAY_IN\",\n" +
|
|
|
- "\t\"enabled\": true,\n" +
|
|
|
- "\t\"contactsList\": [{\n" +
|
|
|
- "\t\t\"contractNumber\": \"201910290001\",\n" +
|
|
|
- "\t\t\"name\": \"王飞\",\n" +
|
|
|
- "\t\t\"mobile\": \"152525212012\",\n" +
|
|
|
- "\t\t\"enabled\": true\n" +
|
|
|
- "\t}, {\n" +
|
|
|
- "\t\t\"contractNumber\": \"201910290001\",\n" +
|
|
|
- "\t\t\"name\": \"王楠\",\n" +
|
|
|
- "\t\t\"mobile\": \"15252363252\",\n" +
|
|
|
- "\t\t\"enabled\": true\n" +
|
|
|
- "\t}],\n" +
|
|
|
- "\t\"roomList\": [{\n" +
|
|
|
- "\t\t\"contractNumber\": \"201910290001\",\n" +
|
|
|
- "\t\t\"roomType\": \"两室一厅\",\n" +
|
|
|
- "\t\t\"beds\": 6,\n" +
|
|
|
- "\t\t\"price\": 500,\n" +
|
|
|
- "\t\t\"enabled\": true\n" +
|
|
|
- "\t}, {\n" +
|
|
|
- "\t\t\"contractNumber\": \"201910290001\",\n" +
|
|
|
- "\t\t\"roomType\": \"四室两厅\",\n" +
|
|
|
- "\t\t\"beds\": 8,\n" +
|
|
|
- "\t\t\"price\": 800,\n" +
|
|
|
- "\t\t\"enabled\": true\n" +
|
|
|
- "\t}]\n" +
|
|
|
- "}";
|
|
|
- Contract contract = JSONObject.parseObject(contractJson,Contract.class);
|
|
|
+ "{\n" +
|
|
|
+ "\t\"contractNumber\": \"201910290001\",\n" +
|
|
|
+ "\t\"coFullName\": \"北京科技有限服务公司\",\n" +
|
|
|
+ "\t\"coSimpleName\": \"北京科技有限服务\",\n" +
|
|
|
+ "\t\"deposit\": 800,\n" +
|
|
|
+ "\t\"monthlyRent\": 1300,\n" +
|
|
|
+ "\t\"contractTotalRent\": 13600,\n" +
|
|
|
+ "\t\"contractBeginTime\": \"2019-10-01 00:00:00\",\n" +
|
|
|
+ "\t\"contractEndTime\": \"2020-10-01 00:00:00\",\n" +
|
|
|
+ "\t\"contractDays\": 360,\n" +
|
|
|
+ "\t\"contractMonthly\": 12,\n" +
|
|
|
+ "\t\"payType\": \"付二押一\",\n" +
|
|
|
+ "\t\"contractRenewals\": 0,\n" +
|
|
|
+ "\t\"saleName\": \"王昊\",\n" +
|
|
|
+ "\t\"saleId\": 352,\n" +
|
|
|
+ "\t\"departmentId\": 93952099,\n" +
|
|
|
+ "\t\"departmentName\": \"销售1组\",\n" +
|
|
|
+ "\t\"customerSource\": \"NETWORK\",\n" +
|
|
|
+ "\t\"contactAddress\": \"北京科技大厦\",\n" +
|
|
|
+ "\t\"status\": \"STAY_IN\",\n" +
|
|
|
+ "\t\"enabled\": true,\n" +
|
|
|
+ "\t\"contactsList\": [{\n" +
|
|
|
+ "\t\t\"contractNumber\": \"201910290001\",\n" +
|
|
|
+ "\t\t\"name\": \"王飞\",\n" +
|
|
|
+ "\t\t\"mobile\": \"152525212012\",\n" +
|
|
|
+ "\t\t\"enabled\": true\n" +
|
|
|
+ "\t}, {\n" +
|
|
|
+ "\t\t\"contractNumber\": \"201910290001\",\n" +
|
|
|
+ "\t\t\"name\": \"王楠\",\n" +
|
|
|
+ "\t\t\"mobile\": \"15252363252\",\n" +
|
|
|
+ "\t\t\"enabled\": true\n" +
|
|
|
+ "\t}],\n" +
|
|
|
+ "\t\"roomList\": [{\n" +
|
|
|
+ "\t\t\"contractNumber\": \"201910290001\",\n" +
|
|
|
+ "\t\t\"roomType\": \"两室一厅\",\n" +
|
|
|
+ "\t\t\"beds\": 6,\n" +
|
|
|
+ "\t\t\"price\": 500,\n" +
|
|
|
+ "\t\t\"enabled\": true\n" +
|
|
|
+ "\t}, {\n" +
|
|
|
+ "\t\t\"contractNumber\": \"201910290001\",\n" +
|
|
|
+ "\t\t\"roomType\": \"四室两厅\",\n" +
|
|
|
+ "\t\t\"beds\": 8,\n" +
|
|
|
+ "\t\t\"price\": 800,\n" +
|
|
|
+ "\t\t\"enabled\": true\n" +
|
|
|
+ "\t}]\n" +
|
|
|
+ "}";
|
|
|
+ Contract contract = JSONObject.parseObject(contractJson, Contract.class);
|
|
|
contractService.save(contract);
|
|
|
}
|
|
|
|
|
|
+ @Test
|
|
|
+ public void addContractBills() {
|
|
|
+ contractService.addContractBills();
|
|
|
+ }
|
|
|
}
|