Commit 498c18fe by zhengxj

finish 用户服务项目定价 20200114 by zhengxj

git-svn-id: svn://192.168.3.233/frms/code/car-service/trunk/car-service@25832 aeb6102e-e053-11e5-9fec-f9ebc45caf4b
1 parent c5820e5a
......@@ -23,6 +23,15 @@ public class SysUserServiceFee {
private String remark;
private String reconciliationSn;
public String getReconciliationSn() {
return reconciliationSn;
}
public void setReconciliationSn(String reconciliationSn) {
this.reconciliationSn = reconciliationSn;
}
public BigDecimal getServiceFee() {
return serviceFee;
......@@ -37,7 +46,7 @@ public class SysUserServiceFee {
}
public void setFeeType(Integer feeType) {
feeType = feeType;
this.feeType = feeType;
}
public Integer getUserType() {
......
......@@ -18,5 +18,5 @@ public interface IUserServicefeeService {
void insertSelective(SysUserServiceFee sysUserServiceFee);
void updateUserServiceFee(String sysUserServiceFee, int userId);
void updateUserServiceFee(String sysUserServiceFee, int userId, int userType);
}
......@@ -89,7 +89,7 @@ public class SysProviderServiceImpl implements ISysProviderService {
@Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
public ResultObject save(SysManager sysManager) {
boolean isInsert = false;
// boolean isInsert = false;
if (sysManager.getOrgId() != null) {
//所属集团
Integer groupId = iSysOrganizationService.getGroupIdByOrgId(sysManager.getOrgId());
......@@ -97,7 +97,7 @@ public class SysProviderServiceImpl implements ISysProviderService {
}
//新增
if (sysManager.getId() == null) {
isInsert = true;
// isInsert = true;
List<SysUser> users = sysUserService.findByUserName(sysManager.getUsername());
if (CollectionUtils.isNotEmpty(users)) {
return new ResultObject(ResultCodeEnum.FAIL.getCode(),
......@@ -242,7 +242,7 @@ public class SysProviderServiceImpl implements ISysProviderService {
// v1.6.0,服务商服务项目报价
if (StringUtils.isNotNull(sysManager.getServiceFee())) {
userServicefeeService.updateUserServiceFee(sysManager.getServiceFee(), sysManager.getId());
userServicefeeService.updateUserServiceFee(sysManager.getServiceFee(), sysManager.getId(), USER_TYPE_SP);
}
return new ResultObject(ResultCodeEnum.SUCCESS.getCode(), ResultCodeEnum.SUCCESS.getMsg(), id);
......
......@@ -381,7 +381,7 @@ public class SysUserServiceImpl implements SysUserService {
//如果是更新角色和数据需要先删除原有的连接数据
if (userId == null) {
//普通用户需要根据user_id删除数据而不是自身的主键id
if (sysUser.getUserType() == com.glsx.common.constants.Constants.USER_TYPE_MANAGER) {
if (com.glsx.common.constants.Constants.USER_TYPE_MANAGER == sysUser.getUserType()) {
sysUser.setUserId(sysUser.getId());
}
sysUserOrgMapper.deleteByUserId(sysUser.getUserId());
......@@ -553,7 +553,8 @@ public class SysUserServiceImpl implements SysUserService {
// v1.6.0,技工服务项目报价
if (StringUtils.isNotEmpty(sysMechanic.getServiceFee())) {
userServicefeeService.updateUserServiceFee(sysMechanic.getServiceFee(), userId);
userServicefeeService.updateUserServiceFee(sysMechanic.getServiceFee(), userId,
com.glsx.common.constants.Constants.USER_TYPE_MECHANIC);
}
return result;
}
......
......@@ -87,9 +87,9 @@ public class UserServicefeeServiceImpl implements IUserServicefeeService {
* String)
*/
@Override
public void updateUserServiceFee(String str, int userId) {
public void updateUserServiceFee(String str, int userId, int userType) {
// String str= 908,100,100,100|45874,200,200,200
if (StringUtils.isNotBlank(str)) {
if (StringUtils.isNotBlank(str)) {
List<SysUserServiceFee> list = sysUserServiceFeeMapper.selectByUserId(userId);
if (!list.isEmpty()) {
sysUserServiceFeeMapper.batchInsertHistory(list);
......@@ -99,7 +99,7 @@ public class UserServicefeeServiceImpl implements IUserServicefeeService {
list = Lists.newArrayList();
}
String[] array = str.split("|");
String[] array = str.split("\\|");
Date now = new Date();
for (int i = 0; i < array.length; i++) {
......@@ -107,6 +107,7 @@ public class UserServicefeeServiceImpl implements IUserServicefeeService {
SysUserServiceFee sysUserServiceFee = new SysUserServiceFee();
sysUserServiceFee.setUserId(userId);
sysUserServiceFee.setCreateTime(now);
sysUserServiceFee.setUserType(userType);
sysUserServiceFee.setServiceCode(item.split(",")[0]);
if (BigDecimal.ZERO.compareTo(new BigDecimal(item.split(",")[1])) < 0) {
......@@ -120,7 +121,7 @@ public class UserServicefeeServiceImpl implements IUserServicefeeService {
SysUserServiceFee sysUserServiceFee2 = new SysUserServiceFee();
BeanUtils.copyBeanProp(sysUserServiceFee2, sysUserServiceFee);
sysUserServiceFee2.setServiceFee(new BigDecimal(item.split(",")[2]));
sysUserServiceFee2.setFeeType(com.glsx.usercenter.constants.Constants.FEE_TYPE_REPAIR);
sysUserServiceFee2.setFeeType(com.glsx.usercenter.constants.Constants.FEE_ORDER_DISMANTLE);
list.add(sysUserServiceFee2);
}
......@@ -128,7 +129,7 @@ public class UserServicefeeServiceImpl implements IUserServicefeeService {
SysUserServiceFee sysUserServiceFee3 = new SysUserServiceFee();
BeanUtils.copyBeanProp(sysUserServiceFee3, sysUserServiceFee);
sysUserServiceFee3.setServiceFee(new BigDecimal(item.split(",")[3]));
sysUserServiceFee3.setFeeType(com.glsx.usercenter.constants.Constants.FEE_ORDER_DISMANTLE);
sysUserServiceFee3.setFeeType(com.glsx.usercenter.constants.Constants.FEE_TYPE_REPAIR);
list.add(sysUserServiceFee3);
}
......
......@@ -327,7 +327,7 @@
bank_city ,
</if>
<if test="bankDistrict != null">
bank_ditstrict ,
bank_district ,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
......@@ -681,7 +681,7 @@
bank_city = #{bankCity,jdbcType=VARCHAR},
</if>
<if test="bankDistrict != null">
bank_ditstrict = #{bankDistrict,jdbcType=VARCHAR},
bank_district = #{bankDistrict,jdbcType=VARCHAR},
</if>
</set>
where user_id = #{id,jdbcType=INTEGER}
......
......@@ -6,7 +6,7 @@
<result column="user_id" jdbcType="INTEGER" property="userId" />
<result column="service_code" jdbcType="VARCHAR" property="serviceCode" />
<result column="service_fee" jdbcType="DECIMAL" property="serviceFee" />
<result column="fee_type" jdbcType="DECIMAL" property="feeType" />
<result column="fee_type" jdbcType="INTEGER" property="feeType" />
<result column="user_type" jdbcType="INTEGER" property="userType" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!