Commit f7380696 authored by wangyihao's avatar wangyihao

修改

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