Commit c417466a by zhiwj

会员导入导出添加店长

parent ee28eb0f
......@@ -82,6 +82,7 @@ public class ClerkDTO implements Serializable {
private String operatorName;
private String storeName;
private String haobanStatusName;
private String clerkTypeName;
public Integer getClerkId() {
......@@ -235,4 +236,12 @@ public class ClerkDTO implements Serializable {
public void setHeadImg(String headImg) {
this.headImg = headImg;
}
public void setClerkTypeName(String clerkTypeName) {
this.clerkTypeName = clerkTypeName;
}
public String getClerkTypeName() {
return clerkTypeName;
}
}
......@@ -81,6 +81,7 @@ public class ClerkTmpDTO implements Serializable {
*
*/
private String operatorName;
private String clerkType;
public Integer getClerkTmpId() {
return clerkTmpId;
......@@ -201,4 +202,12 @@ public class ClerkTmpDTO implements Serializable {
public void setOperatorName(String operatorName) {
this.operatorName = operatorName;
}
public String getClerkType() {
return clerkType;
}
public void setClerkType(String clerkType) {
this.clerkType = clerkType;
}
}
......@@ -57,6 +57,11 @@ public class TabClerkTmp {
private String phoneNumber;
/**
* 是否店长
*/
private String clerkType;
/**
*
*/
private Date createTime;
......@@ -166,6 +171,14 @@ public class TabClerkTmp {
this.phoneNumber = phoneNumber;
}
public String getClerkType() {
return clerkType;
}
public void setClerkType(String clerkType) {
this.clerkType = clerkType;
}
public Date getCreateTime() {
return createTime;
}
......
......@@ -110,6 +110,7 @@ public class ClerkImportApiServiceImpl implements ClerkImportApiService {
list.add(clerkTmpDTO.getClerkGender());
list.add(clerkTmpDTO.getNationcode());
list.add(clerkTmpDTO.getPhoneNumber());
list.add(clerkTmpDTO.getClerkType());
list.add(clerkTmpDTO.getErrorMessage());
resultList.add(list);
}
......
......@@ -15,6 +15,7 @@ import com.task.allocation.api.AbstractTaskAllocationOperation;
import com.task.allocation.exception.TaskAllocationException;
import com.task.allocation.qo.InitTaskQO;
import com.task.allocation.util.TaskAllocationSdkClient;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -106,6 +107,7 @@ public class ClerkTaskServiceImpl extends AbstractTaskAllocationOperation implem
clerkDTO.setNationcode(t.getNationcode().trim());
clerkDTO.setPhoneNumber(t.getPhoneNumber().trim());
clerkDTO.setPositionName(t.getPositionName().trim());
clerkDTO.setClerkType(StringUtils.equals(t.getClerkType(), "是")? 1 : 0);
clerkDTO.setReason(ClerkLogReasonEnum.WEB.getCode());
clerkDTO.setRemark("批量导入");
......
......@@ -12,6 +12,7 @@
<result column="clerk_gender" jdbcType="VARCHAR" property="clerkGender" />
<result column="nationcode" jdbcType="VARCHAR" property="nationcode" />
<result column="phone_number" jdbcType="VARCHAR" property="phoneNumber" />
<result column="clerk_type" jdbcType="VARCHAR" property="clerkType" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="error_message" jdbcType="VARCHAR" property="errorMessage" />
......@@ -21,7 +22,7 @@
</resultMap>
<sql id="Base_Column_List">
clerk_tmp_id, enterprise_id, clerk_name, clerk_code, store_name, store_code, position_name,
clerk_gender, nationcode, phone_number, create_time, update_time, error_message,
clerk_gender, nationcode, phone_number, clerk_type, create_time, update_time, error_message,
sign_key, operator_id, operator_name
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
......@@ -38,15 +39,15 @@
insert into tab_clerk_tmp (clerk_tmp_id, enterprise_id, clerk_name,
clerk_code, store_name, store_code,
position_name, clerk_gender, nationcode,
phone_number, create_time, update_time,
error_message, sign_key, operator_id,
operator_name)
phone_number, clerk_type, create_time,
update_time, error_message, sign_key,
operator_id, operator_name)
values (#{clerkTmpId,jdbcType=INTEGER}, #{enterpriseId,jdbcType=INTEGER}, #{clerkName,jdbcType=VARCHAR},
#{clerkCode,jdbcType=VARCHAR}, #{storeName,jdbcType=VARCHAR}, #{storeCode,jdbcType=VARCHAR},
#{positionName,jdbcType=VARCHAR}, #{clerkGender,jdbcType=VARCHAR}, #{nationcode,jdbcType=VARCHAR},
#{phoneNumber,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP},
#{errorMessage,jdbcType=VARCHAR}, #{signKey,jdbcType=VARCHAR}, #{operatorId,jdbcType=INTEGER},
#{operatorName,jdbcType=VARCHAR})
#{phoneNumber,jdbcType=VARCHAR}, #{clerkType,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP}, #{errorMessage,jdbcType=VARCHAR}, #{signKey,jdbcType=VARCHAR},
#{operatorId,jdbcType=INTEGER}, #{operatorName,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.gic.store.entity.TabClerkTmp">
insert into tab_clerk_tmp
......@@ -81,6 +82,9 @@
<if test="phoneNumber != null">
phone_number,
</if>
<if test="clerkType != null">
clerk_type,
</if>
<if test="createTime != null">
create_time,
</if>
......@@ -131,6 +135,9 @@
<if test="phoneNumber != null">
#{phoneNumber,jdbcType=VARCHAR},
</if>
<if test="clerkType != null">
#{clerkType,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
......@@ -181,6 +188,9 @@
<if test="phoneNumber != null">
phone_number = #{phoneNumber,jdbcType=VARCHAR},
</if>
<if test="clerkType != null">
clerk_type = #{clerkType,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
......@@ -213,6 +223,7 @@
clerk_gender = #{clerkGender,jdbcType=VARCHAR},
nationcode = #{nationcode,jdbcType=VARCHAR},
phone_number = #{phoneNumber,jdbcType=VARCHAR},
clerk_type = #{clerkType,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
error_message = #{errorMessage,jdbcType=VARCHAR},
......
......@@ -134,6 +134,7 @@ public class ClerkController extends DownloadUtils {
for (ClerkDTO clerkDTO : clerkList) {
clerkDTO.setStoreName(clerkStoreListDTO.getStoreName());
clerkDTO.setHaobanStatusName(clerkDTO.getHaobanStatus() == null ? null : (clerkDTO.getHaobanStatus() == 1 ? "已绑定" : "未绑定"));
clerkDTO.setClerkTypeName(clerkDTO.getClerkType() == null ? null : (clerkDTO.getClerkType() == 1 ? "是" : "否"));
}
clerkDTOS.addAll(clerkList);
}
......
......@@ -232,9 +232,9 @@ public class ClerkImportController {
fileName = sdf.format(listErrorData.get(0).getUpdateTime()) + fileName;
List<List<String>> errorList = clerkImportApiService.listError(enterpriseId).getResult();
List<String> titleList = new ArrayList<>();
Collections.addAll(titleList, "序号", "导购名", "导购代码", "门店名", "门店代码", "职位", "性别", "区号", "手机号", "错误信息");
Collections.addAll(titleList, "序号", "导购名", "导购代码", "门店名", "门店代码", "职位", "性别", "区号", "手机号", "是否店长", "错误信息");
List<String> descriptionList = new ArrayList<>();
Collections.addAll(descriptionList, "", "必填,不能超过20个字", "必填,不能超过20个字,为导购的唯一识别码", "必填,不能超过20个字", "必填,不能超过20个字", "非必填,不能超过30个字", "\"男\"或\"女\"", "区号,如不填默认为 086", "必填,不能超过20个字", "");
Collections.addAll(descriptionList, "", "必填,不能超过20个字", "必填,不能超过20个字,为导购的唯一识别码", "必填,不能超过20个字", "必填,不能超过20个字", "非必填,不能超过30个字", "\"男\"或\"女\"", "区号,如不填默认为 +86", "必填,不能超过20个字", "必填, 是或否", "");
Workbook workbook = ExcelUtils.getWorkbook("导购导入错误记录", titleList, descriptionList, errorList, null);
byte[] bytesName = fileName.getBytes("UTF-8");
......@@ -389,6 +389,23 @@ public class ClerkImportController {
bean.setErrorMessage("手机号不能为空");
}
}
bean.setPhoneNumber(phoneNumber.trim());
// 验证是否店长
String clerkType = row.get(9);
bean.setClerkType(clerkType);
if (validate) {
if (StringUtils.isBlank(clerkType)) {
bean.setErrorMessage("是否店长不能为空");
validate = false;
}
}
if (validate) {
if (StringUtils.equals("是", clerkType) && StringUtils.equals("否", clerkType)) {
bean.setErrorMessage("是否店长类型不存在");
validate = false;
}
}
return bean;
}
......
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