Commit f7380696 authored by wangyihao's avatar wangyihao

修改

parent 4ce27d53
......@@ -12,9 +12,10 @@ import cn.com.fqy.common.Operator;
import cn.com.fqy.common.ResultInfo;
import cn.com.fqy.core.common.BaseController;
import cn.com.fqy.core.common.PageFinder;
import cn.com.fqy.core.model.Administrators;
import cn.com.fqy.core.model.Query;
import cn.com.fqy.core.model.Store;
import cn.com.fqy.core.model.Worker;
import cn.com.fqy.core.service.StoreService;
import cn.com.fqy.core.service.WorkerService;
@Controller
@RequestMapping("worker")
......@@ -22,6 +23,8 @@ public class WorkerController extends BaseController {
@Resource
private WorkerService workerService;
@Resource
private StoreService storeService;
/*
* 分页展示员工信息
......@@ -44,6 +47,12 @@ public class WorkerController extends BaseController {
@ResponseBody
public ResultInfo<Worker> addOrEditWorker(Worker worker) {
ResultInfo<Worker> resultInfo = new ResultInfo<>();
if(worker.getStoreId() != null && !"".equals(worker.getStoreId())) {
Store store = storeService.getStore(worker.getStoreId());
if(null != store) {
worker.setStoreName(store.getStoreName());
}
}
//操作人
Operator op = getOperator();
if (worker!=null&&worker.getWorkerId()!=null&&!"".equals(worker.getWorkerId())) {
......
......@@ -2,6 +2,7 @@ package cn.com.fqy.core.model;
import java.util.Date;
import cn.com.fqy.common.Entity;
/**
......@@ -89,6 +90,8 @@ public class Worker extends Entity<String> {
private Integer serialNumber;
//是否删除(0未删除 1 删除)
private Integer isDeleted;
//店铺名称
private String storeName;
/*Auto generated properties end*/
......@@ -105,6 +108,14 @@ public class Worker extends Entity<String> {
return isDeleted;
}
public String getStoreName() {
return storeName;
}
public void setStoreName(String storeName) {
this.storeName = storeName;
}
public void setIsDeleted(Integer isDeleted) {
this.isDeleted = isDeleted;
}
......@@ -435,6 +446,6 @@ public class Worker extends Entity<String> {
+ createTime + ", createTimeStart=" + createTimeStart + ", createTimeEnd=" + createTimeEnd
+ ", updateTime=" + updateTime + ", updateTimeStart=" + updateTimeStart + ", updateTimeEnd="
+ updateTimeEnd + ", operatorId=" + operatorId + ", operatorType=" + operatorType + ", serialNumber="
+ serialNumber + ", isDeleted=" + isDeleted + "]";
+ serialNumber + ", isDeleted=" + isDeleted + ", storeName=" + storeName + "]";
}
}
......@@ -189,7 +189,7 @@ public class StoreServiceImpl implements StoreService {
} else {
try {
//如果传入参数的主键为null,则调用生成主键的方法获取新的主键
if (store.getStoreId() == null) {
if (store.getStoreId() == null || "".equals(store.getStoreId())) {
store.setStoreId(this.generatePK());
}
//如果传入的操作人不为null,则设置新增记录的操作人类型和操作人id
......
......@@ -188,7 +188,7 @@ public class WorkerServiceImpl implements WorkerService {
} else {
try {
//如果传入参数的主键为null,则调用生成主键的方法获取新的主键
if (worker.getWorkerId() == null) {
if (worker.getWorkerId() == null || "".equals(worker.getWorkerId())) {
worker.setWorkerId(this.generatePK());
}
//如果传入的操作人不为null,则设置新增记录的操作人类型和操作人id
......
......@@ -27,4 +27,5 @@ mybatis.mapper-locations=classpath:mybatis/mapper/*.xml
image_path=https://carnet.fqyxa.com/image-server/
res_img_path=/opt/fqy/files/carnet/image/
file_path=https://carnet.fqyxa.com/file-server/
res_file_path=/opt/fqy/files/carnet/files/
\ No newline at end of file
res_file_path=/opt/fqy/files/carnet/files/
......@@ -33,6 +33,7 @@
<result column="OPERATOR_TYPE" property="operatorType" javaType="java.lang.Integer" jdbcType="TINYINT"/>
<result column="SERIAL_NUMBER" property="serialNumber" javaType="java.lang.Integer" jdbcType="INTEGER"/>
<result column="IS_DELETED" property="isDeleted" javaType="java.lang.Integer" jdbcType="TINYINT"/>
<result column="STORE_NAME" property="storeName" javaType="java.lang.String" jdbcType="VARCHAR"/>
</resultMap>
......@@ -42,16 +43,16 @@ WORKER_ID,WORKER_NAME,WORKER_NUMBER,WORKER_SEX,WORKER_AGE,WORKER_BIRTHDAY,WORKER
WORKER_HEIGHT,WORKER_WEIGHT,WORKER_BUST,WORKER_WAIST,WORKER_HIPLINE,WORKER_HOME_PIC,
WORKER_PIC,WORKER_RESUME,STORE_ID,ADMINISTRATORS_ID,IS_AUDITING,IS_SHOPPING,
UPLOAD_TIME,MATURE_TIME,CLICKS,IS_RECOMMEND,WORKER_PLACE_OF_ADDRESS,CREATE_TIME,
UPDATE_TIME,OPERATOR_ID,OPERATOR_TYPE,SERIAL_NUMBER,IS_DELETED
UPDATE_TIME,OPERATOR_ID,OPERATOR_TYPE,SERIAL_NUMBER,IS_DELETED,STORE_NAME
</sql>
<!-- 常见字段,一般用于列表查询,可能不包含备注之类的字段 -->
<sql id="CommonColumnlist">
WORKER_ID,WORKER_NAME,WORKER_NUMBER,WORKER_SEX,WORKER_AGE,WORKER_BIRTHDAY,WORKER_ANCESTRAL,
WORKER_HEIGHT,WORKER_WEIGHT,WORKER_BUST,WORKER_WAIST,WORKER_HIPLINE,WORKER_HOME_PIC,
WORKER_PIC,STORE_ID,ADMINISTRATORS_ID,IS_AUDITING,IS_SHOPPING,
WORKER_PIC,WORKER_RESUME,STORE_ID,ADMINISTRATORS_ID,IS_AUDITING,IS_SHOPPING,
UPLOAD_TIME,MATURE_TIME,CLICKS,IS_RECOMMEND,WORKER_PLACE_OF_ADDRESS,CREATE_TIME,
UPDATE_TIME,OPERATOR_ID,OPERATOR_TYPE,SERIAL_NUMBER,IS_DELETED
UPDATE_TIME,OPERATOR_ID,OPERATOR_TYPE,SERIAL_NUMBER,IS_DELETED,STORE_NAME
</sql>
<insert id="add" parameterType="Worker" useGeneratedKeys="true" keyProperty="workerId">
......@@ -87,7 +88,8 @@ UPDATE_TIME,OPERATOR_ID,OPERATOR_TYPE,SERIAL_NUMBER,IS_DELETED
OPERATOR_ID,
OPERATOR_TYPE,
SERIAL_NUMBER,
IS_DELETED
IS_DELETED,
STORE_NAME
) values (
<if test="workerId!=null">
#{workerId,jdbcType = VARCHAR},
......@@ -120,7 +122,8 @@ UPDATE_TIME,OPERATOR_ID,OPERATOR_TYPE,SERIAL_NUMBER,IS_DELETED
#{operatorId,jdbcType = VARCHAR},
#{operatorType,jdbcType = TINYINT},
#{serialNumber,jdbcType = INTEGER},
#{isDeleted,jdbcType = TINYINT}
#{isDeleted,jdbcType = TINYINT},
#{storeName,jdbcType = VARCHAR}
)
</insert>
......@@ -214,6 +217,9 @@ UPDATE_TIME,OPERATOR_ID,OPERATOR_TYPE,SERIAL_NUMBER,IS_DELETED
<if test="isDeleted!=null ">
IS_DELETED=#{isDeleted,jdbcType = TINYINT},
</if>
<if test="storeName!=null and storeName!=''">
STORE_NAME=#{storeName,jdbcType = VARCHAR},
</if>
</set>
<where>
AND WORKER_ID=#{workerId}
......@@ -381,6 +387,9 @@ UPDATE_TIME,OPERATOR_ID,OPERATOR_TYPE,SERIAL_NUMBER,IS_DELETED
<if test="q.isDeleted!=null ">
AND IS_DELETED=#{q.isDeleted}
</if>
<if test="q.storeName!=null and q.storeName!=''">
AND STORE_NAME=#{q.storeName}
</if>
</if>
</sql>
......@@ -503,6 +512,9 @@ UPDATE_TIME,OPERATOR_ID,OPERATOR_TYPE,SERIAL_NUMBER,IS_DELETED
<if test="q.isDeleted!=null ">
AND IS_DELETED=#{q.isDeleted}
</if>
<if test="q.storeName!=null and q.storeName!=''">
AND STORE_NAME=#{q.storeName}
</if>
</if>
</sql>
</mapper>
\ No newline at end of file
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