diff --git a/cweb/src/main/java/com/cweb/controller/BsDeviceController.java b/cweb/src/main/java/com/cweb/controller/BsDeviceController.java index 3cdc566..fa4b751 100644 --- a/cweb/src/main/java/com/cweb/controller/BsDeviceController.java +++ b/cweb/src/main/java/com/cweb/controller/BsDeviceController.java @@ -54,6 +54,52 @@ public class BsDeviceController { @Resource private UserCenter userCenter; + @RequestMapping(value="/bindStore",method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "绑定门店") + public ResponseData bindStore(@RequestBody JSONObject body) { + try { + if (body.getLong("storeId") == null || StringUtils.isBlank(body.getString("deviceNo"))) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + // 查询设备 + BsDevice device = deviceService.getDetailByNo(body.getString("deviceNo")); + if (device == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的设备"); + } + + deviceService.bindStore(device.getId(), body.getLong("storeId") ); + + return ResponseMsgUtil.success("操作成功"); + } catch (Exception e) { + log.error(e.getMessage(), e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/unbindStore",method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "解绑门店") + public ResponseData unbindStore(@RequestBody JSONObject body) { + try { + if (StringUtils.isBlank(body.getString("deviceNo"))) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + // 查询设备 + BsDevice device = deviceService.getDetailByNo(body.getString("deviceNo")); + if (device == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的设备"); + } + + deviceService.unbindStore(device.getId()); + + return ResponseMsgUtil.success("操作成功"); + } catch (Exception e) { + log.error(e.getMessage(), e); + return ResponseMsgUtil.exception(e); + } + } + @RequestMapping(value="/getDevicePrice",method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询设备金额") diff --git a/service/src/main/java/com/hfkj/dao/BsDeviceOperateLogMapper.java b/service/src/main/java/com/hfkj/dao/BsDeviceOperateLogMapper.java index db86f3d..a3d17de 100644 --- a/service/src/main/java/com/hfkj/dao/BsDeviceOperateLogMapper.java +++ b/service/src/main/java/com/hfkj/dao/BsDeviceOperateLogMapper.java @@ -39,12 +39,20 @@ public interface BsDeviceOperateLogMapper extends BsDeviceOperateLogMapperExt { int deleteByPrimaryKey(Long id); @Insert({ - "insert into bs_device_operate_log (device_id, `type`, ", - "content, op_user_id, ", + "insert into bs_device_operate_log (company_id, company_name, ", + "agent_id, agent_name, ", + "salesman_id, salesman_name, ", + "mer_id, mer_name, store_id, ", + "store_name, device_id, ", + "`type`, content, op_user_id, ", "op_user_name, create_time, ", "ext_1, ext_2, ext_3)", - "values (#{deviceId,jdbcType=BIGINT}, #{type,jdbcType=INTEGER}, ", - "#{content,jdbcType=VARCHAR}, #{opUserId,jdbcType=BIGINT}, ", + "values (#{companyId,jdbcType=BIGINT}, #{companyName,jdbcType=VARCHAR}, ", + "#{agentId,jdbcType=BIGINT}, #{agentName,jdbcType=VARCHAR}, ", + "#{salesmanId,jdbcType=BIGINT}, #{salesmanName,jdbcType=VARCHAR}, ", + "#{merId,jdbcType=BIGINT}, #{merName,jdbcType=VARCHAR}, #{storeId,jdbcType=BIGINT}, ", + "#{storeName,jdbcType=VARCHAR}, #{deviceId,jdbcType=BIGINT}, ", + "#{type,jdbcType=INTEGER}, #{content,jdbcType=VARCHAR}, #{opUserId,jdbcType=BIGINT}, ", "#{opUserName,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, ", "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" }) @@ -58,6 +66,16 @@ public interface BsDeviceOperateLogMapper extends BsDeviceOperateLogMapperExt { @SelectProvider(type=BsDeviceOperateLogSqlProvider.class, method="selectByExample") @Results({ @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="company_id", property="companyId", jdbcType=JdbcType.BIGINT), + @Result(column="company_name", property="companyName", jdbcType=JdbcType.VARCHAR), + @Result(column="agent_id", property="agentId", jdbcType=JdbcType.BIGINT), + @Result(column="agent_name", property="agentName", jdbcType=JdbcType.VARCHAR), + @Result(column="salesman_id", property="salesmanId", jdbcType=JdbcType.BIGINT), + @Result(column="salesman_name", property="salesmanName", jdbcType=JdbcType.VARCHAR), + @Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT), + @Result(column="mer_name", property="merName", jdbcType=JdbcType.VARCHAR), + @Result(column="store_id", property="storeId", jdbcType=JdbcType.BIGINT), + @Result(column="store_name", property="storeName", jdbcType=JdbcType.VARCHAR), @Result(column="device_id", property="deviceId", jdbcType=JdbcType.BIGINT), @Result(column="type", property="type", jdbcType=JdbcType.INTEGER), @Result(column="content", property="content", jdbcType=JdbcType.VARCHAR), @@ -72,13 +90,24 @@ public interface BsDeviceOperateLogMapper extends BsDeviceOperateLogMapperExt { @Select({ "select", - "id, device_id, `type`, content, op_user_id, op_user_name, create_time, ext_1, ", - "ext_2, ext_3", + "id, company_id, company_name, agent_id, agent_name, salesman_id, salesman_name, ", + "mer_id, mer_name, store_id, store_name, device_id, `type`, content, op_user_id, ", + "op_user_name, create_time, ext_1, ext_2, ext_3", "from bs_device_operate_log", "where id = #{id,jdbcType=BIGINT}" }) @Results({ @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="company_id", property="companyId", jdbcType=JdbcType.BIGINT), + @Result(column="company_name", property="companyName", jdbcType=JdbcType.VARCHAR), + @Result(column="agent_id", property="agentId", jdbcType=JdbcType.BIGINT), + @Result(column="agent_name", property="agentName", jdbcType=JdbcType.VARCHAR), + @Result(column="salesman_id", property="salesmanId", jdbcType=JdbcType.BIGINT), + @Result(column="salesman_name", property="salesmanName", jdbcType=JdbcType.VARCHAR), + @Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT), + @Result(column="mer_name", property="merName", jdbcType=JdbcType.VARCHAR), + @Result(column="store_id", property="storeId", jdbcType=JdbcType.BIGINT), + @Result(column="store_name", property="storeName", jdbcType=JdbcType.VARCHAR), @Result(column="device_id", property="deviceId", jdbcType=JdbcType.BIGINT), @Result(column="type", property="type", jdbcType=JdbcType.INTEGER), @Result(column="content", property="content", jdbcType=JdbcType.VARCHAR), @@ -102,7 +131,17 @@ public interface BsDeviceOperateLogMapper extends BsDeviceOperateLogMapperExt { @Update({ "update bs_device_operate_log", - "set device_id = #{deviceId,jdbcType=BIGINT},", + "set company_id = #{companyId,jdbcType=BIGINT},", + "company_name = #{companyName,jdbcType=VARCHAR},", + "agent_id = #{agentId,jdbcType=BIGINT},", + "agent_name = #{agentName,jdbcType=VARCHAR},", + "salesman_id = #{salesmanId,jdbcType=BIGINT},", + "salesman_name = #{salesmanName,jdbcType=VARCHAR},", + "mer_id = #{merId,jdbcType=BIGINT},", + "mer_name = #{merName,jdbcType=VARCHAR},", + "store_id = #{storeId,jdbcType=BIGINT},", + "store_name = #{storeName,jdbcType=VARCHAR},", + "device_id = #{deviceId,jdbcType=BIGINT},", "`type` = #{type,jdbcType=INTEGER},", "content = #{content,jdbcType=VARCHAR},", "op_user_id = #{opUserId,jdbcType=BIGINT},", diff --git a/service/src/main/java/com/hfkj/dao/BsDeviceOperateLogSqlProvider.java b/service/src/main/java/com/hfkj/dao/BsDeviceOperateLogSqlProvider.java index 0e355a5..b4f9eeb 100644 --- a/service/src/main/java/com/hfkj/dao/BsDeviceOperateLogSqlProvider.java +++ b/service/src/main/java/com/hfkj/dao/BsDeviceOperateLogSqlProvider.java @@ -28,6 +28,46 @@ public class BsDeviceOperateLogSqlProvider { SQL sql = new SQL(); sql.INSERT_INTO("bs_device_operate_log"); + if (record.getCompanyId() != null) { + sql.VALUES("company_id", "#{companyId,jdbcType=BIGINT}"); + } + + if (record.getCompanyName() != null) { + sql.VALUES("company_name", "#{companyName,jdbcType=VARCHAR}"); + } + + if (record.getAgentId() != null) { + sql.VALUES("agent_id", "#{agentId,jdbcType=BIGINT}"); + } + + if (record.getAgentName() != null) { + sql.VALUES("agent_name", "#{agentName,jdbcType=VARCHAR}"); + } + + if (record.getSalesmanId() != null) { + sql.VALUES("salesman_id", "#{salesmanId,jdbcType=BIGINT}"); + } + + if (record.getSalesmanName() != null) { + sql.VALUES("salesman_name", "#{salesmanName,jdbcType=VARCHAR}"); + } + + if (record.getMerId() != null) { + sql.VALUES("mer_id", "#{merId,jdbcType=BIGINT}"); + } + + if (record.getMerName() != null) { + sql.VALUES("mer_name", "#{merName,jdbcType=VARCHAR}"); + } + + if (record.getStoreId() != null) { + sql.VALUES("store_id", "#{storeId,jdbcType=BIGINT}"); + } + + if (record.getStoreName() != null) { + sql.VALUES("store_name", "#{storeName,jdbcType=VARCHAR}"); + } + if (record.getDeviceId() != null) { sql.VALUES("device_id", "#{deviceId,jdbcType=BIGINT}"); } @@ -74,6 +114,16 @@ public class BsDeviceOperateLogSqlProvider { } else { sql.SELECT("id"); } + sql.SELECT("company_id"); + sql.SELECT("company_name"); + sql.SELECT("agent_id"); + sql.SELECT("agent_name"); + sql.SELECT("salesman_id"); + sql.SELECT("salesman_name"); + sql.SELECT("mer_id"); + sql.SELECT("mer_name"); + sql.SELECT("store_id"); + sql.SELECT("store_name"); sql.SELECT("device_id"); sql.SELECT("`type`"); sql.SELECT("content"); @@ -104,6 +154,46 @@ public class BsDeviceOperateLogSqlProvider { sql.SET("id = #{record.id,jdbcType=BIGINT}"); } + if (record.getCompanyId() != null) { + sql.SET("company_id = #{record.companyId,jdbcType=BIGINT}"); + } + + if (record.getCompanyName() != null) { + sql.SET("company_name = #{record.companyName,jdbcType=VARCHAR}"); + } + + if (record.getAgentId() != null) { + sql.SET("agent_id = #{record.agentId,jdbcType=BIGINT}"); + } + + if (record.getAgentName() != null) { + sql.SET("agent_name = #{record.agentName,jdbcType=VARCHAR}"); + } + + if (record.getSalesmanId() != null) { + sql.SET("salesman_id = #{record.salesmanId,jdbcType=BIGINT}"); + } + + if (record.getSalesmanName() != null) { + sql.SET("salesman_name = #{record.salesmanName,jdbcType=VARCHAR}"); + } + + if (record.getMerId() != null) { + sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}"); + } + + if (record.getMerName() != null) { + sql.SET("mer_name = #{record.merName,jdbcType=VARCHAR}"); + } + + if (record.getStoreId() != null) { + sql.SET("store_id = #{record.storeId,jdbcType=BIGINT}"); + } + + if (record.getStoreName() != null) { + sql.SET("store_name = #{record.storeName,jdbcType=VARCHAR}"); + } + if (record.getDeviceId() != null) { sql.SET("device_id = #{record.deviceId,jdbcType=BIGINT}"); } @@ -149,6 +239,16 @@ public class BsDeviceOperateLogSqlProvider { sql.UPDATE("bs_device_operate_log"); sql.SET("id = #{record.id,jdbcType=BIGINT}"); + sql.SET("company_id = #{record.companyId,jdbcType=BIGINT}"); + sql.SET("company_name = #{record.companyName,jdbcType=VARCHAR}"); + sql.SET("agent_id = #{record.agentId,jdbcType=BIGINT}"); + sql.SET("agent_name = #{record.agentName,jdbcType=VARCHAR}"); + sql.SET("salesman_id = #{record.salesmanId,jdbcType=BIGINT}"); + sql.SET("salesman_name = #{record.salesmanName,jdbcType=VARCHAR}"); + sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}"); + sql.SET("mer_name = #{record.merName,jdbcType=VARCHAR}"); + sql.SET("store_id = #{record.storeId,jdbcType=BIGINT}"); + sql.SET("store_name = #{record.storeName,jdbcType=VARCHAR}"); sql.SET("device_id = #{record.deviceId,jdbcType=BIGINT}"); sql.SET("`type` = #{record.type,jdbcType=INTEGER}"); sql.SET("content = #{record.content,jdbcType=VARCHAR}"); @@ -168,6 +268,46 @@ public class BsDeviceOperateLogSqlProvider { SQL sql = new SQL(); sql.UPDATE("bs_device_operate_log"); + if (record.getCompanyId() != null) { + sql.SET("company_id = #{companyId,jdbcType=BIGINT}"); + } + + if (record.getCompanyName() != null) { + sql.SET("company_name = #{companyName,jdbcType=VARCHAR}"); + } + + if (record.getAgentId() != null) { + sql.SET("agent_id = #{agentId,jdbcType=BIGINT}"); + } + + if (record.getAgentName() != null) { + sql.SET("agent_name = #{agentName,jdbcType=VARCHAR}"); + } + + if (record.getSalesmanId() != null) { + sql.SET("salesman_id = #{salesmanId,jdbcType=BIGINT}"); + } + + if (record.getSalesmanName() != null) { + sql.SET("salesman_name = #{salesmanName,jdbcType=VARCHAR}"); + } + + if (record.getMerId() != null) { + sql.SET("mer_id = #{merId,jdbcType=BIGINT}"); + } + + if (record.getMerName() != null) { + sql.SET("mer_name = #{merName,jdbcType=VARCHAR}"); + } + + if (record.getStoreId() != null) { + sql.SET("store_id = #{storeId,jdbcType=BIGINT}"); + } + + if (record.getStoreName() != null) { + sql.SET("store_name = #{storeName,jdbcType=VARCHAR}"); + } + if (record.getDeviceId() != null) { sql.SET("device_id = #{deviceId,jdbcType=BIGINT}"); } diff --git a/service/src/main/java/com/hfkj/entity/BsDeviceOperateLog.java b/service/src/main/java/com/hfkj/entity/BsDeviceOperateLog.java index 359a7a3..85ad7b6 100644 --- a/service/src/main/java/com/hfkj/entity/BsDeviceOperateLog.java +++ b/service/src/main/java/com/hfkj/entity/BsDeviceOperateLog.java @@ -18,6 +18,56 @@ public class BsDeviceOperateLog implements Serializable { */ private Long id; + /** + * 公司id + */ + private Long companyId; + + /** + * 公司名称 + */ + private String companyName; + + /** + * 代理商id + */ + private Long agentId; + + /** + * 代理商名称 + */ + private String agentName; + + /** + * 业务员id + */ + private Long salesmanId; + + /** + * 业务名称 + */ + private String salesmanName; + + /** + * 商户id + */ + private Long merId; + + /** + * 商户名称 + */ + private String merName; + + /** + * 门店id + */ + private Long storeId; + + /** + * 门店名称 + */ + private String storeName; + /** * 设备id */ @@ -64,6 +114,86 @@ public class BsDeviceOperateLog implements Serializable { this.id = id; } + public Long getCompanyId() { + return companyId; + } + + public void setCompanyId(Long companyId) { + this.companyId = companyId; + } + + public String getCompanyName() { + return companyName; + } + + public void setCompanyName(String companyName) { + this.companyName = companyName; + } + + public Long getAgentId() { + return agentId; + } + + public void setAgentId(Long agentId) { + this.agentId = agentId; + } + + public String getAgentName() { + return agentName; + } + + public void setAgentName(String agentName) { + this.agentName = agentName; + } + + public Long getSalesmanId() { + return salesmanId; + } + + public void setSalesmanId(Long salesmanId) { + this.salesmanId = salesmanId; + } + + public String getSalesmanName() { + return salesmanName; + } + + public void setSalesmanName(String salesmanName) { + this.salesmanName = salesmanName; + } + + public Long getMerId() { + return merId; + } + + public void setMerId(Long merId) { + this.merId = merId; + } + + public String getMerName() { + return merName; + } + + public void setMerName(String merName) { + this.merName = merName; + } + + public Long getStoreId() { + return storeId; + } + + public void setStoreId(Long storeId) { + this.storeId = storeId; + } + + public String getStoreName() { + return storeName; + } + + public void setStoreName(String storeName) { + this.storeName = storeName; + } + public Long getDeviceId() { return deviceId; } @@ -149,6 +279,16 @@ public class BsDeviceOperateLog implements Serializable { } BsDeviceOperateLog other = (BsDeviceOperateLog) that; return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getCompanyId() == null ? other.getCompanyId() == null : this.getCompanyId().equals(other.getCompanyId())) + && (this.getCompanyName() == null ? other.getCompanyName() == null : this.getCompanyName().equals(other.getCompanyName())) + && (this.getAgentId() == null ? other.getAgentId() == null : this.getAgentId().equals(other.getAgentId())) + && (this.getAgentName() == null ? other.getAgentName() == null : this.getAgentName().equals(other.getAgentName())) + && (this.getSalesmanId() == null ? other.getSalesmanId() == null : this.getSalesmanId().equals(other.getSalesmanId())) + && (this.getSalesmanName() == null ? other.getSalesmanName() == null : this.getSalesmanName().equals(other.getSalesmanName())) + && (this.getMerId() == null ? other.getMerId() == null : this.getMerId().equals(other.getMerId())) + && (this.getMerName() == null ? other.getMerName() == null : this.getMerName().equals(other.getMerName())) + && (this.getStoreId() == null ? other.getStoreId() == null : this.getStoreId().equals(other.getStoreId())) + && (this.getStoreName() == null ? other.getStoreName() == null : this.getStoreName().equals(other.getStoreName())) && (this.getDeviceId() == null ? other.getDeviceId() == null : this.getDeviceId().equals(other.getDeviceId())) && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType())) && (this.getContent() == null ? other.getContent() == null : this.getContent().equals(other.getContent())) @@ -165,6 +305,16 @@ public class BsDeviceOperateLog implements Serializable { final int prime = 31; int result = 1; result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); + result = prime * result + ((getCompanyId() == null) ? 0 : getCompanyId().hashCode()); + result = prime * result + ((getCompanyName() == null) ? 0 : getCompanyName().hashCode()); + result = prime * result + ((getAgentId() == null) ? 0 : getAgentId().hashCode()); + result = prime * result + ((getAgentName() == null) ? 0 : getAgentName().hashCode()); + result = prime * result + ((getSalesmanId() == null) ? 0 : getSalesmanId().hashCode()); + result = prime * result + ((getSalesmanName() == null) ? 0 : getSalesmanName().hashCode()); + result = prime * result + ((getMerId() == null) ? 0 : getMerId().hashCode()); + result = prime * result + ((getMerName() == null) ? 0 : getMerName().hashCode()); + result = prime * result + ((getStoreId() == null) ? 0 : getStoreId().hashCode()); + result = prime * result + ((getStoreName() == null) ? 0 : getStoreName().hashCode()); result = prime * result + ((getDeviceId() == null) ? 0 : getDeviceId().hashCode()); result = prime * result + ((getType() == null) ? 0 : getType().hashCode()); result = prime * result + ((getContent() == null) ? 0 : getContent().hashCode()); @@ -184,6 +334,16 @@ public class BsDeviceOperateLog implements Serializable { sb.append(" ["); sb.append("Hash = ").append(hashCode()); sb.append(", id=").append(id); + sb.append(", companyId=").append(companyId); + sb.append(", companyName=").append(companyName); + sb.append(", agentId=").append(agentId); + sb.append(", agentName=").append(agentName); + sb.append(", salesmanId=").append(salesmanId); + sb.append(", salesmanName=").append(salesmanName); + sb.append(", merId=").append(merId); + sb.append(", merName=").append(merName); + sb.append(", storeId=").append(storeId); + sb.append(", storeName=").append(storeName); sb.append(", deviceId=").append(deviceId); sb.append(", type=").append(type); sb.append(", content=").append(content); diff --git a/service/src/main/java/com/hfkj/entity/BsDeviceOperateLogExample.java b/service/src/main/java/com/hfkj/entity/BsDeviceOperateLogExample.java index 5de1eab..c4aec92 100644 --- a/service/src/main/java/com/hfkj/entity/BsDeviceOperateLogExample.java +++ b/service/src/main/java/com/hfkj/entity/BsDeviceOperateLogExample.java @@ -185,6 +185,656 @@ public class BsDeviceOperateLogExample { return (Criteria) this; } + public Criteria andCompanyIdIsNull() { + addCriterion("company_id is null"); + return (Criteria) this; + } + + public Criteria andCompanyIdIsNotNull() { + addCriterion("company_id is not null"); + return (Criteria) this; + } + + public Criteria andCompanyIdEqualTo(Long value) { + addCriterion("company_id =", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdNotEqualTo(Long value) { + addCriterion("company_id <>", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdGreaterThan(Long value) { + addCriterion("company_id >", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdGreaterThanOrEqualTo(Long value) { + addCriterion("company_id >=", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdLessThan(Long value) { + addCriterion("company_id <", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdLessThanOrEqualTo(Long value) { + addCriterion("company_id <=", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdIn(List values) { + addCriterion("company_id in", values, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdNotIn(List values) { + addCriterion("company_id not in", values, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdBetween(Long value1, Long value2) { + addCriterion("company_id between", value1, value2, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdNotBetween(Long value1, Long value2) { + addCriterion("company_id not between", value1, value2, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyNameIsNull() { + addCriterion("company_name is null"); + return (Criteria) this; + } + + public Criteria andCompanyNameIsNotNull() { + addCriterion("company_name is not null"); + return (Criteria) this; + } + + public Criteria andCompanyNameEqualTo(String value) { + addCriterion("company_name =", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameNotEqualTo(String value) { + addCriterion("company_name <>", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameGreaterThan(String value) { + addCriterion("company_name >", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameGreaterThanOrEqualTo(String value) { + addCriterion("company_name >=", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameLessThan(String value) { + addCriterion("company_name <", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameLessThanOrEqualTo(String value) { + addCriterion("company_name <=", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameLike(String value) { + addCriterion("company_name like", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameNotLike(String value) { + addCriterion("company_name not like", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameIn(List values) { + addCriterion("company_name in", values, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameNotIn(List values) { + addCriterion("company_name not in", values, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameBetween(String value1, String value2) { + addCriterion("company_name between", value1, value2, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameNotBetween(String value1, String value2) { + addCriterion("company_name not between", value1, value2, "companyName"); + return (Criteria) this; + } + + public Criteria andAgentIdIsNull() { + addCriterion("agent_id is null"); + return (Criteria) this; + } + + public Criteria andAgentIdIsNotNull() { + addCriterion("agent_id is not null"); + return (Criteria) this; + } + + public Criteria andAgentIdEqualTo(Long value) { + addCriterion("agent_id =", value, "agentId"); + return (Criteria) this; + } + + public Criteria andAgentIdNotEqualTo(Long value) { + addCriterion("agent_id <>", value, "agentId"); + return (Criteria) this; + } + + public Criteria andAgentIdGreaterThan(Long value) { + addCriterion("agent_id >", value, "agentId"); + return (Criteria) this; + } + + public Criteria andAgentIdGreaterThanOrEqualTo(Long value) { + addCriterion("agent_id >=", value, "agentId"); + return (Criteria) this; + } + + public Criteria andAgentIdLessThan(Long value) { + addCriterion("agent_id <", value, "agentId"); + return (Criteria) this; + } + + public Criteria andAgentIdLessThanOrEqualTo(Long value) { + addCriterion("agent_id <=", value, "agentId"); + return (Criteria) this; + } + + public Criteria andAgentIdIn(List values) { + addCriterion("agent_id in", values, "agentId"); + return (Criteria) this; + } + + public Criteria andAgentIdNotIn(List values) { + addCriterion("agent_id not in", values, "agentId"); + return (Criteria) this; + } + + public Criteria andAgentIdBetween(Long value1, Long value2) { + addCriterion("agent_id between", value1, value2, "agentId"); + return (Criteria) this; + } + + public Criteria andAgentIdNotBetween(Long value1, Long value2) { + addCriterion("agent_id not between", value1, value2, "agentId"); + return (Criteria) this; + } + + public Criteria andAgentNameIsNull() { + addCriterion("agent_name is null"); + return (Criteria) this; + } + + public Criteria andAgentNameIsNotNull() { + addCriterion("agent_name is not null"); + return (Criteria) this; + } + + public Criteria andAgentNameEqualTo(String value) { + addCriterion("agent_name =", value, "agentName"); + return (Criteria) this; + } + + public Criteria andAgentNameNotEqualTo(String value) { + addCriterion("agent_name <>", value, "agentName"); + return (Criteria) this; + } + + public Criteria andAgentNameGreaterThan(String value) { + addCriterion("agent_name >", value, "agentName"); + return (Criteria) this; + } + + public Criteria andAgentNameGreaterThanOrEqualTo(String value) { + addCriterion("agent_name >=", value, "agentName"); + return (Criteria) this; + } + + public Criteria andAgentNameLessThan(String value) { + addCriterion("agent_name <", value, "agentName"); + return (Criteria) this; + } + + public Criteria andAgentNameLessThanOrEqualTo(String value) { + addCriterion("agent_name <=", value, "agentName"); + return (Criteria) this; + } + + public Criteria andAgentNameLike(String value) { + addCriterion("agent_name like", value, "agentName"); + return (Criteria) this; + } + + public Criteria andAgentNameNotLike(String value) { + addCriterion("agent_name not like", value, "agentName"); + return (Criteria) this; + } + + public Criteria andAgentNameIn(List values) { + addCriterion("agent_name in", values, "agentName"); + return (Criteria) this; + } + + public Criteria andAgentNameNotIn(List values) { + addCriterion("agent_name not in", values, "agentName"); + return (Criteria) this; + } + + public Criteria andAgentNameBetween(String value1, String value2) { + addCriterion("agent_name between", value1, value2, "agentName"); + return (Criteria) this; + } + + public Criteria andAgentNameNotBetween(String value1, String value2) { + addCriterion("agent_name not between", value1, value2, "agentName"); + return (Criteria) this; + } + + public Criteria andSalesmanIdIsNull() { + addCriterion("salesman_id is null"); + return (Criteria) this; + } + + public Criteria andSalesmanIdIsNotNull() { + addCriterion("salesman_id is not null"); + return (Criteria) this; + } + + public Criteria andSalesmanIdEqualTo(Long value) { + addCriterion("salesman_id =", value, "salesmanId"); + return (Criteria) this; + } + + public Criteria andSalesmanIdNotEqualTo(Long value) { + addCriterion("salesman_id <>", value, "salesmanId"); + return (Criteria) this; + } + + public Criteria andSalesmanIdGreaterThan(Long value) { + addCriterion("salesman_id >", value, "salesmanId"); + return (Criteria) this; + } + + public Criteria andSalesmanIdGreaterThanOrEqualTo(Long value) { + addCriterion("salesman_id >=", value, "salesmanId"); + return (Criteria) this; + } + + public Criteria andSalesmanIdLessThan(Long value) { + addCriterion("salesman_id <", value, "salesmanId"); + return (Criteria) this; + } + + public Criteria andSalesmanIdLessThanOrEqualTo(Long value) { + addCriterion("salesman_id <=", value, "salesmanId"); + return (Criteria) this; + } + + public Criteria andSalesmanIdIn(List values) { + addCriterion("salesman_id in", values, "salesmanId"); + return (Criteria) this; + } + + public Criteria andSalesmanIdNotIn(List values) { + addCriterion("salesman_id not in", values, "salesmanId"); + return (Criteria) this; + } + + public Criteria andSalesmanIdBetween(Long value1, Long value2) { + addCriterion("salesman_id between", value1, value2, "salesmanId"); + return (Criteria) this; + } + + public Criteria andSalesmanIdNotBetween(Long value1, Long value2) { + addCriterion("salesman_id not between", value1, value2, "salesmanId"); + return (Criteria) this; + } + + public Criteria andSalesmanNameIsNull() { + addCriterion("salesman_name is null"); + return (Criteria) this; + } + + public Criteria andSalesmanNameIsNotNull() { + addCriterion("salesman_name is not null"); + return (Criteria) this; + } + + public Criteria andSalesmanNameEqualTo(String value) { + addCriterion("salesman_name =", value, "salesmanName"); + return (Criteria) this; + } + + public Criteria andSalesmanNameNotEqualTo(String value) { + addCriterion("salesman_name <>", value, "salesmanName"); + return (Criteria) this; + } + + public Criteria andSalesmanNameGreaterThan(String value) { + addCriterion("salesman_name >", value, "salesmanName"); + return (Criteria) this; + } + + public Criteria andSalesmanNameGreaterThanOrEqualTo(String value) { + addCriterion("salesman_name >=", value, "salesmanName"); + return (Criteria) this; + } + + public Criteria andSalesmanNameLessThan(String value) { + addCriterion("salesman_name <", value, "salesmanName"); + return (Criteria) this; + } + + public Criteria andSalesmanNameLessThanOrEqualTo(String value) { + addCriterion("salesman_name <=", value, "salesmanName"); + return (Criteria) this; + } + + public Criteria andSalesmanNameLike(String value) { + addCriterion("salesman_name like", value, "salesmanName"); + return (Criteria) this; + } + + public Criteria andSalesmanNameNotLike(String value) { + addCriterion("salesman_name not like", value, "salesmanName"); + return (Criteria) this; + } + + public Criteria andSalesmanNameIn(List values) { + addCriterion("salesman_name in", values, "salesmanName"); + return (Criteria) this; + } + + public Criteria andSalesmanNameNotIn(List values) { + addCriterion("salesman_name not in", values, "salesmanName"); + return (Criteria) this; + } + + public Criteria andSalesmanNameBetween(String value1, String value2) { + addCriterion("salesman_name between", value1, value2, "salesmanName"); + return (Criteria) this; + } + + public Criteria andSalesmanNameNotBetween(String value1, String value2) { + addCriterion("salesman_name not between", value1, value2, "salesmanName"); + return (Criteria) this; + } + + public Criteria andMerIdIsNull() { + addCriterion("mer_id is null"); + return (Criteria) this; + } + + public Criteria andMerIdIsNotNull() { + addCriterion("mer_id is not null"); + return (Criteria) this; + } + + public Criteria andMerIdEqualTo(Long value) { + addCriterion("mer_id =", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdNotEqualTo(Long value) { + addCriterion("mer_id <>", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdGreaterThan(Long value) { + addCriterion("mer_id >", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdGreaterThanOrEqualTo(Long value) { + addCriterion("mer_id >=", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdLessThan(Long value) { + addCriterion("mer_id <", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdLessThanOrEqualTo(Long value) { + addCriterion("mer_id <=", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdIn(List values) { + addCriterion("mer_id in", values, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdNotIn(List values) { + addCriterion("mer_id not in", values, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdBetween(Long value1, Long value2) { + addCriterion("mer_id between", value1, value2, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdNotBetween(Long value1, Long value2) { + addCriterion("mer_id not between", value1, value2, "merId"); + return (Criteria) this; + } + + public Criteria andMerNameIsNull() { + addCriterion("mer_name is null"); + return (Criteria) this; + } + + public Criteria andMerNameIsNotNull() { + addCriterion("mer_name is not null"); + return (Criteria) this; + } + + public Criteria andMerNameEqualTo(String value) { + addCriterion("mer_name =", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameNotEqualTo(String value) { + addCriterion("mer_name <>", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameGreaterThan(String value) { + addCriterion("mer_name >", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameGreaterThanOrEqualTo(String value) { + addCriterion("mer_name >=", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameLessThan(String value) { + addCriterion("mer_name <", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameLessThanOrEqualTo(String value) { + addCriterion("mer_name <=", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameLike(String value) { + addCriterion("mer_name like", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameNotLike(String value) { + addCriterion("mer_name not like", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameIn(List values) { + addCriterion("mer_name in", values, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameNotIn(List values) { + addCriterion("mer_name not in", values, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameBetween(String value1, String value2) { + addCriterion("mer_name between", value1, value2, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameNotBetween(String value1, String value2) { + addCriterion("mer_name not between", value1, value2, "merName"); + return (Criteria) this; + } + + public Criteria andStoreIdIsNull() { + addCriterion("store_id is null"); + return (Criteria) this; + } + + public Criteria andStoreIdIsNotNull() { + addCriterion("store_id is not null"); + return (Criteria) this; + } + + public Criteria andStoreIdEqualTo(Long value) { + addCriterion("store_id =", value, "storeId"); + return (Criteria) this; + } + + public Criteria andStoreIdNotEqualTo(Long value) { + addCriterion("store_id <>", value, "storeId"); + return (Criteria) this; + } + + public Criteria andStoreIdGreaterThan(Long value) { + addCriterion("store_id >", value, "storeId"); + return (Criteria) this; + } + + public Criteria andStoreIdGreaterThanOrEqualTo(Long value) { + addCriterion("store_id >=", value, "storeId"); + return (Criteria) this; + } + + public Criteria andStoreIdLessThan(Long value) { + addCriterion("store_id <", value, "storeId"); + return (Criteria) this; + } + + public Criteria andStoreIdLessThanOrEqualTo(Long value) { + addCriterion("store_id <=", value, "storeId"); + return (Criteria) this; + } + + public Criteria andStoreIdIn(List values) { + addCriterion("store_id in", values, "storeId"); + return (Criteria) this; + } + + public Criteria andStoreIdNotIn(List values) { + addCriterion("store_id not in", values, "storeId"); + return (Criteria) this; + } + + public Criteria andStoreIdBetween(Long value1, Long value2) { + addCriterion("store_id between", value1, value2, "storeId"); + return (Criteria) this; + } + + public Criteria andStoreIdNotBetween(Long value1, Long value2) { + addCriterion("store_id not between", value1, value2, "storeId"); + return (Criteria) this; + } + + public Criteria andStoreNameIsNull() { + addCriterion("store_name is null"); + return (Criteria) this; + } + + public Criteria andStoreNameIsNotNull() { + addCriterion("store_name is not null"); + return (Criteria) this; + } + + public Criteria andStoreNameEqualTo(String value) { + addCriterion("store_name =", value, "storeName"); + return (Criteria) this; + } + + public Criteria andStoreNameNotEqualTo(String value) { + addCriterion("store_name <>", value, "storeName"); + return (Criteria) this; + } + + public Criteria andStoreNameGreaterThan(String value) { + addCriterion("store_name >", value, "storeName"); + return (Criteria) this; + } + + public Criteria andStoreNameGreaterThanOrEqualTo(String value) { + addCriterion("store_name >=", value, "storeName"); + return (Criteria) this; + } + + public Criteria andStoreNameLessThan(String value) { + addCriterion("store_name <", value, "storeName"); + return (Criteria) this; + } + + public Criteria andStoreNameLessThanOrEqualTo(String value) { + addCriterion("store_name <=", value, "storeName"); + return (Criteria) this; + } + + public Criteria andStoreNameLike(String value) { + addCriterion("store_name like", value, "storeName"); + return (Criteria) this; + } + + public Criteria andStoreNameNotLike(String value) { + addCriterion("store_name not like", value, "storeName"); + return (Criteria) this; + } + + public Criteria andStoreNameIn(List values) { + addCriterion("store_name in", values, "storeName"); + return (Criteria) this; + } + + public Criteria andStoreNameNotIn(List values) { + addCriterion("store_name not in", values, "storeName"); + return (Criteria) this; + } + + public Criteria andStoreNameBetween(String value1, String value2) { + addCriterion("store_name between", value1, value2, "storeName"); + return (Criteria) this; + } + + public Criteria andStoreNameNotBetween(String value1, String value2) { + addCriterion("store_name not between", value1, value2, "storeName"); + return (Criteria) this; + } + public Criteria andDeviceIdIsNull() { addCriterion("device_id is null"); return (Criteria) this; diff --git a/service/src/main/java/com/hfkj/service/BsDeviceOperateLogService.java b/service/src/main/java/com/hfkj/service/BsDeviceOperateLogService.java index 7d232e8..3e5f170 100644 --- a/service/src/main/java/com/hfkj/service/BsDeviceOperateLogService.java +++ b/service/src/main/java/com/hfkj/service/BsDeviceOperateLogService.java @@ -15,6 +15,6 @@ public interface BsDeviceOperateLogService { * @param opUserId 操作人员id * @param opUserName 操作人员名称 */ - void insertLog(Long deviceId, DeviceOpTypeEnum deviceOpType, String content, Long opUserId,String opUserName); + void insertLog(Long deviceId, DeviceOpTypeEnum deviceOpType, String content, Long opUserId,String opUserName,Long objectId); } diff --git a/service/src/main/java/com/hfkj/service/BsDeviceService.java b/service/src/main/java/com/hfkj/service/BsDeviceService.java index ed4729a..9ba68fe 100644 --- a/service/src/main/java/com/hfkj/service/BsDeviceService.java +++ b/service/src/main/java/com/hfkj/service/BsDeviceService.java @@ -68,6 +68,18 @@ public interface BsDeviceService { */ void bindSalesman(Long deviceId, Long salesmanId); + /** + * 批量绑定业务员 + * @param deviceIdList + */ + void batchUnbindSalesman(List deviceIdList); + + /** + * 解绑业务员 + * @param deviceId 设备id + */ + void unbindSalesman(Long deviceId); + /** * 绑定门店 * @param deviceId 设备id diff --git a/service/src/main/java/com/hfkj/service/impl/BsDeviceOperateLogServiceImpl.java b/service/src/main/java/com/hfkj/service/impl/BsDeviceOperateLogServiceImpl.java index 016fc75..e9fcfa1 100644 --- a/service/src/main/java/com/hfkj/service/impl/BsDeviceOperateLogServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/impl/BsDeviceOperateLogServiceImpl.java @@ -1,8 +1,8 @@ package com.hfkj.service.impl; import com.hfkj.dao.BsDeviceOperateLogMapper; -import com.hfkj.entity.BsDeviceOperateLog; -import com.hfkj.service.BsDeviceOperateLogService; +import com.hfkj.entity.*; +import com.hfkj.service.*; import com.hfkj.sysenum.DeviceOpTypeEnum; import org.springframework.stereotype.Service; @@ -11,12 +11,19 @@ import java.util.Date; @Service("deviceOperateLogService") public class BsDeviceOperateLogServiceImpl implements BsDeviceOperateLogService { - @Resource private BsDeviceOperateLogMapper deviceOperateLogMapper; + @Resource + private BsCompanyService companyService; + @Resource + private BsAgentService agentService; + @Resource + private BsSalesmanService salesmanService; + @Resource + private BsStoreService storeService; @Override - public void insertLog(Long deviceId, DeviceOpTypeEnum deviceOpType, String content, Long opUserId, String opUserName) { + public void insertLog(Long deviceId, DeviceOpTypeEnum deviceOpType, String content, Long opUserId, String opUserName,Long objectId) { BsDeviceOperateLog log = new BsDeviceOperateLog(); log.setDeviceId(deviceId); log.setType(deviceOpType.getNumber()); @@ -24,6 +31,53 @@ public class BsDeviceOperateLogServiceImpl implements BsDeviceOperateLogService log.setOpUserId(opUserId); log.setOpUserName(opUserName); log.setCreateTime(new Date()); + + + if (deviceOpType.getNumber().equals(DeviceOpTypeEnum.type1.getNumber()) + || deviceOpType.getNumber().equals(DeviceOpTypeEnum.type2.getNumber()) + || deviceOpType.getNumber().equals(DeviceOpTypeEnum.type3.getNumber())) { + + } else if (deviceOpType.getNumber().equals(DeviceOpTypeEnum.type4.getNumber()) + || deviceOpType.getNumber().equals(DeviceOpTypeEnum.type5.getNumber())) { + BsCompany company = companyService.getCompanyById(objectId); + log.setCompanyId(company.getId()); + log.setCompanyName(company.getName()); + + } else if (deviceOpType.getNumber().equals(DeviceOpTypeEnum.type6.getNumber()) + || deviceOpType.getNumber().equals(DeviceOpTypeEnum.type7.getNumber())) { + + BsAgent agent = agentService.getAgent(objectId); + log.setCompanyId(agent.getCompanyId()); + log.setCompanyName(agent.getCompanyName()); + log.setAgentId(agent.getId()); + log.setAgentName(agent.getName()); + + } else if (deviceOpType.getNumber().equals(DeviceOpTypeEnum.type8.getNumber()) + || deviceOpType.getNumber().equals(DeviceOpTypeEnum.type9.getNumber())) { + + BsSalesman salesman = salesmanService.getSalesman(objectId); + log.setCompanyId(salesman.getCompanyId()); + log.setCompanyName(salesman.getCompanyName()); + log.setAgentId(salesman.getAgentId()); + log.setAgentName(salesman.getAgentName()); + log.setSalesmanId(salesman.getId()); + log.setSalesmanName(salesman.getName()); + + } else if (deviceOpType.getNumber().equals(DeviceOpTypeEnum.type10.getNumber()) + || deviceOpType.getNumber().equals(DeviceOpTypeEnum.type11.getNumber())) { + + BsStore store = storeService.getStoreById(objectId); + log.setCompanyId(store.getCompanyId()); + log.setCompanyName(store.getCompanyName()); + log.setAgentId(store.getAgentId()); + log.setAgentName(store.getAgentName()); + log.setSalesmanId(store.getSalesmanId()); + log.setSalesmanName(store.getSalesmanName()); + log.setMerId(store.getMerId()); + log.setMerName(store.getMerName()); + log.setStoreId(store.getId()); + log.setStoreName(store.getName()); + } deviceOperateLogMapper.insert(log); } diff --git a/service/src/main/java/com/hfkj/service/impl/BsDeviceServiceImpl.java b/service/src/main/java/com/hfkj/service/impl/BsDeviceServiceImpl.java index 9f3a466..534d4c8 100644 --- a/service/src/main/java/com/hfkj/service/impl/BsDeviceServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/impl/BsDeviceServiceImpl.java @@ -66,7 +66,8 @@ public class BsDeviceServiceImpl implements BsDeviceService { DeviceOpTypeEnum.type1, "新增设备", device.getOpUserId(), - device.getOpUserName()); + device.getOpUserName(), + device.getId()); } @Override @@ -83,7 +84,8 @@ public class BsDeviceServiceImpl implements BsDeviceService { DeviceOpTypeEnum.type2, "修改设备", device.getOpUserId(), - device.getOpUserName()); + device.getOpUserName(), + device.getId()); } @Override @@ -118,10 +120,11 @@ public class BsDeviceServiceImpl implements BsDeviceService { // 设备操作日志 deviceOperateLogService.insertLog(device.getId(), - DeviceOpTypeEnum.type6, + DeviceOpTypeEnum.type4, "分配设备", device.getOpUserId(), - device.getOpUserName()); + device.getOpUserName(), + device.getCompanyId()); } @Override @@ -159,7 +162,8 @@ public class BsDeviceServiceImpl implements BsDeviceService { DeviceOpTypeEnum.type6, "分配设备", device.getOpUserId(), - device.getOpUserName()); + device.getOpUserName(), + device.getAgentId()); } @Override @@ -196,7 +200,50 @@ public class BsDeviceServiceImpl implements BsDeviceService { DeviceOpTypeEnum.type8, "分配设备", device.getOpUserId(), - device.getOpUserName()); + device.getOpUserName(), + device.getSalesmanId()); + } + + @Override + public void batchUnbindSalesman(List deviceIdList) { + for (Long id : deviceIdList) { + unbindSalesman(id); + } + } + + @Override + public void unbindSalesman(Long deviceId) { + UserInfoModel userModel = userCenter.getSessionModel(UserInfoModel.class); + if (userModel == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.SEC_USER_EXPIRED, ""); + } + // 设备 + BsDevice device = getDetail(deviceId); + if (device == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到设备信息"); + } + if (!device.getStatus().equals(DeviceStatusEnum.status1.getNumber())) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "设备状态异常"); + } + if (device.getStoreId() == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "无法解绑,未绑定门店"); + } + + device.setSalesmanId(null); + device.setSalesmanName(null); + device.setMerId(null); + device.setMerName(null); + device.setStoreId(null); + device.setStoreName(null); + editDevice(device); + + // 设备操作日志 + deviceOperateLogService.insertLog(device.getId(), + DeviceOpTypeEnum.type9, + "设备解绑", + device.getOpUserId(), + device.getOpUserName(), + device.getSalesmanId()); } @Override @@ -239,10 +286,11 @@ public class BsDeviceServiceImpl implements BsDeviceService { // 设备操作日志 deviceOperateLogService.insertLog(device.getId(), - DeviceOpTypeEnum.type4, + DeviceOpTypeEnum.type10, "分配设备", device.getOpUserId(), - device.getOpUserName()); + device.getOpUserName(), + device.getStoreId()); } @Override @@ -271,10 +319,11 @@ public class BsDeviceServiceImpl implements BsDeviceService { // 设备操作日志 deviceOperateLogService.insertLog(device.getId(), - DeviceOpTypeEnum.type5, + DeviceOpTypeEnum.type11, "设备解绑", device.getOpUserId(), - device.getOpUserName()); + device.getOpUserName(), + device.getStoreId()); } @Override diff --git a/service/src/main/java/com/hfkj/sysenum/DeviceOpTypeEnum.java b/service/src/main/java/com/hfkj/sysenum/DeviceOpTypeEnum.java index c4232fa..ba6a151 100644 --- a/service/src/main/java/com/hfkj/sysenum/DeviceOpTypeEnum.java +++ b/service/src/main/java/com/hfkj/sysenum/DeviceOpTypeEnum.java @@ -8,12 +8,14 @@ public enum DeviceOpTypeEnum { type1(1, "添加"), type2(2, "修改"), type3(3, "删除"), - type4(4, "绑定门店"), - type5(5, "解绑门店"), + type4(4, "分配公司"), + type5(5, "解绑公司"), type6(6, "分配代理商"), type7(7, "解绑代理商"), type8(8, "分配业务员"), type9(9, "解绑业务员"), + type10(10, "分配门店"), + type11(11, "解绑门店"), ; private Integer number;