Commit 7b8954a4 by manxiaoqiang

二版

parent 0e60f9ae
...@@ -57,6 +57,10 @@ ...@@ -57,6 +57,10 @@
<dmp.username>root</dmp.username> <dmp.username>root</dmp.username>
<dmp.password>reyun123</dmp.password> <dmp.password>reyun123</dmp.password>
<io.url>jdbc:mysql://192.168.2.57:3306/userio?characterEncoding=utf-8</io.url>
<io.username>root</io.username>
<io.password>reyun123</io.password>
<mail.host>smtp.exmail.qq.com</mail.host> <mail.host>smtp.exmail.qq.com</mail.host>
<mail.username>manager@reyun.com</mail.username> <mail.username>manager@reyun.com</mail.username>
<mail.password>Reyun123</mail.password> <mail.password>Reyun123</mail.password>
......
...@@ -32,6 +32,8 @@ public class Contract { ...@@ -32,6 +32,8 @@ public class Contract {
private Long payMoney; private Long payMoney;
private Long invoice; private Long invoice;
private String createName; private String createName;
private Long type;
private Long priceName;
private Long modifyAccount; private Long modifyAccount;
private Long createAccount; private Long createAccount;
...@@ -225,6 +227,23 @@ public class Contract { ...@@ -225,6 +227,23 @@ public class Contract {
this.invoice = invoice; this.invoice = invoice;
} }
public Long getType() {
return type;
}
public void setType(Long type) {
this.type = type;
}
@Transient
public Long getPriceName() {
return priceName;
}
public void setPriceName(Long priceName) {
this.priceName = priceName;
}
@Transient @Transient
public String getSaleName() { public String getSaleName() {
return saleName; return saleName;
......
package common.model;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import java.util.Date;
/**
* Created by mxq on 2018/4/11.
*/
@Entity
public class PressMoney {
private Long id;
private Long accountId;
private String email;
private Boolean pressStatus;
private Date modifyTime;
private String platform;
private Long user;
private String userName;
private String ds;
@Id
@GeneratedValue
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public Boolean getPressStatus() {
return pressStatus;
}
public void setPressStatus(Boolean pressStatus) {
this.pressStatus = pressStatus;
}
public Date getModifyTime() {
return modifyTime;
}
public void setModifyTime(Date modifyTime) {
this.modifyTime = modifyTime;
}
public String getPlatform() {
return platform;
}
public void setPlatform(String platform) {
this.platform = platform;
}
public Long getAccountId() {
return accountId;
}
public void setAccountId(Long accountId) {
this.accountId = accountId;
}
public Long getUser() {
return user;
}
public void setUser(Long user) {
this.user = user;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getDs() {
return ds;
}
public void setDs(String ds) {
this.ds = ds;
}
}
package common.repository;
import common.model.BackVisit;
import common.model.PressMoney;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
@Transactional
public interface PressMoneyRepository extends JpaRepository<PressMoney, Long> {
@Query(value = "SELECT * from press_money where platform = ?1 and press_status is true", nativeQuery = true)
List<PressMoney> findAllPress(String platform);
}
...@@ -83,8 +83,14 @@ public class ContractServiceImpl implements ContractService{ ...@@ -83,8 +83,14 @@ public class ContractServiceImpl implements ContractService{
@Override @Override
public Double getRebat(String product, Integer level, Long money) { public Double getRebat(String product, Integer level, Long money) {
PriceLevelMoney levelMoney = priceLevelMoneyRepository.getOne(product, level); Double rebat = 1d;
return money * 1.0 / levelMoney.getMoney(); try{
PriceLevelMoney levelMoney = priceLevelMoneyRepository.getOne(product, level);
rebat = money * 1.0 / levelMoney.getMoney();
} catch (Exception e){
e.printStackTrace();
}
return rebat;
} }
@Override @Override
......
package dic;
/**
* Created by mxq on 18/4/12.
* desc:合同类型
*/
public enum ContractTypeEnum {
MAIN("main","产品基础套餐"),
INCREMENT("increment","增值服务套餐");
private String key;
private String value;
ContractTypeEnum(String key, String value) {
this.key = key;
this.value = value;
}
public String getKey() {
return key;
}
public String getValue() {
return value;
}
}
...@@ -64,6 +64,24 @@ public class TkioAccountController { ...@@ -64,6 +64,24 @@ public class TkioAccountController {
return ResultModel.OK(tkioAccountService.enable(loginAccount, resource)); return ResultModel.OK(tkioAccountService.enable(loginAccount, resource));
} }
//关闭缴费提醒
@RequestMapping(value = "/forbidenpress", method = RequestMethod.PUT)
@ResponseBody
public ResultModel forbidenPress(@CurrentAccount User loginAccount, @RequestBody PressMoney resource, HttpServletRequest request) {
UserLogThread userlog = new UserLogThread(loginAccount.getEmail(), loginAccount.getName(), OperateObjectTypeEnum.CUSTOMER.getKey(), resource.getEmail(), "关闭异常状态跟进", request,loginAccount.getRole());
userlog.start();
return ResultModel.OK(tkioAccountService.forbidenPress(loginAccount, resource));
}
//开启缴费提醒
@RequestMapping(value = "/enablepress", method = RequestMethod.PUT)
@ResponseBody
public ResultModel enablePress(@CurrentAccount User loginAccount, @RequestBody PressMoney resource, HttpServletRequest request) {
UserLogThread userlog = new UserLogThread(loginAccount.getEmail(), loginAccount.getName(), OperateObjectTypeEnum.CUSTOMER.getKey(), resource.getEmail(), "开启异常状态跟进", request,loginAccount.getRole());
userlog.start();
return ResultModel.OK(tkioAccountService.enablePress(loginAccount, resource));
}
//缴费 //缴费
@RequestMapping(value = "/pay", method = RequestMethod.PUT) @RequestMapping(value = "/pay", method = RequestMethod.PUT)
@ResponseBody @ResponseBody
......
...@@ -20,6 +20,12 @@ public interface TkioAccountService { ...@@ -20,6 +20,12 @@ public interface TkioAccountService {
//到期提醒开启 //到期提醒开启
Reminder enable(User user, Reminder resource); Reminder enable(User user, Reminder resource);
//催款提醒关闭
PressMoney forbidenPress(User user, PressMoney resource);
//催款提醒开启
PressMoney enablePress(User user, PressMoney resource);
//缴费 //缴费
Payment pay(User user, Payment resource); Payment pay(User user, Payment resource);
......
...@@ -72,6 +72,8 @@ public class TkioAccountServiceImpl implements TkioAccountService { ...@@ -72,6 +72,8 @@ public class TkioAccountServiceImpl implements TkioAccountService {
UserService userService; UserService userService;
@Autowired @Autowired
ReminderLevelRepository reminderLevelRepository; ReminderLevelRepository reminderLevelRepository;
@Autowired
PressMoneyRepository pressMoneyRepository;
@Override @Override
public List<Account4Web> findAll(User user) { public List<Account4Web> findAll(User user) {
...@@ -224,6 +226,26 @@ public class TkioAccountServiceImpl implements TkioAccountService { ...@@ -224,6 +226,26 @@ public class TkioAccountServiceImpl implements TkioAccountService {
} }
@Override @Override
public PressMoney forbidenPress(User user, PressMoney resource) {
resource.setUser(user.getId());
resource.setModifyTime(new Date());
resource.setPlatform("tkio");
resource.setPressStatus(false);
resource.setDs(DateUtil.getBeforeDays(0));
return pressMoneyRepository.save(resource);
}
@Override
public PressMoney enablePress(User user, PressMoney resource) {
resource.setUser(user.getId());
resource.setModifyTime(new Date());
resource.setPlatform("tkio");
resource.setPressStatus(true);
resource.setDs(DateUtil.getBeforeDays(0));
return pressMoneyRepository.save(resource);
}
@Override
public Payment pay(User user, Payment resource) { public Payment pay(User user, Payment resource) {
resource.setUser(user.getId()); resource.setUser(user.getId());
resource.setPayDate(new Date()); resource.setPayDate(new Date());
......
...@@ -58,6 +58,24 @@ public class TrackAccountController { ...@@ -58,6 +58,24 @@ public class TrackAccountController {
return ResultModel.OK(tkioAccountService.enable(loginAccount, resource)); return ResultModel.OK(tkioAccountService.enable(loginAccount, resource));
} }
//关闭缴费提醒
@RequestMapping(value = "/forbidenpress", method = RequestMethod.PUT)
@ResponseBody
public ResultModel forbidenPress(@CurrentAccount User loginAccount, @RequestBody PressMoney resource, HttpServletRequest request) {
UserLogThread userlog = new UserLogThread(loginAccount.getEmail(), loginAccount.getName(), OperateObjectTypeEnum.CUSTOMER.getKey(), resource.getEmail(), "关闭异常状态跟进", request,loginAccount.getRole());
userlog.start();
return ResultModel.OK(tkioAccountService.forbidenPress(loginAccount, resource));
}
//开启缴费提醒
@RequestMapping(value = "/enablepress", method = RequestMethod.PUT)
@ResponseBody
public ResultModel enablePress(@CurrentAccount User loginAccount, @RequestBody PressMoney resource, HttpServletRequest request) {
UserLogThread userlog = new UserLogThread(loginAccount.getEmail(), loginAccount.getName(), OperateObjectTypeEnum.CUSTOMER.getKey(), resource.getEmail(), "开启异常状态跟进", request,loginAccount.getRole());
userlog.start();
return ResultModel.OK(tkioAccountService.enablePress(loginAccount, resource));
}
//缴费 //缴费
@RequestMapping(value = "/pay", method = RequestMethod.PUT) @RequestMapping(value = "/pay", method = RequestMethod.PUT)
@ResponseBody @ResponseBody
......
...@@ -19,6 +19,13 @@ public interface TrackAccountService { ...@@ -19,6 +19,13 @@ public interface TrackAccountService {
//到期提醒开启 //到期提醒开启
Reminder enable(User user, Reminder resource); Reminder enable(User user, Reminder resource);
//催款提醒关闭
PressMoney forbidenPress(User user, PressMoney resource);
//催款提醒开启
PressMoney enablePress(User user, PressMoney resource);
//缴费 //缴费
Payment pay(User user, Payment resource); Payment pay(User user, Payment resource);
......
...@@ -60,6 +60,8 @@ public class TrackAccountServiceImpl implements TrackAccountService{ ...@@ -60,6 +60,8 @@ public class TrackAccountServiceImpl implements TrackAccountService{
ContractChangeRepository contractChangeRepository; ContractChangeRepository contractChangeRepository;
@Autowired @Autowired
PackageTypeRepository packageTypeRepository; PackageTypeRepository packageTypeRepository;
@Autowired
PressMoneyRepository pressMoneyRepository;
@Override @Override
public List<TrackAccount4Web> findAll(User user) { public List<TrackAccount4Web> findAll(User user) {
...@@ -163,6 +165,26 @@ public class TrackAccountServiceImpl implements TrackAccountService{ ...@@ -163,6 +165,26 @@ public class TrackAccountServiceImpl implements TrackAccountService{
} }
@Override @Override
public PressMoney forbidenPress(User user, PressMoney resource) {
resource.setUser(user.getId());
resource.setModifyTime(new Date());
resource.setPlatform("track");
resource.setPressStatus(false);
resource.setDs(DateUtil.getBeforeDays(0));
return pressMoneyRepository.save(resource);
}
@Override
public PressMoney enablePress(User user, PressMoney resource) {
resource.setUser(user.getId());
resource.setModifyTime(new Date());
resource.setPlatform("track");
resource.setPressStatus(true);
resource.setDs(DateUtil.getBeforeDays(0));
return pressMoneyRepository.save(resource);
}
@Override
public Payment pay(User user, Payment resource) { public Payment pay(User user, Payment resource) {
resource.setUser(user.getId()); resource.setUser(user.getId());
resource.setPayDate(new Date()); resource.setPayDate(new Date());
......
...@@ -19,4 +19,8 @@ track.dataSource.password=${track.password} ...@@ -19,4 +19,8 @@ track.dataSource.password=${track.password}
dmp.dataSource.url=${dmp.url} dmp.dataSource.url=${dmp.url}
dmp.dataSource.username=${dmp.username} dmp.dataSource.username=${dmp.username}
dmp.dataSource.password=${dmp.password} dmp.dataSource.password=${dmp.password}
\ No newline at end of file
io.dataSource.url=${io.url}
io.dataSource.username=${io.username}
io.dataSource.password=${io.password}
\ No newline at end of file
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
<context:component-scan base-package="tkio" /> <context:component-scan base-package="tkio" />
<context:component-scan base-package="track" /> <context:component-scan base-package="track" />
<context:component-scan base-package="userio" />
<context:component-scan base-package="common" /> <context:component-scan base-package="common" />
<context:component-scan base-package="office" /> <context:component-scan base-package="office" />
<context:component-scan base-package="dmp" /> <context:component-scan base-package="dmp" />
...@@ -80,6 +81,11 @@ ...@@ -80,6 +81,11 @@
<property name="username" value="${dmp.dataSource.username}"/> <property name="username" value="${dmp.dataSource.username}"/>
<property name="password" value="${dmp.dataSource.password}"/> <property name="password" value="${dmp.dataSource.password}"/>
</bean> </bean>
<bean id="ioDataSource" parent="parentDataSource">
<property name="url" value="${io.dataSource.url}"/>
<property name="username" value="${io.dataSource.username}"/>
<property name="password" value="${io.dataSource.password}"/>
</bean>
<!-- JPA实体管理工厂的配置 --> <!-- JPA实体管理工厂的配置 -->
<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"> <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
...@@ -173,6 +179,25 @@ ...@@ -173,6 +179,25 @@
</props> </props>
</property> </property>
</bean> </bean>
<bean id="ioEntityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="dataSource" ref="ioDataSource"/>
<property name="packagesToScan" value="userio.model"></property>
<property name="persistenceUnitName" value="ioUnit" />
<property name="jpaVendorAdapter" ref="hibernateJpaVendorAdapter"/>
<property name="jpaProperties">
<props>
<prop key="hibernate.ejb.naming_strategy">org.hibernate.cfg.ImprovedNamingStrategy</prop>
<prop key="hibernate.show_sql">false</prop>
<prop key="hibernate.hbm2ddl.auto">update</prop><!-- none -->
<prop key="hibernate.connection.CharSet">utf8</prop>
<prop key="hibernate.connection.characterEncoding">utf8</prop>
<prop key="hibernate.connection.useUnicode">true</prop>
</props>
</property>
</bean>
<!--指定实现JPA的适配器 --> <!--指定实现JPA的适配器 -->
<bean id="hibernateJpaVendorAdapter" class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"> <bean id="hibernateJpaVendorAdapter" class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
<property name="databasePlatform" value="org.hibernate.dialect.MySQLDialect"/> <property name="databasePlatform" value="org.hibernate.dialect.MySQLDialect"/>
...@@ -194,6 +219,9 @@ ...@@ -194,6 +219,9 @@
<bean id="dmpTransactionManager" class="org.springframework.orm.jpa.JpaTransactionManager"> <bean id="dmpTransactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
<property name="entityManagerFactory" ref="dmpEntityManagerFactory"/> <property name="entityManagerFactory" ref="dmpEntityManagerFactory"/>
</bean> </bean>
<bean id="ioTransactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
<property name="entityManagerFactory" ref="ioEntityManagerFactory"/>
</bean>
<!-- Spring Data Jpa配置 --> <!-- Spring Data Jpa配置 -->
<jpa:repositories base-package="common.repository" <jpa:repositories base-package="common.repository"
...@@ -211,6 +239,9 @@ ...@@ -211,6 +239,9 @@
<jpa:repositories base-package="dmp.repository" <jpa:repositories base-package="dmp.repository"
repository-impl-postfix="Impl" transaction-manager-ref="dmpTransactionManager" repository-impl-postfix="Impl" transaction-manager-ref="dmpTransactionManager"
entity-manager-factory-ref="dmpEntityManagerFactory"/> entity-manager-factory-ref="dmpEntityManagerFactory"/>
<jpa:repositories base-package="userio.repository"
repository-impl-postfix="Impl" transaction-manager-ref="ioTransactionManager"
entity-manager-factory-ref="ioEntityManagerFactory"/>
<!-- 使用annotation定义事务 --> <!-- 使用annotation定义事务 -->
...@@ -219,6 +250,7 @@ ...@@ -219,6 +250,7 @@
<tx:annotation-driven transaction-manager="tkioTransactionManager" proxy-target-class="true"/> <tx:annotation-driven transaction-manager="tkioTransactionManager" proxy-target-class="true"/>
<tx:annotation-driven transaction-manager="trackTransactionManager" proxy-target-class="true"/> <tx:annotation-driven transaction-manager="trackTransactionManager" proxy-target-class="true"/>
<tx:annotation-driven transaction-manager="dmpTransactionManager" proxy-target-class="true"/> <tx:annotation-driven transaction-manager="dmpTransactionManager" proxy-target-class="true"/>
<tx:annotation-driven transaction-manager="ioTransactionManager" proxy-target-class="true"/>
<tx:advice id="txAdvice" transaction-manager="transactionManager"> <tx:advice id="txAdvice" transaction-manager="transactionManager">
<tx:attributes> <tx:attributes>
...@@ -266,6 +298,15 @@ ...@@ -266,6 +298,15 @@
<tx:method name="*" propagation="REQUIRED"/> <tx:method name="*" propagation="REQUIRED"/>
</tx:attributes> </tx:attributes>
</tx:advice> </tx:advice>
<tx:advice id="ioTxAdvice" transaction-manager="ioTransactionManager">
<tx:attributes>
<tx:method name="report*" propagation="SUPPORTS" read-only="true"/>
<tx:method name="list*" propagation="SUPPORTS" read-only="true"/>
<tx:method name="query*" propagation="SUPPORTS" read-only="true"/>
<tx:method name="find*" propagation="SUPPORTS" read-only="true"/>
<tx:method name="*" propagation="REQUIRED"/>
</tx:attributes>
</tx:advice>
<aop:config expose-proxy="true"> <aop:config expose-proxy="true">
<aop:pointcut id="txPointcut" expression="execution(* common.service.*.*(..))"/> <aop:pointcut id="txPointcut" expression="execution(* common.service.*.*(..))"/>
...@@ -283,6 +324,10 @@ ...@@ -283,6 +324,10 @@
<aop:pointcut id="tracktxPointcut" expression="execution(* track.service.*.*(..))"/> <aop:pointcut id="tracktxPointcut" expression="execution(* track.service.*.*(..))"/>
<aop:advisor advice-ref="trackTxAdvice" pointcut-ref="tracktxPointcut"/> <aop:advisor advice-ref="trackTxAdvice" pointcut-ref="tracktxPointcut"/>
</aop:config> </aop:config>
<aop:config expose-proxy="true">
<aop:pointcut id="iotxPointcut" expression="execution(* userio.service.*.*(..))"/>
<aop:advisor advice-ref="ioTxAdvice" pointcut-ref="iotxPointcut"/>
</aop:config>
<!-- SpringMVC上传文件时,需要配置MultipartResolver处理器 --> <!-- SpringMVC上传文件时,需要配置MultipartResolver处理器 -->
<bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver"> <bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment