parent
a5f90b7b18
commit
96be942be1
11 changed files with 1252 additions and 941 deletions
@ -1,268 +1,263 @@ |
|||||||
package com.yipin.liuwanr.controller; |
package com.yipin.liuwanr.controller; |
||||||
|
|
||||||
import java.util.HashMap; |
|
||||||
|
|
||||||
import com.yipin.liuwanr.entity.School; |
|
||||||
import org.springframework.beans.factory.annotation.Autowired; |
|
||||||
import org.springframework.web.bind.annotation.CrossOrigin; |
|
||||||
import org.springframework.web.bind.annotation.GetMapping; |
|
||||||
import org.springframework.web.bind.annotation.PostMapping; |
|
||||||
import org.springframework.web.bind.annotation.RequestBody; |
|
||||||
import org.springframework.web.bind.annotation.RequestMapping; |
|
||||||
import org.springframework.web.bind.annotation.RequestParam; |
|
||||||
import org.springframework.web.bind.annotation.RestController; |
|
||||||
|
|
||||||
import com.yipin.liuwanr.entity.Customer; |
import com.yipin.liuwanr.entity.Customer; |
||||||
import com.yipin.liuwanr.entity.Response; |
import com.yipin.liuwanr.entity.Response; |
||||||
|
import com.yipin.liuwanr.entity.School; |
||||||
import com.yipin.liuwanr.entity.UserM; |
import com.yipin.liuwanr.entity.UserM; |
||||||
import com.yipin.liuwanr.helper.RedisHelper; |
import com.yipin.liuwanr.helper.RedisHelper; |
||||||
import com.yipin.liuwanr.service.CustomerService; |
import com.yipin.liuwanr.service.CustomerService; |
||||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||||
|
import org.springframework.web.bind.annotation.*; |
||||||
|
|
||||||
|
import java.util.HashMap; |
||||||
|
|
||||||
@RestController |
@RestController |
||||||
@RequestMapping("/customer") |
@RequestMapping("/customer") |
||||||
@CrossOrigin |
@CrossOrigin |
||||||
public class CustomerController { |
public class CustomerController { |
||||||
|
|
||||||
@Autowired |
@Autowired |
||||||
private CustomerService customerService; |
private CustomerService customerService; |
||||||
|
|
||||||
@Autowired |
@Autowired |
||||||
RedisHelper redisHelper; |
RedisHelper redisHelper; |
||||||
|
|
||||||
/** |
/** |
||||||
* 添加客户 |
* 添加客户 |
||||||
*/ |
*/ |
||||||
@PostMapping("/addCustomer") |
@PostMapping("/addCustomer") |
||||||
Response addCustomer(@RequestBody Customer customer) { |
Response addCustomer(@RequestBody Customer customer) { |
||||||
Response resp = new Response(); |
Response resp = new Response(); |
||||||
UserM userm = new UserM(); |
UserM userm = new UserM(); |
||||||
Integer provinceId = customer.getProvinceId(); |
Integer provinceId = customer.getProvinceId(); |
||||||
Integer cityId = customer.getCityId(); |
Integer cityId = customer.getCityId(); |
||||||
String countries = customer.getCountries(); |
String countries = customer.getCountries(); |
||||||
String phone = customer.getAdminPhone(); |
String phone = customer.getAdminPhone(); |
||||||
String email = customer.getEmail(); |
String email = customer.getEmail(); |
||||||
String name = customer.getAdminName(); |
String name = customer.getAdminName(); |
||||||
Integer schoolId = customer.getSchoolId(); |
Integer schoolId = customer.getSchoolId(); |
||||||
userm.setSchoolId(schoolId); |
userm.setSchoolId(schoolId); |
||||||
userm.setCityId(cityId); |
userm.setCityId(cityId); |
||||||
userm.setCountries(countries); |
userm.setCountries(countries); |
||||||
userm.setProvinceId(provinceId); |
userm.setProvinceId(provinceId); |
||||||
userm.setPhone(phone); |
userm.setPhone(phone); |
||||||
userm.setEmail(email); |
userm.setEmail(email); |
||||||
userm.setName(name); |
userm.setName(name); |
||||||
userm.setPassword("huoran123"); |
userm.setPassword("huoran123"); |
||||||
if (email==null||email==""){ |
if (email == null || email == "") { |
||||||
resp.setStatus(300); |
resp.setStatus(300); |
||||||
resp.setErrmessage("邮箱不能为空!"); |
resp.setErrmessage("邮箱不能为空!"); |
||||||
}if (phone==null||phone==""){ |
} |
||||||
resp.setStatus(300); |
if (phone == null || phone == "") { |
||||||
resp.setErrmessage("电话不能为空!"); |
resp.setStatus(300); |
||||||
}else if (name==null||name==""){ |
resp.setErrmessage("电话不能为空!"); |
||||||
resp.setStatus(300); |
} else if (name == null || name == "") { |
||||||
resp.setErrmessage("姓名不能为空!"); |
resp.setStatus(300); |
||||||
}else if (schoolId==null){ |
resp.setErrmessage("姓名不能为空!"); |
||||||
resp.setStatus(300); |
} else if (schoolId == null) { |
||||||
resp.setErrmessage("学校不能为空!"); |
resp.setStatus(300); |
||||||
}else if (provinceId==null){ |
resp.setErrmessage("学校不能为空!"); |
||||||
resp.setStatus(300); |
} else if (provinceId == null) { |
||||||
resp.setErrmessage("省份不能为空!"); |
resp.setStatus(300); |
||||||
}else if (cityId==null) { |
resp.setErrmessage("省份不能为空!"); |
||||||
resp.setStatus(300); |
} else if (cityId == null) { |
||||||
resp.setErrmessage("城市不能为空!"); |
resp.setStatus(300); |
||||||
} else { |
resp.setErrmessage("城市不能为空!"); |
||||||
HashMap<String, Object> ret = customerService.addCustomer(customer); |
} else { |
||||||
HashMap<String, Object> ret1 = customerService.addAdmin(userm); |
HashMap<String, Object> ret = customerService.addCustomer(customer); |
||||||
int status = (int) ret.get("retcode"); |
HashMap<String, Object> ret1 = customerService.addAdmin(userm); |
||||||
if (200 == status) { |
int status = (int) ret.get("retcode"); |
||||||
resp.setStatus(status); |
if (200 == status) { |
||||||
resp.setMessage(ret.get("retvalue")); |
resp.setStatus(status); |
||||||
} else { |
resp.setMessage(ret.get("retvalue")); |
||||||
resp.setStatus(status); |
} else { |
||||||
resp.setErrmessage(ret.get("retvalue").toString()); |
resp.setStatus(status); |
||||||
} |
resp.setErrmessage(ret.get("retvalue").toString()); |
||||||
} |
} |
||||||
return resp; |
} |
||||||
} |
return resp; |
||||||
|
} |
||||||
/** |
|
||||||
* 查询客户 |
/** |
||||||
*/ |
* 查询客户 |
||||||
@GetMapping("/queryCustomer") |
*/ |
||||||
Response queryCustomer(@RequestParam String countries,Integer provinceId,Integer cityId,Integer pageNo,Integer pageSize,String searchContent) { |
@GetMapping("/queryCustomer") |
||||||
Response resp = new Response(); |
Response queryCustomer(@RequestParam String countries, Integer provinceId, Integer cityId, Integer pageNo, Integer pageSize, String searchContent) { |
||||||
Customer customer = new Customer(); |
Response resp = new Response(); |
||||||
if (searchContent!=null&&searchContent!="") { |
Customer customer = new Customer(); |
||||||
customer.setSearchContent(searchContent); |
if (searchContent != null && searchContent != "") { |
||||||
} |
customer.setSearchContent(searchContent); |
||||||
if (countries!=null&&countries!="") { |
} |
||||||
customer.setCountries(countries); |
if (countries != null && countries != "") { |
||||||
} |
customer.setCountries(countries); |
||||||
if (provinceId!=null) { |
} |
||||||
customer.setProvinceId(provinceId); |
if (provinceId != null) { |
||||||
} |
customer.setProvinceId(provinceId); |
||||||
if (cityId!=null) { |
} |
||||||
customer.setCityId(cityId); |
if (cityId != null) { |
||||||
} |
customer.setCityId(cityId); |
||||||
HashMap<String, Object> ret = customerService.queryCustomer(customer,pageNo,pageSize); |
} |
||||||
int status = (int) ret.get("retcode"); |
HashMap<String, Object> ret = customerService.queryCustomer(customer, pageNo, pageSize); |
||||||
if (200 == status) { |
int status = (int) ret.get("retcode"); |
||||||
resp.setStatus(status); |
if (200 == status) { |
||||||
resp.setMessage(ret.get("retvalue")); |
resp.setStatus(status); |
||||||
} else { |
resp.setMessage(ret.get("retvalue")); |
||||||
resp.setStatus(status); |
} else { |
||||||
resp.setErrmessage(ret.get("retvalue").toString()); |
resp.setStatus(status); |
||||||
} |
resp.setErrmessage(ret.get("retvalue").toString()); |
||||||
return resp; |
} |
||||||
} |
return resp; |
||||||
|
} |
||||||
/** |
|
||||||
* 查询客户详情 |
/** |
||||||
*/ |
* 查询客户详情 |
||||||
@GetMapping("/queryCustomerDetails") |
*/ |
||||||
Response queryCustomerDetails(@RequestParam Integer customerId) { |
@GetMapping("/queryCustomerDetails") |
||||||
Response resp = new Response(); |
Response queryCustomerDetails(@RequestParam Integer customerId) { |
||||||
if (customerId==null) { |
Response resp = new Response(); |
||||||
resp.setStatus(300); |
if (customerId == null) { |
||||||
resp.setErrmessage("Parameter Invalid"); |
resp.setStatus(300); |
||||||
}else { |
resp.setErrmessage("Parameter Invalid"); |
||||||
HashMap<String, Object> ret = customerService.queryCustomerDetails(customerId); |
} else { |
||||||
int status = (int) ret.get("retcode"); |
HashMap<String, Object> ret = customerService.queryCustomerDetails(customerId); |
||||||
if (200 == status) { |
int status = (int) ret.get("retcode"); |
||||||
resp.setStatus(status); |
if (200 == status) { |
||||||
resp.setMessage(ret.get("retvalue")); |
resp.setStatus(status); |
||||||
} else { |
resp.setMessage(ret.get("retvalue")); |
||||||
resp.setStatus(status); |
} else { |
||||||
resp.setErrmessage(ret.get("retvalue").toString()); |
resp.setStatus(status); |
||||||
} |
resp.setErrmessage(ret.get("retvalue").toString()); |
||||||
} |
} |
||||||
return resp; |
} |
||||||
} |
return resp; |
||||||
|
} |
||||||
/** |
|
||||||
* 删除客户 |
/** |
||||||
*/ |
* 删除客户 |
||||||
@PostMapping("/deleteCustomer") |
*/ |
||||||
Response deleteCustomer(@RequestBody Customer customer) { |
@PostMapping("/deleteCustomer") |
||||||
Response resp = new Response(); |
Response deleteCustomer(@RequestBody Customer customer) { |
||||||
if (customer.getCustomer().isEmpty()) { |
Response resp = new Response(); |
||||||
resp.setStatus(300); |
if (customer.getCustomer().isEmpty()) { |
||||||
resp.setErrmessage("客户不能为空!"); |
resp.setStatus(300); |
||||||
} else { |
resp.setErrmessage("客户不能为空!"); |
||||||
HashMap<String, Object> ret = customerService.deleteCustomer(customer); |
} else { |
||||||
int status = (int) ret.get("retcode"); |
HashMap<String, Object> ret = customerService.deleteCustomer(customer); |
||||||
if (200 == status) { |
int status = (int) ret.get("retcode"); |
||||||
resp.setStatus(status); |
if (200 == status) { |
||||||
resp.setMessage(ret.get("retvalue")); |
resp.setStatus(status); |
||||||
} else { |
resp.setMessage(ret.get("retvalue")); |
||||||
resp.setStatus(status); |
} else { |
||||||
resp.setErrmessage(ret.get("retvalue").toString()); |
resp.setStatus(status); |
||||||
} |
resp.setErrmessage(ret.get("retvalue").toString()); |
||||||
} |
} |
||||||
return resp; |
} |
||||||
} |
return resp; |
||||||
|
} |
||||||
/** |
|
||||||
* 更新客户 |
/** |
||||||
*/ |
* 更新客户 |
||||||
@PostMapping("/updateCustomer") |
*/ |
||||||
Response updateCustomer(@RequestBody Customer customer) { |
@PostMapping("/updateCustomer") |
||||||
Response resp = new Response(); |
Response updateCustomer(@RequestBody Customer customer) { |
||||||
if (customer.getCustomerId()==null) { |
Response resp = new Response(); |
||||||
resp.setStatus(300); |
if (customer.getCustomerId() == null) { |
||||||
resp.setErrmessage("客户不能为空!"); |
resp.setStatus(300); |
||||||
} else { |
resp.setErrmessage("客户不能为空!"); |
||||||
HashMap<String, Object> ret = customerService.updateCustomer(customer); |
} else { |
||||||
int status = (int) ret.get("retcode"); |
HashMap<String, Object> ret = customerService.updateCustomer(customer); |
||||||
if (200 == status) { |
int status = (int) ret.get("retcode"); |
||||||
resp.setStatus(status); |
if (200 == status) { |
||||||
resp.setMessage(ret.get("retvalue")); |
resp.setStatus(status); |
||||||
} else { |
resp.setMessage(ret.get("retvalue")); |
||||||
resp.setStatus(status); |
} else { |
||||||
resp.setErrmessage(ret.get("retvalue").toString()); |
resp.setStatus(status); |
||||||
} |
resp.setErrmessage(ret.get("retvalue").toString()); |
||||||
} |
} |
||||||
return resp; |
} |
||||||
} |
return resp; |
||||||
|
} |
||||||
/** |
|
||||||
* 查询客户是否存在 |
/** |
||||||
*/ |
* 查询客户是否存在 |
||||||
@GetMapping("/queryCustomerIsExists") |
*/ |
||||||
Response queryCustomerIsExists(@RequestParam Integer schoolId) { |
@GetMapping("/queryCustomerIsExists") |
||||||
Response resp = new Response(); |
Response queryCustomerIsExists(@RequestParam Integer schoolId) { |
||||||
if (schoolId==null) { |
Response resp = new Response(); |
||||||
resp.setStatus(300); |
if (schoolId == null) { |
||||||
resp.setErrmessage("学校不能为空!"); |
resp.setStatus(300); |
||||||
}else { |
resp.setErrmessage("学校不能为空!"); |
||||||
HashMap<String, Object> ret = customerService.queryCustomerIsExists(schoolId); |
} else { |
||||||
int status = (int) ret.get("retcode"); |
HashMap<String, Object> ret = customerService.queryCustomerIsExists(schoolId); |
||||||
if (200 == status) { |
int status = (int) ret.get("retcode"); |
||||||
resp.setStatus(status); |
if (200 == status) { |
||||||
resp.setMessage(ret.get("retvalue")); |
resp.setStatus(status); |
||||||
} else { |
resp.setMessage(ret.get("retvalue")); |
||||||
resp.setStatus(status); |
} else { |
||||||
resp.setErrmessage(ret.get("retvalue").toString()); |
resp.setStatus(status); |
||||||
} |
resp.setErrmessage(ret.get("retvalue").toString()); |
||||||
} |
} |
||||||
return resp; |
} |
||||||
} |
return resp; |
||||||
/** |
} |
||||||
* 查询行业类 |
|
||||||
*/ |
/** |
||||||
@GetMapping("/queryCustomerIndustryClass") |
* 查询行业类 |
||||||
Response queryCustomerIndustryClass() { |
*/ |
||||||
Response resp = new Response(); |
@GetMapping("/queryCustomerIndustryClass") |
||||||
HashMap<String, Object> ret = customerService.queryCustomerIndustryClass(); |
Response queryCustomerIndustryClass() { |
||||||
int status = (int) ret.get("retcode"); |
Response resp = new Response(); |
||||||
if (200 == status) { |
HashMap<String, Object> ret = customerService.queryCustomerIndustryClass(); |
||||||
resp.setStatus(status); |
int status = (int) ret.get("retcode"); |
||||||
resp.setMessage(ret.get("retvalue")); |
if (200 == status) { |
||||||
} else { |
resp.setStatus(status); |
||||||
resp.setStatus(status); |
resp.setMessage(ret.get("retvalue")); |
||||||
resp.setErrmessage(ret.get("retvalue").toString()); |
} else { |
||||||
} |
resp.setStatus(status); |
||||||
return resp; |
resp.setErrmessage(ret.get("retvalue").toString()); |
||||||
} |
} |
||||||
|
return resp; |
||||||
/** |
} |
||||||
* 查询行业 |
|
||||||
*/ |
/** |
||||||
@GetMapping("/queryCustomerIndustry") |
* 查询行业 |
||||||
Response queryCustomerIndustry(@RequestParam Integer industryClassId) { |
*/ |
||||||
Response resp = new Response(); |
@GetMapping("/queryCustomerIndustry") |
||||||
HashMap<String, Object> ret = customerService.queryCustomerIndustry(industryClassId); |
Response queryCustomerIndustry(@RequestParam Integer industryClassId) { |
||||||
int status = (int) ret.get("retcode"); |
Response resp = new Response(); |
||||||
if (200 == status) { |
HashMap<String, Object> ret = customerService.queryCustomerIndustry(industryClassId); |
||||||
resp.setStatus(status); |
int status = (int) ret.get("retcode"); |
||||||
resp.setMessage(ret.get("retvalue")); |
if (200 == status) { |
||||||
} else { |
resp.setStatus(status); |
||||||
resp.setStatus(status); |
resp.setMessage(ret.get("retvalue")); |
||||||
resp.setErrmessage(ret.get("retvalue").toString()); |
} else { |
||||||
} |
resp.setStatus(status); |
||||||
return resp; |
resp.setErrmessage(ret.get("retvalue").toString()); |
||||||
} |
} |
||||||
|
return resp; |
||||||
|
} |
||||||
|
|
||||||
/** |
/** |
||||||
* 查询学校 |
* 查询学校 |
||||||
*/ |
*/ |
||||||
@GetMapping("/querySchool") |
@GetMapping("/querySchool") |
||||||
Response querySchool(@RequestParam String schoolName) { |
Response querySchool(@RequestParam String schoolName) { |
||||||
Response resp = new Response(); |
Response resp = new Response(); |
||||||
School school = new School(); |
School school = new School(); |
||||||
if (schoolName!=null||schoolName!=""){ |
if (schoolName != null || schoolName != "") { |
||||||
school.setSchoolName(schoolName); |
school.setSchoolName(schoolName); |
||||||
} |
} |
||||||
HashMap<String, Object> ret = customerService.querySchool(school); |
HashMap<String, Object> ret = customerService.querySchool(school); |
||||||
resp.setStatus(200); |
resp.setStatus(200); |
||||||
resp.setErrmessage("Parameter effective"); |
resp.setErrmessage("Parameter effective"); |
||||||
int status = (int) ret.get("retcode"); |
int status = (int) ret.get("retcode"); |
||||||
if (200 == status) { |
if (200 == status) { |
||||||
resp.setStatus(status); |
resp.setStatus(status); |
||||||
resp.setMessage(ret.get("retvalue")); |
resp.setMessage(ret.get("retvalue")); |
||||||
} else { |
} else { |
||||||
resp.setStatus(status); |
resp.setStatus(status); |
||||||
resp.setErrmessage(ret.get("retvalue").toString()); |
resp.setErrmessage(ret.get("retvalue").toString()); |
||||||
} |
} |
||||||
return resp; |
return resp; |
||||||
} |
} |
||||||
} |
} |
||||||
|
@ -1,34 +1,33 @@ |
|||||||
package com.yipin.liuwanr.mapper; |
package com.yipin.liuwanr.mapper; |
||||||
|
|
||||||
import java.util.List; |
import com.yipin.liuwanr.entity.ServiceConfig; |
||||||
|
|
||||||
import org.apache.ibatis.annotations.Insert; |
import org.apache.ibatis.annotations.Insert; |
||||||
import org.apache.ibatis.annotations.Select; |
import org.apache.ibatis.annotations.Select; |
||||||
import org.apache.ibatis.annotations.Update; |
import org.apache.ibatis.annotations.Update; |
||||||
|
|
||||||
import com.yipin.liuwanr.entity.ServiceConfig; |
import java.util.List; |
||||||
|
|
||||||
public interface ServiceConfigMapper { |
public interface ServiceConfigMapper { |
||||||
|
|
||||||
@Insert("INSERT INTO service_config(systemName,systemType,systemAttribution,systemStatus,isdel) VALUES(#{systemName},#{systemType},#{systemAttribution},#{systemStatus},0)") |
@Insert("INSERT INTO service_config(systemName,systemType,systemAttribution,systemStatus,isdel) VALUES(#{systemName},#{systemType},#{systemAttribution},#{systemStatus},0)") |
||||||
void addServiceConfig(ServiceConfig serviceConfig); |
void addServiceConfig(ServiceConfig serviceConfig); |
||||||
|
|
||||||
@Select({"<script>", |
@Select({"<script>", |
||||||
"SELECT systemId,systemName,systemType,systemAttribution,systemStatus,projectSystemAddress,markPointsAddress from service_config where isdel = 0 ", |
"SELECT systemId,systemName,systemType,systemAttribution,systemStatus,projectSystemAddress,markPointsAddress from service_config where isdel = 0 ", |
||||||
" <if test='systemAttribution !=null'>and systemAttribution = #{systemAttribution} </if>", |
" <if test='systemAttribution !=null'>and systemAttribution = #{systemAttribution} </if>", |
||||||
" <if test='systemType !=null'>and systemType = #{systemType} </if>", |
" <if test='systemType !=null'>and systemType = #{systemType} </if>", |
||||||
" <if test='searchContent!=null'> and systemName like CONCAT('%',#{searchContent},'%')</if>", |
" <if test='searchContent!=null'> and systemName like CONCAT('%',#{searchContent},'%')</if>", |
||||||
"</script> "}) |
"</script> "}) |
||||||
List<ServiceConfig> queryServiceConfig(ServiceConfig serviceConfig); |
List<ServiceConfig> queryServiceConfig(ServiceConfig serviceConfig); |
||||||
|
|
||||||
@Select({"<script>", |
@Select({"<script>", |
||||||
"SELECT systemId,systemName,systemType,systemAttribution,systemStatus,projectSystemAddress,markPointsAddress from service_config where systemId = #{systemId} ", |
"SELECT systemId,systemName,systemType,systemAttribution,systemStatus,projectSystemAddress,markPointsAddress from service_config where systemId = #{systemId} ", |
||||||
"</script> "}) |
"</script> "}) |
||||||
List<ServiceConfig> queryServiceConfigDetails(Integer systemId); |
List<ServiceConfig> queryServiceConfigDetails(Integer systemId); |
||||||
|
|
||||||
@Update("UPDATE service_config SET isdel = 1 where systemId = #{systemId}") |
@Update("UPDATE service_config SET isdel = 1 where systemId = #{systemId}") |
||||||
void deleteServiceConfig(ServiceConfig serviceConfig); |
void deleteServiceConfig(ServiceConfig serviceConfig); |
||||||
|
|
||||||
@Update("UPDATE service_config SET systemName = #{systemName},systemType = #{systemType},systemAttribution = #{systemAttribution},systemStatus = #{systemStatus} where systemId = #{systemId}") |
@Update("UPDATE service_config SET systemName = #{systemName},systemType = #{systemType},systemAttribution = #{systemAttribution},systemStatus = #{systemStatus} where systemId = #{systemId}") |
||||||
void updateServiceConfig(ServiceConfig serviceConfig); |
void updateServiceConfig(ServiceConfig serviceConfig); |
||||||
} |
} |
@ -1,319 +1,312 @@ |
|||||||
package com.yipin.liuwanr.service; |
package com.yipin.liuwanr.service; |
||||||
|
|
||||||
|
import com.github.pagehelper.PageHelper; |
||||||
|
import com.github.pagehelper.PageInfo; |
||||||
|
import com.yipin.liuwanr.entity.*; |
||||||
|
import com.yipin.liuwanr.mapper.OrderMapper; |
||||||
|
import org.jboss.logging.Logger; |
||||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||||
|
import org.springframework.stereotype.Service; |
||||||
|
|
||||||
import java.text.ParseException; |
import java.text.ParseException; |
||||||
import java.text.SimpleDateFormat; |
import java.text.SimpleDateFormat; |
||||||
import java.util.Date; |
import java.util.Date; |
||||||
import java.util.HashMap; |
import java.util.HashMap; |
||||||
import java.util.List; |
import java.util.List; |
||||||
|
|
||||||
import org.jboss.logging.Logger; |
|
||||||
import org.springframework.beans.factory.annotation.Autowired; |
|
||||||
import org.springframework.stereotype.Service; |
|
||||||
|
|
||||||
import com.github.pagehelper.PageHelper; |
|
||||||
import com.github.pagehelper.PageInfo; |
|
||||||
import com.yipin.liuwanr.entity.ApplicationPermissions; |
|
||||||
import com.yipin.liuwanr.entity.ContractInformation; |
|
||||||
import com.yipin.liuwanr.entity.Course; |
|
||||||
import com.yipin.liuwanr.entity.CoursePermissions; |
|
||||||
import com.yipin.liuwanr.entity.Order; |
|
||||||
import com.yipin.liuwanr.entity.PageResult; |
|
||||||
import com.yipin.liuwanr.mapper.OrderMapper; |
|
||||||
|
|
||||||
@Service |
@Service |
||||||
public class OrderService { |
public class OrderService { |
||||||
|
|
||||||
private static Logger logger = Logger.getLogger(OrderService.class); |
|
||||||
|
|
||||||
@Autowired |
|
||||||
private OrderMapper orderMapper; |
|
||||||
|
|
||||||
//添加合同信息
|
private static Logger logger = Logger.getLogger(OrderService.class); |
||||||
public HashMap<String, Object> addOrder(Order order){ |
|
||||||
HashMap<String, Object> resp = new HashMap<String, Object>(); |
@Autowired |
||||||
try { |
private OrderMapper orderMapper; |
||||||
long timeStamp = new Date().getTime();//获取时间戳
|
|
||||||
String orderNumber = String.valueOf(timeStamp);//long转String
|
//添加合同信息
|
||||||
order.setOrderNumber(orderNumber); |
public HashMap<String, Object> addOrder(Order order) { |
||||||
orderMapper.addOrder(order); |
HashMap<String, Object> resp = new HashMap<String, Object>(); |
||||||
resp.put("orderId", order.getOrderId()); |
try { |
||||||
resp.put("retcode", 200); |
long timeStamp = new Date().getTime();//获取时间戳
|
||||||
orderMapper.updateOrderCustomer(order); |
String orderNumber = String.valueOf(timeStamp);//long转String
|
||||||
} catch (RuntimeException e) { |
order.setOrderNumber(orderNumber); |
||||||
logger.error(e.getMessage()); |
orderMapper.addOrder(order); |
||||||
resp.put("retcode", 500); |
resp.put("orderId", order.getOrderId()); |
||||||
resp.put("retvalue", "添加订单失败!"); |
resp.put("retcode", 200); |
||||||
return resp; |
orderMapper.updateOrderCustomer(order); |
||||||
} |
} catch (RuntimeException e) { |
||||||
return resp; |
logger.error(e.getMessage()); |
||||||
} |
resp.put("retcode", 500); |
||||||
public HashMap<String, Object> addContractInformation(ContractInformation contractInformation){ |
resp.put("retvalue", "添加订单失败!"); |
||||||
HashMap<String, Object> resp = new HashMap<String, Object>(); |
return resp; |
||||||
try { |
} |
||||||
orderMapper.addContractInformation(contractInformation); |
return resp; |
||||||
resp.put("retcode", 200); |
} |
||||||
} catch (RuntimeException e) { |
|
||||||
logger.error(e.getMessage()); |
public HashMap<String, Object> addContractInformation(ContractInformation contractInformation) { |
||||||
resp.put("retcode", 500); |
HashMap<String, Object> resp = new HashMap<String, Object>(); |
||||||
resp.put("retvalue", "添加信息合同失败!"); |
try { |
||||||
return resp; |
orderMapper.addContractInformation(contractInformation); |
||||||
} |
resp.put("retcode", 200); |
||||||
return resp; |
} catch (RuntimeException e) { |
||||||
} |
logger.error(e.getMessage()); |
||||||
|
resp.put("retcode", 500); |
||||||
//添加课程权限
|
resp.put("retvalue", "添加信息合同失败!"); |
||||||
public HashMap<String, Object> addCoursePermissionss(List<CoursePermissions> coursePermissionss) throws ParseException{ |
return resp; |
||||||
HashMap<String, Object> resp = new HashMap<String, Object>(); |
} |
||||||
try { |
return resp; |
||||||
Integer size = coursePermissionss.size(); |
} |
||||||
for (int i = 0; i < size; i++) { |
|
||||||
CoursePermissions coursePermissionssList = coursePermissionss.get(i); |
//添加课程权限
|
||||||
Integer usePeriod = coursePermissionssList.getUsePeriod(); |
public HashMap<String, Object> addCoursePermissionss(List<CoursePermissions> coursePermissionss) throws ParseException { |
||||||
Integer usePeriod1 = usePeriod*1000*(60*60*24); |
HashMap<String, Object> resp = new HashMap<String, Object>(); |
||||||
long DQSJC = System.currentTimeMillis(); |
try { |
||||||
long expireSJC = usePeriod1 + DQSJC; |
Integer size = coursePermissionss.size(); |
||||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
for (int i = 0; i < size; i++) { |
||||||
long lt = new Long(expireSJC); |
CoursePermissions coursePermissionssList = coursePermissionss.get(i); |
||||||
Date date = new Date(lt); |
Integer usePeriod = coursePermissionssList.getUsePeriod(); |
||||||
String time = simpleDateFormat.format(date); |
Integer usePeriod1 = usePeriod * 1000 * (60 * 60 * 24); |
||||||
coursePermissionss.get(i).setExpirationTime(time); |
long DQSJC = System.currentTimeMillis(); |
||||||
} |
long expireSJC = usePeriod1 + DQSJC; |
||||||
orderMapper.addCoursePermissionss(coursePermissionss); |
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
||||||
resp.put("retcode", 200); |
long lt = new Long(expireSJC); |
||||||
} catch (RuntimeException e) { |
Date date = new Date(lt); |
||||||
logger.error(e.getMessage()); |
String time = simpleDateFormat.format(date); |
||||||
resp.put("retcode", 500); |
coursePermissionss.get(i).setExpirationTime(time); |
||||||
resp.put("retvalue", "添加课程权限失败!"); |
} |
||||||
return resp; |
orderMapper.addCoursePermissionss(coursePermissionss); |
||||||
} |
resp.put("retcode", 200); |
||||||
return resp; |
} catch (RuntimeException e) { |
||||||
} |
logger.error(e.getMessage()); |
||||||
|
resp.put("retcode", 500); |
||||||
//绑定应用权限
|
resp.put("retvalue", "添加课程权限失败!"); |
||||||
public HashMap<String, Object> bindingApplicationPermissions(ApplicationPermissions applicationPermissions){ |
return resp; |
||||||
HashMap<String, Object> resp = new HashMap<String, Object>(); |
} |
||||||
try { |
return resp; |
||||||
orderMapper.bindingApplicationPermissions(applicationPermissions); |
} |
||||||
resp.put("retcode", 200); |
|
||||||
} catch (RuntimeException e) { |
//绑定应用权限
|
||||||
logger.error(e.getMessage()); |
public HashMap<String, Object> bindingApplicationPermissions(ApplicationPermissions applicationPermissions) { |
||||||
resp.put("retcode", 500); |
HashMap<String, Object> resp = new HashMap<String, Object>(); |
||||||
resp.put("retvalue", "Inquiry Failed"); |
try { |
||||||
return resp; |
orderMapper.bindingApplicationPermissions(applicationPermissions); |
||||||
} |
resp.put("retcode", 200); |
||||||
return resp; |
} catch (RuntimeException e) { |
||||||
} |
logger.error(e.getMessage()); |
||||||
|
resp.put("retcode", 500); |
||||||
public HashMap<String, Object> queryCoursePermissions(String courseId){ |
resp.put("retvalue", "Inquiry Failed"); |
||||||
HashMap<String, Object> resp = new HashMap<String, Object>(); |
return resp; |
||||||
try { |
} |
||||||
List<Course> list = orderMapper.queryCoursePermissions(courseId); |
return resp; |
||||||
resp.put("retvalue", list); |
} |
||||||
resp.put("retcode", 200); |
|
||||||
} catch (RuntimeException e) { |
public HashMap<String, Object> queryCoursePermissions(String courseId) { |
||||||
logger.error(e.getMessage()); |
HashMap<String, Object> resp = new HashMap<String, Object>(); |
||||||
resp.put("retcode", 500); |
try { |
||||||
resp.put("retvalue", "Inquiry Failed"); |
List<Course> list = orderMapper.queryCoursePermissions(courseId); |
||||||
return resp; |
resp.put("retvalue", list); |
||||||
} |
resp.put("retcode", 200); |
||||||
return resp; |
} catch (RuntimeException e) { |
||||||
} |
logger.error(e.getMessage()); |
||||||
|
resp.put("retcode", 500); |
||||||
|
resp.put("retvalue", "Inquiry Failed"); |
||||||
public HashMap<String, Object> queryOrder(Order order,Integer pageNo,Integer pageSize){ |
return resp; |
||||||
HashMap<String, Object> resp = new HashMap<String, Object>(); |
} |
||||||
try { |
return resp; |
||||||
if(pageNo!=null&&pageSize!=null) { |
} |
||||||
PageHelper.startPage(pageNo, pageSize); |
|
||||||
List<Order> list = orderMapper.queryOrder(order); |
public HashMap<String, Object> queryOrder(Order order, Integer pageNo, Integer pageSize) { |
||||||
PageInfo<Order> info=new PageInfo<Order>(list); |
HashMap<String, Object> resp = new HashMap<String, Object>(); |
||||||
int total1 = (int) info.getTotal(); |
try { |
||||||
int totalPages; |
if (pageNo != null && pageSize != null) { |
||||||
totalPages = total1 / pageSize; |
PageHelper.startPage(pageNo, pageSize); |
||||||
if (total1 % pageSize != 0){ |
List<Order> list = orderMapper.queryOrder(order); |
||||||
totalPages ++; |
PageInfo<Order> info = new PageInfo<Order>(list); |
||||||
} |
int total1 = (int) info.getTotal(); |
||||||
long total = total1; |
int totalPages; |
||||||
resp.put("retvalue", new PageResult(total, list,totalPages)); |
totalPages = total1 / pageSize; |
||||||
resp.put("retcode", 200); |
if (total1 % pageSize != 0) { |
||||||
}else { |
totalPages++; |
||||||
List<Order> list = orderMapper.queryOrder(order); |
} |
||||||
resp.put("retvalue", list); |
long total = total1; |
||||||
resp.put("retcode", 200); |
resp.put("retvalue", new PageResult(total, list, totalPages)); |
||||||
} |
resp.put("retcode", 200); |
||||||
} catch (RuntimeException e) { |
} else { |
||||||
logger.error(e.getMessage()); |
List<Order> list = orderMapper.queryOrder(order); |
||||||
resp.put("retcode", 500); |
resp.put("retvalue", list); |
||||||
resp.put("retvalue", "Inquiry Failed"); |
resp.put("retcode", 200); |
||||||
return resp; |
} |
||||||
} |
} catch (RuntimeException e) { |
||||||
return resp; |
logger.error(e.getMessage()); |
||||||
} |
resp.put("retcode", 500); |
||||||
|
resp.put("retvalue", "Inquiry Failed"); |
||||||
public HashMap<String, Object> queryOrderDetails(Integer orderId){ |
return resp; |
||||||
HashMap<String, Object> resp = new HashMap<String, Object>(); |
} |
||||||
try { |
return resp; |
||||||
resp.put("retvalue", orderMapper.queryOrderDetails(orderId)); |
} |
||||||
resp.put("retcode", 200); |
|
||||||
} catch (RuntimeException e) { |
public HashMap<String, Object> queryOrderDetails(Integer orderId) { |
||||||
logger.error(e.getMessage()); |
HashMap<String, Object> resp = new HashMap<String, Object>(); |
||||||
resp.put("retcode", 500); |
try { |
||||||
resp.put("retvalue", "Inquiry Failed"); |
resp.put("retvalue", orderMapper.queryOrderDetails(orderId)); |
||||||
return resp; |
resp.put("retcode", 200); |
||||||
} |
} catch (RuntimeException e) { |
||||||
return resp; |
logger.error(e.getMessage()); |
||||||
} |
resp.put("retcode", 500); |
||||||
|
resp.put("retvalue", "Inquiry Failed"); |
||||||
public HashMap<String, Object> deleteOrder(List<Integer> orderId){ |
return resp; |
||||||
HashMap<String, Object> resp = new HashMap<String, Object>(); |
} |
||||||
try { |
return resp; |
||||||
orderMapper.deleteOrder(orderId); |
} |
||||||
resp.put("retcode", 200); |
|
||||||
} catch (RuntimeException e) { |
public HashMap<String, Object> deleteOrder(List<Integer> orderId) { |
||||||
logger.error(e.getMessage()); |
HashMap<String, Object> resp = new HashMap<String, Object>(); |
||||||
resp.put("retcode", 500); |
try { |
||||||
resp.put("retvalue", "Inquiry Failed"); |
orderMapper.deleteOrder(orderId); |
||||||
return resp; |
resp.put("retcode", 200); |
||||||
} |
} catch (RuntimeException e) { |
||||||
return resp; |
logger.error(e.getMessage()); |
||||||
} |
resp.put("retcode", 500); |
||||||
|
resp.put("retvalue", "Inquiry Failed"); |
||||||
public HashMap<String, Object> updateOrder(Order order){ |
return resp; |
||||||
HashMap<String, Object> resp = new HashMap<String, Object>(); |
} |
||||||
try { |
return resp; |
||||||
orderMapper.updateOrder(order); |
} |
||||||
resp.put("retcode", 200); |
|
||||||
} catch (RuntimeException e) { |
public HashMap<String, Object> updateOrder(Order order) { |
||||||
logger.error(e.getMessage()); |
HashMap<String, Object> resp = new HashMap<String, Object>(); |
||||||
resp.put("retcode", 500); |
try { |
||||||
resp.put("retvalue", "Inquiry Failed"); |
orderMapper.updateOrder(order); |
||||||
return resp; |
resp.put("retcode", 200); |
||||||
} |
} catch (RuntimeException e) { |
||||||
return resp; |
logger.error(e.getMessage()); |
||||||
} |
resp.put("retcode", 500); |
||||||
|
resp.put("retvalue", "Inquiry Failed"); |
||||||
|
return resp; |
||||||
|
} |
||||||
|
return resp; |
||||||
|
} |
||||||
|
|
||||||
|
public HashMap<String, Object> deleteCoursePermissions(Integer orderId) { |
||||||
|
HashMap<String, Object> resp = new HashMap<String, Object>(); |
||||||
|
try { |
||||||
|
orderMapper.deleteCoursePermissions(orderId); |
||||||
|
resp.put("retcode", 200); |
||||||
|
} catch (RuntimeException e) { |
||||||
|
logger.error(e.getMessage()); |
||||||
|
resp.put("retcode", 500); |
||||||
|
resp.put("retvalue", "Inquiry Failed"); |
||||||
|
return resp; |
||||||
|
} |
||||||
|
return resp; |
||||||
|
} |
||||||
|
|
||||||
|
public HashMap<String, Object> updateCoursePermissions(List<CoursePermissions> coursePermissionss) { |
||||||
|
HashMap<String, Object> resp = new HashMap<String, Object>(); |
||||||
|
int size = coursePermissionss.size(); |
||||||
|
if (coursePermissionss.isEmpty()) { |
||||||
|
resp.put("retcode", 200); |
||||||
|
} else { |
||||||
|
try { |
||||||
|
for (int i = 0; i < size; i++) { |
||||||
|
CoursePermissions coursePermissions = coursePermissionss.get(i); |
||||||
|
orderMapper.updateCoursePermissions(coursePermissions); |
||||||
|
} |
||||||
|
resp.put("retcode", 200); |
||||||
|
} catch (RuntimeException e) { |
||||||
|
logger.error(e.getMessage()); |
||||||
|
resp.put("retcode", 500); |
||||||
|
resp.put("retvalue", "Inquiry Failed"); |
||||||
|
return resp; |
||||||
|
} |
||||||
|
} |
||||||
|
return resp; |
||||||
|
} |
||||||
|
|
||||||
|
public HashMap<String, Object> updateContractInformation(ContractInformation contractInformation) { |
||||||
|
HashMap<String, Object> resp = new HashMap<String, Object>(); |
||||||
|
try { |
||||||
|
orderMapper.updateContractInformation(contractInformation); |
||||||
|
resp.put("retcode", 200); |
||||||
|
} catch (RuntimeException e) { |
||||||
|
logger.error(e.getMessage()); |
||||||
|
resp.put("retcode", 500); |
||||||
|
resp.put("retvalue", "Inquiry Failed"); |
||||||
|
return resp; |
||||||
|
} |
||||||
|
return resp; |
||||||
|
} |
||||||
|
|
||||||
|
//绑定应用权限
|
||||||
|
public HashMap<String, Object> isDeliverGoods(CoursePermissions coursePermissions) { |
||||||
|
HashMap<String, Object> resp = new HashMap<String, Object>(); |
||||||
|
try { |
||||||
|
orderMapper.isDeliverGoods(coursePermissions); |
||||||
|
resp.put("retcode", 200); |
||||||
|
} catch (RuntimeException e) { |
||||||
|
logger.error(e.getMessage()); |
||||||
|
resp.put("retcode", 500); |
||||||
|
resp.put("retvalue", "Inquiry Failed"); |
||||||
|
return resp; |
||||||
|
} |
||||||
|
return resp; |
||||||
|
} |
||||||
|
|
||||||
|
public HashMap<String, Object> queryOrderCustomer(Integer cityId, Integer provinceId) { |
||||||
|
HashMap<String, Object> resp = new HashMap<String, Object>(); |
||||||
|
try { |
||||||
|
resp.put("retvalue", orderMapper.queryOrderCustomer(cityId, provinceId)); |
||||||
|
resp.put("retcode", 200); |
||||||
|
} catch (RuntimeException e) { |
||||||
|
logger.error(e.getMessage()); |
||||||
|
resp.put("retcode", 500); |
||||||
|
resp.put("retvalue", "Inquiry Failed"); |
||||||
|
return resp; |
||||||
|
} |
||||||
|
return resp; |
||||||
|
} |
||||||
|
|
||||||
public HashMap<String, Object> deleteCoursePermissions(Integer orderId){ |
public HashMap<String, Object> queryOrderCustomerContact(Integer customerId) { |
||||||
HashMap<String, Object> resp = new HashMap<String, Object>(); |
HashMap<String, Object> resp = new HashMap<String, Object>(); |
||||||
try { |
try { |
||||||
orderMapper.deleteCoursePermissions(orderId); |
resp.put("retvalue", orderMapper.queryOrderCustomerContact(customerId)); |
||||||
resp.put("retcode", 200); |
resp.put("retcode", 200); |
||||||
} catch (RuntimeException e) { |
} catch (RuntimeException e) { |
||||||
logger.error(e.getMessage()); |
logger.error(e.getMessage()); |
||||||
resp.put("retcode", 500); |
resp.put("retcode", 500); |
||||||
resp.put("retvalue", "Inquiry Failed"); |
resp.put("retvalue", "Inquiry Failed"); |
||||||
return resp; |
return resp; |
||||||
} |
} |
||||||
return resp; |
return resp; |
||||||
} |
} |
||||||
|
|
||||||
public HashMap<String, Object> updateCoursePermissions(List<CoursePermissions> coursePermissionss){ |
//查询订单课程列表
|
||||||
HashMap<String, Object> resp = new HashMap<String, Object>(); |
public HashMap<String, Object> queryCourseList(String searchContent, List<Integer> courseId, Integer pageNo, Integer pageSize) { |
||||||
int size = coursePermissionss.size(); |
HashMap<String, Object> resp = new HashMap<String, Object>(); |
||||||
if (coursePermissionss.isEmpty()) { |
try { |
||||||
resp.put("retcode", 200); |
if (pageNo != null && pageSize != null) { |
||||||
}else { |
PageHelper.startPage(pageNo, pageSize); |
||||||
try { |
List<Course> list = orderMapper.queryCourseList(searchContent, courseId); |
||||||
for (int i = 0; i < size; i++) { |
PageInfo<Course> info = new PageInfo<Course>(list); |
||||||
CoursePermissions coursePermissions = coursePermissionss.get(i); |
int total1 = (int) info.getTotal(); |
||||||
orderMapper.updateCoursePermissions(coursePermissions); |
int totalPages; |
||||||
} |
totalPages = total1 / pageSize; |
||||||
resp.put("retcode", 200); |
if (total1 % pageSize != 0) { |
||||||
} catch (RuntimeException e) { |
totalPages++; |
||||||
logger.error(e.getMessage()); |
} |
||||||
resp.put("retcode", 500); |
long total = total1; |
||||||
resp.put("retvalue", "Inquiry Failed"); |
resp.put("retvalue", new PageResult(total, list, totalPages)); |
||||||
return resp; |
resp.put("retcode", 200); |
||||||
} |
} else { |
||||||
} |
List<Course> list = orderMapper.queryCourseList(searchContent, courseId); |
||||||
return resp; |
resp.put("retvalue", list); |
||||||
} |
resp.put("retcode", 200); |
||||||
|
} |
||||||
public HashMap<String, Object> updateContractInformation(ContractInformation contractInformation){ |
} catch (RuntimeException e) { |
||||||
HashMap<String, Object> resp = new HashMap<String, Object>(); |
logger.error(e.getMessage()); |
||||||
try { |
resp.put("retcode", 500); |
||||||
orderMapper.updateContractInformation(contractInformation); |
resp.put("retvalue", "Inquiry Failed"); |
||||||
resp.put("retcode", 200); |
return resp; |
||||||
} catch (RuntimeException e) { |
} |
||||||
logger.error(e.getMessage()); |
return resp; |
||||||
resp.put("retcode", 500); |
} |
||||||
resp.put("retvalue", "Inquiry Failed"); |
|
||||||
return resp; |
|
||||||
} |
|
||||||
return resp; |
|
||||||
} |
|
||||||
|
|
||||||
//绑定应用权限
|
|
||||||
public HashMap<String, Object> isDeliverGoods(CoursePermissions coursePermissions){ |
|
||||||
HashMap<String, Object> resp = new HashMap<String, Object>(); |
|
||||||
try { |
|
||||||
orderMapper.isDeliverGoods(coursePermissions); |
|
||||||
resp.put("retcode", 200); |
|
||||||
} catch (RuntimeException e) { |
|
||||||
logger.error(e.getMessage()); |
|
||||||
resp.put("retcode", 500); |
|
||||||
resp.put("retvalue", "Inquiry Failed"); |
|
||||||
return resp; |
|
||||||
} |
|
||||||
return resp; |
|
||||||
} |
|
||||||
|
|
||||||
public HashMap<String, Object> queryOrderCustomer(Integer cityId,Integer provinceId){ |
|
||||||
HashMap<String, Object> resp = new HashMap<String, Object>(); |
|
||||||
try { |
|
||||||
resp.put("retvalue", orderMapper.queryOrderCustomer(cityId,provinceId)); |
|
||||||
resp.put("retcode", 200); |
|
||||||
} catch (RuntimeException e) { |
|
||||||
logger.error(e.getMessage()); |
|
||||||
resp.put("retcode", 500); |
|
||||||
resp.put("retvalue", "Inquiry Failed"); |
|
||||||
return resp; |
|
||||||
} |
|
||||||
return resp; |
|
||||||
} |
|
||||||
|
|
||||||
|
|
||||||
public HashMap<String, Object> queryOrderCustomerContact(Integer customerId){ |
|
||||||
HashMap<String, Object> resp = new HashMap<String, Object>(); |
|
||||||
try { |
|
||||||
resp.put("retvalue", orderMapper.queryOrderCustomerContact(customerId)); |
|
||||||
resp.put("retcode", 200); |
|
||||||
} catch (RuntimeException e) { |
|
||||||
logger.error(e.getMessage()); |
|
||||||
resp.put("retcode", 500); |
|
||||||
resp.put("retvalue", "Inquiry Failed"); |
|
||||||
return resp; |
|
||||||
} |
|
||||||
return resp; |
|
||||||
} |
|
||||||
|
|
||||||
//查询订单课程列表
|
|
||||||
public HashMap<String, Object> queryCourseList(String searchContent,List<Integer> courseId,Integer pageNo,Integer pageSize){ |
|
||||||
HashMap<String, Object> resp = new HashMap<String, Object>(); |
|
||||||
try { |
|
||||||
if(pageNo!=null&&pageSize!=null) { |
|
||||||
PageHelper.startPage(pageNo, pageSize); |
|
||||||
List<Course> list = orderMapper.queryCourseList(searchContent,courseId); |
|
||||||
PageInfo<Course> info=new PageInfo<Course>(list); |
|
||||||
int total1 = (int) info.getTotal(); |
|
||||||
int totalPages; |
|
||||||
totalPages = total1 / pageSize; |
|
||||||
if (total1 % pageSize != 0){ |
|
||||||
totalPages ++; |
|
||||||
} |
|
||||||
long total = total1; |
|
||||||
resp.put("retvalue", new PageResult(total, list,totalPages)); |
|
||||||
resp.put("retcode", 200); |
|
||||||
}else { |
|
||||||
List<Course> list = orderMapper.queryCourseList(searchContent,courseId); |
|
||||||
resp.put("retvalue", list); |
|
||||||
resp.put("retcode", 200); |
|
||||||
} |
|
||||||
} catch (RuntimeException e) { |
|
||||||
logger.error(e.getMessage()); |
|
||||||
resp.put("retcode", 500); |
|
||||||
resp.put("retvalue", "Inquiry Failed"); |
|
||||||
return resp; |
|
||||||
} |
|
||||||
return resp; |
|
||||||
} |
|
||||||
} |
} |
||||||
|
@ -1,110 +1,109 @@ |
|||||||
package com.yipin.liuwanr.service; |
package com.yipin.liuwanr.service; |
||||||
|
|
||||||
import java.util.HashMap; |
|
||||||
import java.util.List; |
|
||||||
|
|
||||||
import org.jboss.logging.Logger; |
|
||||||
import org.springframework.beans.factory.annotation.Autowired; |
|
||||||
import org.springframework.stereotype.Service; |
|
||||||
|
|
||||||
import com.github.pagehelper.PageHelper; |
import com.github.pagehelper.PageHelper; |
||||||
import com.github.pagehelper.PageInfo; |
import com.github.pagehelper.PageInfo; |
||||||
import com.yipin.liuwanr.entity.PageResult; |
import com.yipin.liuwanr.entity.PageResult; |
||||||
import com.yipin.liuwanr.entity.ServiceConfig; |
import com.yipin.liuwanr.entity.ServiceConfig; |
||||||
import com.yipin.liuwanr.mapper.ServiceConfigMapper; |
import com.yipin.liuwanr.mapper.ServiceConfigMapper; |
||||||
|
import org.jboss.logging.Logger; |
||||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||||
|
import org.springframework.stereotype.Service; |
||||||
|
|
||||||
|
import java.util.HashMap; |
||||||
|
import java.util.List; |
||||||
|
|
||||||
@Service |
@Service |
||||||
public class ServiceConfigService { |
public class ServiceConfigService { |
||||||
|
|
||||||
private static Logger logger = Logger.getLogger(ServiceConfigService.class); |
|
||||||
|
|
||||||
@Autowired |
|
||||||
private ServiceConfigMapper serviceConfigMapper; |
|
||||||
|
|
||||||
public HashMap<String, Object> addServiceConfig(ServiceConfig serviceConfig){ |
private static Logger logger = Logger.getLogger(ServiceConfigService.class); |
||||||
HashMap<String, Object> resp = new HashMap<String, Object>(); |
|
||||||
try { |
@Autowired |
||||||
serviceConfigMapper.addServiceConfig(serviceConfig); |
private ServiceConfigMapper serviceConfigMapper; |
||||||
resp.put("retcode", 200); |
|
||||||
} catch (RuntimeException e) { |
public HashMap<String, Object> addServiceConfig(ServiceConfig serviceConfig) { |
||||||
logger.error(e.getMessage()); |
HashMap<String, Object> resp = new HashMap<String, Object>(); |
||||||
resp.put("retcode", 500); |
try { |
||||||
resp.put("retvalue", "Inquiry Failed"); |
serviceConfigMapper.addServiceConfig(serviceConfig); |
||||||
return resp; |
resp.put("retcode", 200); |
||||||
} |
} catch (RuntimeException e) { |
||||||
return resp; |
logger.error(e.getMessage()); |
||||||
} |
resp.put("retcode", 500); |
||||||
|
resp.put("retvalue", "Inquiry Failed"); |
||||||
public HashMap<String, Object> queryServiceConfig(ServiceConfig serviceConfig,Integer pageNo,Integer pageSize){ |
return resp; |
||||||
HashMap<String, Object> resp = new HashMap<String, Object>(); |
} |
||||||
try { |
return resp; |
||||||
if(pageNo!=null&&pageSize!=null) { |
} |
||||||
PageHelper.startPage(pageNo, pageSize); |
|
||||||
List<ServiceConfig> list = serviceConfigMapper.queryServiceConfig(serviceConfig); |
public HashMap<String, Object> queryServiceConfig(ServiceConfig serviceConfig, Integer pageNo, Integer pageSize) { |
||||||
PageInfo<ServiceConfig> info=new PageInfo<ServiceConfig>(list); |
HashMap<String, Object> resp = new HashMap<String, Object>(); |
||||||
int total1 = (int) info.getTotal(); |
try { |
||||||
int totalPages; |
if (pageNo != null && pageSize != null) { |
||||||
totalPages = total1 / pageSize; |
PageHelper.startPage(pageNo, pageSize); |
||||||
if (total1 % pageSize != 0){ |
List<ServiceConfig> list = serviceConfigMapper.queryServiceConfig(serviceConfig); |
||||||
totalPages ++; |
PageInfo<ServiceConfig> info = new PageInfo<ServiceConfig>(list); |
||||||
} |
int total1 = (int) info.getTotal(); |
||||||
long total = total1; |
int totalPages; |
||||||
resp.put("retvalue", new PageResult(total, list,totalPages)); |
totalPages = total1 / pageSize; |
||||||
resp.put("retcode", 200); |
if (total1 % pageSize != 0) { |
||||||
}else { |
totalPages++; |
||||||
List<ServiceConfig> list = serviceConfigMapper.queryServiceConfig(serviceConfig); |
} |
||||||
resp.put("retvalue", list); |
long total = total1; |
||||||
resp.put("retcode", 200); |
resp.put("retvalue", new PageResult(total, list, totalPages)); |
||||||
} |
resp.put("retcode", 200); |
||||||
} catch (RuntimeException e) { |
} else { |
||||||
logger.error(e.getMessage()); |
List<ServiceConfig> list = serviceConfigMapper.queryServiceConfig(serviceConfig); |
||||||
resp.put("retcode", 500); |
resp.put("retvalue", list); |
||||||
resp.put("retvalue", "Inquiry Failed"); |
resp.put("retcode", 200); |
||||||
return resp; |
} |
||||||
} |
} catch (RuntimeException e) { |
||||||
return resp; |
logger.error(e.getMessage()); |
||||||
} |
resp.put("retcode", 500); |
||||||
|
resp.put("retvalue", "Inquiry Failed"); |
||||||
public HashMap<String, Object> queryServiceConfigDetails(Integer systemId){ |
return resp; |
||||||
HashMap<String, Object> resp = new HashMap<String, Object>(); |
} |
||||||
try { |
return resp; |
||||||
resp.put("retvalue", serviceConfigMapper.queryServiceConfigDetails(systemId)); |
} |
||||||
resp.put("retcode", 200); |
|
||||||
} catch (RuntimeException e) { |
public HashMap<String, Object> queryServiceConfigDetails(Integer systemId) { |
||||||
logger.error(e.getMessage()); |
HashMap<String, Object> resp = new HashMap<String, Object>(); |
||||||
resp.put("retcode", 500); |
try { |
||||||
resp.put("retvalue", "Inquiry Failed"); |
resp.put("retvalue", serviceConfigMapper.queryServiceConfigDetails(systemId)); |
||||||
return resp; |
resp.put("retcode", 200); |
||||||
} |
} catch (RuntimeException e) { |
||||||
return resp; |
logger.error(e.getMessage()); |
||||||
} |
resp.put("retcode", 500); |
||||||
|
resp.put("retvalue", "Inquiry Failed"); |
||||||
public HashMap<String, Object> deleteServiceConfig(ServiceConfig serviceConfig){ |
return resp; |
||||||
HashMap<String, Object> resp = new HashMap<String, Object>(); |
} |
||||||
try { |
return resp; |
||||||
serviceConfigMapper.deleteServiceConfig(serviceConfig); |
} |
||||||
resp.put("retcode", 200); |
|
||||||
} catch (RuntimeException e) { |
public HashMap<String, Object> deleteServiceConfig(ServiceConfig serviceConfig) { |
||||||
logger.error(e.getMessage()); |
HashMap<String, Object> resp = new HashMap<String, Object>(); |
||||||
resp.put("retcode", 500); |
try { |
||||||
resp.put("retvalue", "Inquiry Failed"); |
serviceConfigMapper.deleteServiceConfig(serviceConfig); |
||||||
return resp; |
resp.put("retcode", 200); |
||||||
} |
} catch (RuntimeException e) { |
||||||
return resp; |
logger.error(e.getMessage()); |
||||||
} |
resp.put("retcode", 500); |
||||||
|
resp.put("retvalue", "Inquiry Failed"); |
||||||
public HashMap<String, Object> updateServiceConfig(ServiceConfig serviceConfig){ |
return resp; |
||||||
HashMap<String, Object> resp = new HashMap<String, Object>(); |
} |
||||||
try { |
return resp; |
||||||
serviceConfigMapper.updateServiceConfig(serviceConfig); |
} |
||||||
resp.put("retcode", 200); |
|
||||||
} catch (RuntimeException e) { |
public HashMap<String, Object> updateServiceConfig(ServiceConfig serviceConfig) { |
||||||
logger.error(e.getMessage()); |
HashMap<String, Object> resp = new HashMap<String, Object>(); |
||||||
resp.put("retcode", 500); |
try { |
||||||
resp.put("retvalue", "Inquiry Failed"); |
serviceConfigMapper.updateServiceConfig(serviceConfig); |
||||||
return resp; |
resp.put("retcode", 200); |
||||||
} |
} catch (RuntimeException e) { |
||||||
return resp; |
logger.error(e.getMessage()); |
||||||
} |
resp.put("retcode", 500); |
||||||
|
resp.put("retvalue", "Inquiry Failed"); |
||||||
|
return resp; |
||||||
|
} |
||||||
|
return resp; |
||||||
|
} |
||||||
|
|
||||||
} |
} |
||||||
|
@ -0,0 +1,217 @@ |
|||||||
|
package com.yipin.liuwanr; |
||||||
|
|
||||||
|
import com.yipin.liuwanr.entity.*; |
||||||
|
import com.yipin.liuwanr.service.OrderService; |
||||||
|
import org.junit.Test; |
||||||
|
import org.junit.runner.RunWith; |
||||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||||
|
import org.springframework.boot.test.context.SpringBootTest; |
||||||
|
import org.springframework.test.context.junit4.SpringRunner; |
||||||
|
import org.springframework.transaction.annotation.Transactional; |
||||||
|
|
||||||
|
import java.text.ParseException; |
||||||
|
import java.util.ArrayList; |
||||||
|
import java.util.HashMap; |
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
@RunWith(SpringRunner.class) |
||||||
|
@SpringBootTest |
||||||
|
public class OrderServiceTest { |
||||||
|
@Autowired |
||||||
|
private OrderService orderService; |
||||||
|
|
||||||
|
//添加合同信息
|
||||||
|
@Test |
||||||
|
@Transactional |
||||||
|
public void addOrder() { |
||||||
|
Order order = new Order(); |
||||||
|
order.setOrderNumber("1596424017647"); |
||||||
|
order.setCustomerName("测试"); |
||||||
|
order.setOrderName("测试"); |
||||||
|
order.setOrderAmount("120"); |
||||||
|
order.setOrderType(1); |
||||||
|
order.setProvinceId(1); |
||||||
|
order.setCityId(1); |
||||||
|
order.setOrderContact("张三"); |
||||||
|
order.setPhone("15267668899"); |
||||||
|
order.setEmail("123@qq.com"); |
||||||
|
order.setCustomerId(126); |
||||||
|
HashMap<String, Object> map = orderService.addOrder(order); |
||||||
|
map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString())); |
||||||
|
} |
||||||
|
|
||||||
|
@Test |
||||||
|
@Transactional |
||||||
|
public void addContractInformation() { |
||||||
|
ContractInformation contractInformation = new ContractInformation(); |
||||||
|
contractInformation.setContractInformationName("1"); |
||||||
|
contractInformation.setContractInformationNumber("1"); |
||||||
|
contractInformation.setContractInformationSum("1"); |
||||||
|
contractInformation.setContractInformationLink("1"); |
||||||
|
contractInformation.setOrderId(20); |
||||||
|
HashMap<String, Object> map = orderService.addContractInformation(contractInformation); |
||||||
|
map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString())); |
||||||
|
} |
||||||
|
|
||||||
|
//添加课程权限
|
||||||
|
@Test |
||||||
|
@Transactional |
||||||
|
public void addCoursePermissionss() throws ParseException { |
||||||
|
List<CoursePermissions> coursePermissionss = new ArrayList<>(); |
||||||
|
CoursePermissions coursePermissions = new CoursePermissions(); |
||||||
|
coursePermissions.setCourseId(77); |
||||||
|
coursePermissions.setUsePeriod(30); |
||||||
|
coursePermissions.setMarketPrice(12.8); |
||||||
|
coursePermissions.setTransactionPrice(1); |
||||||
|
coursePermissions.setDiscount(7); |
||||||
|
coursePermissions.setPortAddressId(1); |
||||||
|
coursePermissions.setIsDeliverGoods(1); |
||||||
|
coursePermissions.setOrderId(118); |
||||||
|
coursePermissionss.add(coursePermissions); |
||||||
|
HashMap<String, Object> map = orderService.addCoursePermissionss(coursePermissionss); |
||||||
|
map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString())); |
||||||
|
} |
||||||
|
|
||||||
|
//绑定应用权限
|
||||||
|
@Test |
||||||
|
@Transactional |
||||||
|
public void bindingApplicationPermissions() { |
||||||
|
ApplicationPermissions applicationPermissions = new ApplicationPermissions(); |
||||||
|
applicationPermissions.setSystemId("2"); |
||||||
|
applicationPermissions.setOrderId(2); |
||||||
|
HashMap<String, Object> map = orderService.bindingApplicationPermissions(applicationPermissions); |
||||||
|
map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString())); |
||||||
|
} |
||||||
|
|
||||||
|
@Test |
||||||
|
@Transactional |
||||||
|
public void queryCoursePermissions() { |
||||||
|
String courseId = "1"; |
||||||
|
HashMap<String, Object> map = orderService.queryCoursePermissions(courseId); |
||||||
|
map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString())); |
||||||
|
} |
||||||
|
|
||||||
|
@Test |
||||||
|
@Transactional |
||||||
|
public void queryOrder() { |
||||||
|
Order order = new Order(); |
||||||
|
Integer pageNo = 1; |
||||||
|
Integer pageSize = 10; |
||||||
|
HashMap<String, Object> map = orderService.queryOrder(order, pageNo, pageSize); |
||||||
|
Integer retcode = (Integer) map.get("retcode"); |
||||||
|
System.out.println(retcode); |
||||||
|
if (retcode == 200) { |
||||||
|
PageResult pageResult = (PageResult) map.get("retvalue"); |
||||||
|
Long total = pageResult.getTotal(); |
||||||
|
System.out.println("total = " + total); |
||||||
|
List<Order> rows = (List<Order>) pageResult.getRows(); |
||||||
|
rows.forEach(item -> System.out.println(item.toString())); |
||||||
|
} else { |
||||||
|
String msg = (String) map.get("retvalue"); |
||||||
|
System.out.println(msg); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
@Test |
||||||
|
@Transactional |
||||||
|
public void queryOrderDetails() { |
||||||
|
Integer orderId = 1; |
||||||
|
HashMap<String, Object> map = orderService.queryOrderDetails(orderId); |
||||||
|
map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString())); |
||||||
|
} |
||||||
|
|
||||||
|
@Test |
||||||
|
@Transactional |
||||||
|
public void deleteOrder() { |
||||||
|
List<Integer> orderId = new ArrayList<>(); |
||||||
|
orderId.add(1); |
||||||
|
orderId.add(2); |
||||||
|
orderId.add(3); |
||||||
|
HashMap<String, Object> map = orderService.deleteOrder(orderId); |
||||||
|
map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString())); |
||||||
|
} |
||||||
|
|
||||||
|
@Test |
||||||
|
@Transactional |
||||||
|
public void updateOrder() { |
||||||
|
Order order = new Order(); |
||||||
|
HashMap<String, Object> map = orderService.updateOrder(order); |
||||||
|
map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString())); |
||||||
|
} |
||||||
|
|
||||||
|
@Test |
||||||
|
@Transactional |
||||||
|
public void deleteCoursePermissions() { |
||||||
|
Integer orderId = 1; |
||||||
|
HashMap<String, Object> map = orderService.deleteCoursePermissions(orderId); |
||||||
|
map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString())); |
||||||
|
} |
||||||
|
|
||||||
|
@Test |
||||||
|
@Transactional |
||||||
|
public void updateCoursePermissions() { |
||||||
|
List<CoursePermissions> coursePermissionss = new ArrayList<>(); |
||||||
|
CoursePermissions coursePermissions = new CoursePermissions(); |
||||||
|
coursePermissionss.add(coursePermissions); |
||||||
|
HashMap<String, Object> map = orderService.updateCoursePermissions(coursePermissionss); |
||||||
|
map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString())); |
||||||
|
} |
||||||
|
|
||||||
|
@Test |
||||||
|
@Transactional |
||||||
|
public void updateContractInformation() { |
||||||
|
ContractInformation contractInformation = new ContractInformation(); |
||||||
|
HashMap<String, Object> map = orderService.updateContractInformation(contractInformation); |
||||||
|
map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString())); |
||||||
|
} |
||||||
|
|
||||||
|
//绑定应用权限
|
||||||
|
@Test |
||||||
|
@Transactional |
||||||
|
public void isDeliverGoods() { |
||||||
|
CoursePermissions coursePermissions = new CoursePermissions(); |
||||||
|
HashMap<String, Object> map = orderService.isDeliverGoods(coursePermissions); |
||||||
|
map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString())); |
||||||
|
} |
||||||
|
|
||||||
|
@Test |
||||||
|
@Transactional |
||||||
|
public void queryOrderCustomer() { |
||||||
|
Integer cityId = 1; |
||||||
|
Integer provinceId = 1; |
||||||
|
HashMap<String, Object> map = orderService.queryOrderCustomer(cityId, provinceId); |
||||||
|
map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString())); |
||||||
|
} |
||||||
|
|
||||||
|
@Test |
||||||
|
@Transactional |
||||||
|
public void queryOrderCustomerContact() { |
||||||
|
Integer customerId = 1; |
||||||
|
HashMap<String, Object> map = orderService.queryOrderCustomerContact(customerId); |
||||||
|
map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString())); |
||||||
|
} |
||||||
|
|
||||||
|
//查询订单课程列表
|
||||||
|
@Test |
||||||
|
@Transactional |
||||||
|
public void queryCourseList() { |
||||||
|
String searchContent = ""; |
||||||
|
List<Integer> courseId = new ArrayList<>(); |
||||||
|
Integer pageNo = 1; |
||||||
|
Integer pageSize = 10; |
||||||
|
HashMap<String, Object> map = orderService.queryCourseList(searchContent, courseId, pageNo, pageSize); |
||||||
|
Integer retcode = (Integer) map.get("retcode"); |
||||||
|
System.out.println(retcode); |
||||||
|
if (retcode == 200) { |
||||||
|
PageResult pageResult = (PageResult) map.get("retvalue"); |
||||||
|
Long total = pageResult.getTotal(); |
||||||
|
System.out.println("total = " + total); |
||||||
|
List<Course> rows = (List<Course>) pageResult.getRows(); |
||||||
|
rows.forEach(item -> System.out.println(item.toString())); |
||||||
|
} else { |
||||||
|
String msg = (String) map.get("retvalue"); |
||||||
|
System.out.println(msg); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -0,0 +1,83 @@ |
|||||||
|
package com.yipin.liuwanr; |
||||||
|
|
||||||
|
import com.yipin.liuwanr.entity.PageResult; |
||||||
|
import com.yipin.liuwanr.entity.ServiceConfig; |
||||||
|
import com.yipin.liuwanr.service.ServiceConfigService; |
||||||
|
import org.junit.Test; |
||||||
|
import org.junit.runner.RunWith; |
||||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||||
|
import org.springframework.boot.test.context.SpringBootTest; |
||||||
|
import org.springframework.test.context.junit4.SpringRunner; |
||||||
|
import org.springframework.transaction.annotation.Transactional; |
||||||
|
|
||||||
|
import java.util.HashMap; |
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
@RunWith(SpringRunner.class) |
||||||
|
@SpringBootTest |
||||||
|
public class ServiceConfigServiceTest { |
||||||
|
@Autowired |
||||||
|
private ServiceConfigService serviceConfigService; |
||||||
|
|
||||||
|
@Test |
||||||
|
@Transactional |
||||||
|
public void addServiceConfig() { |
||||||
|
ServiceConfig serviceConfig = new ServiceConfig(); |
||||||
|
serviceConfig.setSystemName("测试"); |
||||||
|
serviceConfig.setSystemType(2); |
||||||
|
serviceConfig.setSystemAttribution(2); |
||||||
|
serviceConfig.setSystemStatus(1); |
||||||
|
HashMap<String, Object> map = serviceConfigService.addServiceConfig(serviceConfig); |
||||||
|
map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString())); |
||||||
|
} |
||||||
|
|
||||||
|
@Test |
||||||
|
public void queryServiceConfig() { |
||||||
|
ServiceConfig serviceConfig = new ServiceConfig(); |
||||||
|
Integer pageNo = 1; |
||||||
|
Integer pageSize = 10; |
||||||
|
HashMap<String, Object> map = serviceConfigService.queryServiceConfig(serviceConfig, pageNo, pageSize); |
||||||
|
Integer retcode = (Integer) map.get("retcode"); |
||||||
|
System.out.println(retcode); |
||||||
|
if (retcode == 200) { |
||||||
|
PageResult pageResult = (PageResult) map.get("retvalue"); |
||||||
|
Long total = pageResult.getTotal(); |
||||||
|
System.out.println("total = " + total); |
||||||
|
List<ServiceConfig> rows = (List<ServiceConfig>) pageResult.getRows(); |
||||||
|
rows.forEach(item -> System.out.println(item.toString())); |
||||||
|
} else { |
||||||
|
String msg = (String) map.get("retvalue"); |
||||||
|
System.out.println(msg); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
@Test |
||||||
|
public void queryServiceConfigDetails() { |
||||||
|
Integer systemId = 1; |
||||||
|
HashMap<String, Object> map = serviceConfigService.queryServiceConfigDetails(systemId); |
||||||
|
map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString())); |
||||||
|
} |
||||||
|
|
||||||
|
@Test |
||||||
|
@Transactional |
||||||
|
public void deleteServiceConfig() { |
||||||
|
ServiceConfig serviceConfig = new ServiceConfig(); |
||||||
|
serviceConfig.setSystemId(1); |
||||||
|
HashMap<String, Object> map = serviceConfigService.deleteServiceConfig(serviceConfig); |
||||||
|
map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString())); |
||||||
|
} |
||||||
|
|
||||||
|
@Test |
||||||
|
@Transactional |
||||||
|
public void updateServiceConfig() { |
||||||
|
ServiceConfig serviceConfig = new ServiceConfig(); |
||||||
|
serviceConfig.setSystemName("测试"); |
||||||
|
serviceConfig.setSystemType(2); |
||||||
|
serviceConfig.setSystemAttribution(2); |
||||||
|
serviceConfig.setSystemStatus(1); |
||||||
|
serviceConfig.setSystemId(1); |
||||||
|
HashMap<String, Object> map = serviceConfigService.updateServiceConfig(serviceConfig); |
||||||
|
map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString())); |
||||||
|
} |
||||||
|
|
||||||
|
} |
Loading…
Reference in new issue