master
yuan 6 years ago
parent 0c393ef0bc
commit 2337e30251

@ -506,3 +506,30 @@ CREATE TABLE `sys_mail_send` (
KEY `mail_address` (`mail_address`), KEY `mail_address` (`mail_address`),
KEY `id` (`id`) KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4
CREATE TABLE `sys_client_pre_apply` (
`client_pre_apply_id` int(11) NOT NULL,
`username` varchar(50) DEFAULT NULL,
`password` varchar(20) DEFAULT '',
`contact_person` varchar(50) DEFAULT NULL,
`contact_phone` varchar(20) DEFAULT '',
`contact_email` varchar(255) DEFAULT NULL,
`company_name` varchar(100) DEFAULT NULL,
`abn` varchar(20) DEFAULT NULL,
`short_name` varchar(50) DEFAULT NULL,
`address` varchar(200) DEFAULT NULL,
`suburb` varchar(50) DEFAULT NULL,
`state` varchar(20) DEFAULT NULL,
`postcode` varchar(20) DEFAULT NULL,
`industry` varchar(50) DEFAULT NULL,
`bank_no` varchar(20) DEFAULT NULL,
`bank_name` varchar(50) DEFAULT NULL,
`bsb_no` varchar(6) DEFAULT NULL,
`clean_days` smallint(6) DEFAULT NULL,
`create_time` datetime DEFAULT NULL,
`update_time` datetime DEFAULT NULL,
`agree` tinyint(1) DEFAULT NULL,
`company_phone` varchar(20) DEFAULT NULL,
PRIMARY KEY (`client_pre_apply_id`),
UNIQUE KEY `username` (`username`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

@ -30,6 +30,8 @@ public class ClientPreApplyBean {
private boolean agree; private boolean agree;
private String codeKey;
public JSONObject insertObject() { public JSONObject insertObject() {
JSONObject res = (JSONObject) JSON.toJSON(this); JSONObject res = (JSONObject) JSON.toJSON(this);
return res; return res;
@ -185,4 +187,12 @@ public class ClientPreApplyBean {
public void setCompany_phone(String company_phone) { public void setCompany_phone(String company_phone) {
this.company_phone = company_phone; this.company_phone = company_phone;
} }
public String getCodeKey() {
return codeKey;
}
public void setCodeKey(String codeKey) {
this.codeKey = codeKey;
}
} }

@ -219,12 +219,15 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService {
@Transactional @Transactional
public void updateApplyInfo(ClientPreApplyBean companyBean, String username) { public void updateApplyInfo(ClientPreApplyBean companyBean, String username) {
JSONObject apply = sysClientPreMapperMapper.findByUserName(username); JSONObject apply = sysClientPreMapperMapper.findByUserName(username);
if (apply != null ){
throw new BadRequestException("用户名已重复!");
}
JSONObject applyInfo = companyBean.insertObject(); JSONObject applyInfo = companyBean.insertObject();
if (apply == null ){
applyInfo.put("create_time",new Date()); applyInfo.put("create_time",new Date());
sysClientPreMapperMapper.save(applyInfo); sysClientPreMapperMapper.save(applyInfo);
}else {
applyInfo.put("client_pre_apply_id",apply.getIntValue("client_pre_apply_id"));
applyInfo.put("update_time",new Date());
sysClientPreMapperMapper.update(applyInfo);
}
if(applyInfo.getBoolean("agree")){ if(applyInfo.getBoolean("agree")){
applyerToClient(username); applyerToClient(username);
} }

@ -10,7 +10,7 @@ import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@AutoMapper(tablename = "sys_client_pre_apply", pkName = "client_pre_apply_id") @AutoMapper(tablename = "sys_client_pre_apply", pkName = "client_pre_apply_id",pkAutoIncrement = true)
public interface SysClientPreMapperMapper { public interface SysClientPreMapperMapper {
@AutoSql(type = SqlType.UPDATE) @AutoSql(type = SqlType.UPDATE)
void update(JSONObject data); void update(JSONObject data);

@ -216,6 +216,9 @@ angular.module('applyPartnerApp', ['ngMessages']).controller('applyPartnerCtrl',
}); });
return; return;
} }
if(index == 1){
$scope.partner.codeKey = Math.random().toString(16).substring(2);
}
$http.post('/register/info/update/' + $scope.partner.username, $scope.partner).then(function (resp) { $http.post('/register/info/update/' + $scope.partner.username, $scope.partner).then(function (resp) {
if (index == 3) { if (index == 3) {
$scope.getRateConfig(); $scope.getRateConfig();

Loading…
Cancel
Save