Commit 7333cc91 by duanhq

技工编辑bug修改 by duanht 2019/3/5

git-svn-id: svn://192.168.3.233/frms/code/car-service/trunk/car-service@18099 aeb6102e-e053-11e5-9fec-f9ebc45caf4b
1 parent 25a47072
......@@ -299,12 +299,12 @@ public class UserController extends BaseController {
* @param sysMechanic
* @return ResultObject
* @author duanht
* @Title: saveUser
* @Title: updateSysMechanicInfo
* @Description: 编辑技工
*/
@RequestMapping(value = "/updateSysMechanic")
@RequestMapping(value = "/updateSysMechanicInfo")
@ResponseBody
public ResultObject updateSysMechanic(@Validated(value = {Default.class}) SysMechanic sysMechanic, BindingResult bindingResult) {
public ResultObject updateSysMechanicInfo(@Validated(value = {Default.class}) SysMechanic sysMechanic, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
Map<String, String> errorMap = getErrors(bindingResult);
return new ResultObject(ResultCodeEnum.PARAM_ERROR.getCode(), ResultCodeEnum.PARAM_ERROR.getMsg(), errorMap);
......@@ -315,7 +315,7 @@ public class UserController extends BaseController {
sysMechanic.setUserType(Constants.USER_TYPE_MECHANIC);
sysMechanic.setUpdateBy(UserUtils.getUserName(request));
sysMechanic.setUpdateTime(DateUtil.getCurrentTime());
return new ResultObject(ResultCodeEnum.SUCCESS.getCode(), ResultCodeEnum.SUCCESS.getMsg(), sysUserService.saveSysMechanic(sysMechanic, null));
return new ResultObject(ResultCodeEnum.SUCCESS.getCode(), ResultCodeEnum.SUCCESS.getMsg(), sysUserService.saveSysMechanic(sysMechanic, 0));
}
......@@ -475,7 +475,7 @@ public class UserController extends BaseController {
* @param sysMerchant
* @return ResultObject
* @author duanht
* @Title: updateSysMechanic
* @Title: updateSysMerchant
* @Description: TODO 修改商户详细信息(小程序)
*/
@RequestMapping(value = "/updateSysMerchant", method = {RequestMethod.GET, RequestMethod.POST})
......
......@@ -41,7 +41,7 @@ public interface SysUserMapper {
int updateByExample(@Param("record") SysUser record, @Param("example") SysUserExample example);
int updateByPrimaryKeySelective(SysUser record);
int updateByPrimaryKeySelective(@Param("record")SysUser record);
int updateByPrimaryKey(SysUser record);
......
......@@ -42,9 +42,9 @@ public class SysMerchant extends SysUser {
private Integer serviceType;
/**
* 商户资源匹配状态(1:未绑定服务商;2:已绑定服务商未绑定技工;3:两者都绑定)
* 商户资源匹配状态(sys_user_status_unbound_service:未绑定服务商;sys_user_status_unbound_mechanic:已绑定服务商未绑定技工;sys_user_status_bound:两者都绑定)
*/
private Integer merchantStatus;
private String merchantStatus;
private SysArea sysArea;
......@@ -80,11 +80,11 @@ public class SysMerchant extends SysUser {
this.serviceType = serviceType;
}
public Integer getMerchantStatus() {
public String getMerchantStatus() {
return merchantStatus;
}
public void setMerchantStatus(Integer merchantStatus) {
public void setMerchantStatus(String merchantStatus) {
this.merchantStatus = merchantStatus;
}
......
......@@ -368,6 +368,10 @@ public class SysUserServiceImpl implements SysUserService {
BeanUtils.copyProperties(sysMechanic, sysUser);
updateRole(userId, sysUser);
updateServiceItem(userId, sysUser);
//编辑的时候userId为null
if(userId == null){
userId = sysMechanic.getId();
}
updateImage(userId, sysMechanic.getImageKeyList(), sysMechanic.getUrlList());
} catch (Exception e) {
throw new RuntimeException(e.getMessage());
......@@ -435,10 +439,11 @@ public class SysUserServiceImpl implements SysUserService {
//修改门店状态
SysMerchant sysMerchant = new SysMerchant();
sysMerchant.setId(sysResourceMatching.getMerchantId());
//(1:绑定服务商 2:绑定技工)
if (bindType == 1) {
sysMerchant.setMerchantStatus(2);
sysMerchant.setMerchantStatus("sys_user_status_unbound_mechanic");
} else {
sysMerchant.setMerchantStatus(3);
sysMerchant.setMerchantStatus("sys_user_status_bound");
}
sysUserMapper.updateSysMerchant(sysMerchant);
return sysResourceMatchingMapper.insert(sysResourceMatching);
......
......@@ -430,6 +430,51 @@
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="map">
update sys_user
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=INTEGER},
</if>
<if test="record.username != null">
username = #{record.username,jdbcType=VARCHAR},
</if>
<if test="record.name != null">
name = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.orgId != null">
org_id = #{record.orgId,jdbcType=INTEGER},
</if>
<if test="record.phoneNumber != null">
phone_number = #{record.phoneNumber,jdbcType=VARCHAR},
</if>
<if test="record.userStatus != null">
user_status = #{record.userStatus,jdbcType=VARCHAR},
</if>
<if test="record.createBy != null">
create_by = #{record.createBy,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
<if test="record.updateBy != null">
update_by = #{record.updateBy,jdbcType=VARCHAR},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
</if>
<if test="record.password != null">
password = #{record.password,jdbcType=VARCHAR},
</if>
<if test="record.sex != null">
sex = #{record.sex,jdbcType=VARCHAR},
</if>
<if test="record.remark != null">
remark = #{record.remark,jdbcType=VARCHAR},
</if>
</set>
where id = #{record.id,jdbcType=INTEGER}
</update>
<update id="updateSysUser" parameterType="com.glsx.usercenter.pojo.user.SysUser">
update sys_user
......@@ -504,7 +549,7 @@
service_type = #{serviceType,jdbcType=INTEGER},
</if>
<if test="merchantStatus != null">
merchant_status = #{merchantStatus,jdbcType=INTEGER},
merchant_status = #{merchantStatus,jdbcType=VARCHAR},
</if>
</set>
where user_id = #{id,jdbcType=INTEGER}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!