Commit 787ee02e authored by 廖旭伟's avatar 廖旭伟

客户试用申请修改,客户状态bug修改

parent 9100c632
......@@ -1000,8 +1000,9 @@ size|Integer|否|每页条数,值为-1,查询所有记录
**请求样例:**
```
{
"page":1,
"size":10
"query": "a",
"page": 1,
"size": 6
}
```
......@@ -1151,16 +1152,24 @@ dict|object|字典对象
参数名称|类型|必填|描述
:---|:---|:---|:-------
customerId|Long|是|客户ID
memberLevel|Integer|是|申请会员等级,1:试用客户,2:VIP,3:设计师
isAccept|Integer|是|受理状态,0:未受理,1:同意,2:不同意。默认:0
memberLevel|Integer|是|会员等级,,0:未开启,1:试用客户,2:VIP,3:设计师,默认0
custName|String|是|客户真实名称
organization|String|是|单位名称
contactTelphone|String|是|联系电话
sex|Integer|是|性别
mailbox|String|是|邮箱
job|String|是|职位
**请求样例:**
```
{
"customerId":6633,
"memberLevel":5866,
"isAccept":6478,
"contactTelphone": "13888888888",
"custName": "测试",
"job": "总监",
"mailbox": "qqq@123.com",
"organization": "测试公司",
"memberLevel":1,
"sex":1
}
```
......@@ -1171,15 +1180,6 @@ isAccept|Integer|是|受理状态,0:未受理,1:同意,2:不同意。默
code|Integer|结果码(-1.失败,1.成功)
msg|String|消息
data|object|数据对象
 id|Long|保存后主键id
 entity|object|保存更新实体
  id|Long|主键ID,主键,自增长
  customerId|Long|客户ID
  memberLevel|Integer|申请会员等级,1:试用客户,2:VIP,3:设计师
  isAccept|Integer|受理状态,0:未受理,1:同意,2:不同意。默认:0
  createUserId|Long|受理用户
  createTime|Date|提交时间
  updateTime|Date|受理时间
**响应消息样例:**
```
......@@ -4634,13 +4634,15 @@ data|object|数据对象
id|Long|是|作品id
masterplateName|String|是|模板名称
frontCover|String|是|封面图片地址(相对地址)
plateType|int|是|板式
**请求样例:**
```
{
"id":6797,
"masterplateName":"c42lp8",
"frontCover":"g3odxd"
"frontCover":"g3odxd",
"plateType":1
}
```
......
......@@ -16,5 +16,4 @@ import java.util.List;
*/
public interface CustomerTrialDao extends ICRUDDao<CustomerTrialEntity,Long>{
Result<CustomerTrialEntityExt> getListExt(CustomerTrialEntity params, PageInfo pageInfo);
}
......@@ -23,40 +23,4 @@ import java.util.List;
@Repository("customerTrialDao")
public class CustomerTrialDaoImpl extends BaseCRUDDaoMybatis<CustomerTrialEntity,Long> implements CustomerTrialDao {
@Override
public Result<CustomerTrialEntityExt> getListExt(CustomerTrialEntity param, PageInfo pageInfo) {
ParamDto paramDto = this.getQueryParam(param);
Result result = new Result();
List list = null;
if (pageInfo.isCountPage()) {
int count = this.getCount(paramDto, "getListExtCount");
if (count == 0) {
list = new ArrayList();
} else if (pageInfo.getPrePageResult() == -1) {
list = this.getSqlSession().selectList(this.getSqlId("getListExt"), paramDto);
} else {
RowBounds rowBounds = new RowBounds(pageInfo.getBeginIndex(), pageInfo.getPrePageResult());
list = this.getSqlSession().selectList(this.getSqlId("getListExt"), this.cpyQueryParamDto(paramDto), rowBounds);
}
pageInfo.setTotalResult(count);
result.setPageInfo(pageInfo);
result.setList((List)list);
} else {
if (pageInfo.getPrePageResult() == -1) {
list = this.getSqlSession().selectList(this.getSqlId("getListExt"), paramDto);
} else {
RowBounds rowBounds = new RowBounds(pageInfo.getBeginIndex(), pageInfo.getPrePageResult());
list = this.getSqlSession().selectList(this.getSqlId("getListExt"), this.cpyQueryParamDto(paramDto), rowBounds);
}
pageInfo.setTotalResult(-1);
result.setPageInfo(pageInfo);
result.setList(list);
}
return result;
}
}
......@@ -7,80 +7,170 @@ import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.customer.model.vo.CustomerTrialVo;
/**
* 客户试用申请实体对象
*
* @author zxfei
* @date 2022-06-08
*/
* 客户试用申请实体对象
*
* @author zxfei
* @date 2022-07-26
*/
public class CustomerTrialEntity extends CustomerTrialVo {
private static final long serialVersionUID = 1L;
/**
* 客户ID
*/
private Long customerId;
/**
* 申请会员等级,1:试用客户,2:VIP,3:设计师
*/
* 申请会员等级,1:试用客户,2:VIP,3:设计师
*/
private Integer memberLevel;
/**
* 受理状态,0:未受理,1:同意,2:不同意。默认:0
*/
* 受理状态,0:未受理,1:同意,2:不同意。默认:0
*/
private Integer isAccept;
/**
* 客户真实名称
*/
private String custName;
/**
* 单位名称
*/
private String organization;
/**
* 联系电话
*/
private String contactTelphone;
/**
* 性别
*/
private Integer sex;
/**
* 邮箱
*/
private String mailbox;
/**
* 职位
*/
private String job;
public CustomerTrialEntity(){}
/**
* 获取 客户ID
* @return Long
*/
public Long getCustomerId(){
return customerId;
}
/**
* 设置 客户ID
* @param customerId
*/
public void setCustomerId(Long customerId){
this.customerId = customerId;
}
/**
* 获取 申请会员等级,1:试用客户,2:VIP,3:设计师
* @return Integer
*/
* 获取 申请会员等级,1:试用客户,2:VIP,3:设计师
* @return Integer
*/
public Integer getMemberLevel(){
return memberLevel;
}
/**
* 设置 申请会员等级,1:试用客户,2:VIP,3:设计师
* @param memberLevel
*/
* 设置 申请会员等级,1:试用客户,2:VIP,3:设计师
* @param memberLevel
*/
public void setMemberLevel(Integer memberLevel){
this.memberLevel = memberLevel;
}
/**
* 获取 受理状态,0:未受理,1:同意,2:不同意。默认:0
* @return Integer
*/
* 获取 受理状态,0:未受理,1:同意,2:不同意。默认:0
* @return Integer
*/
public Integer getIsAccept(){
return isAccept;
}
/**
* 设置 受理状态,0:未受理,1:同意,2:不同意。默认:0
* @param isAccept
*/
* 设置 受理状态,0:未受理,1:同意,2:不同意。默认:0
* @param isAccept
*/
public void setIsAccept(Integer isAccept){
this.isAccept = isAccept;
}
/**
* 获取 客户真实名称
* @return String
*/
public String getCustName(){
return custName;
}
/**
* 设置 客户真实名称
* @param custName
*/
public void setCustName(String custName){
this.custName = custName;
}
/**
* 获取 单位名称
* @return String
*/
public String getOrganization(){
return organization;
}
/**
* 设置 单位名称
* @param organization
*/
public void setOrganization(String organization){
this.organization = organization;
}
/**
* 获取 联系电话
* @return String
*/
public String getContactTelphone(){
return contactTelphone;
}
/**
* 设置 联系电话
* @param contactTelphone
*/
public void setContactTelphone(String contactTelphone){
this.contactTelphone = contactTelphone;
}
/**
* 获取 性别
* @return Integer
*/
public Integer getSex(){
return sex;
}
/**
* 设置 性别
* @param sex
*/
public void setSex(Integer sex){
this.sex = sex;
}
/**
* 获取 邮箱
* @return String
*/
public String getMailbox(){
return mailbox;
}
/**
* 设置 邮箱
* @param mailbox
*/
public void setMailbox(String mailbox){
this.mailbox = mailbox;
}
/**
* 获取 职位
* @return String
*/
public String getJob(){
return job;
}
/**
* 设置 职位
* @param job
*/
public void setJob(String job){
this.job = job;
}
@Override
public int hashCode() {
return this.getId().hashCode();
return this.getId().hashCode();
}
@Override
public boolean equals(Object obj) {
......@@ -88,7 +178,7 @@ public class CustomerTrialEntity extends CustomerTrialVo {
if (obj instanceof CustomerTrialEntity) {
CustomerTrialEntity tmp = (CustomerTrialEntity) obj;
if (this.getId() == tmp.getId()) {
return true;
return true;
}
}
return false;
......@@ -96,18 +186,33 @@ public class CustomerTrialEntity extends CustomerTrialVo {
public String toString(){
StringBuilder sb = new StringBuilder("");
sb.append(",customerId:").append(getCustomerId());
sb.append(",memberLevel:").append(getMemberLevel());
sb.append(",isAccept:").append(getIsAccept());
sb.append(",custName:").append(getCustName());
sb.append(",organization:").append(getOrganization());
sb.append(",contactTelphone:").append(getContactTelphone());
sb.append(",sex:").append(getSex());
sb.append(",mailbox:").append(getMailbox());
sb.append(",job:").append(getJob());
return sb.toString();
}
public void initAttrValue(){
this.customerId = null;
this.memberLevel = null;
this.isAccept = null;
this.custName = "";
this.organization = "";
this.contactTelphone = "";
this.sex = null;
this.memberLevel = null;
this.mailbox = "";
this.isAccept = null;
this.job = "";
}
}
\ No newline at end of file
......@@ -17,8 +17,6 @@ import com.mortals.xhx.module.customer.model.CustomerTrialEntityExt;
*/
public interface CustomerTrialService extends ICRUDService<CustomerTrialEntity,Long>{
Result<CustomerTrialEntityExt> findExt(CustomerTrialEntity params, PageInfo pageInfo, Context context) throws AppException;
/**
* 受理客户试用申请
* @param entity
......
......@@ -8,6 +8,8 @@ import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.util.DateUtils;
import com.mortals.framework.util.SecurityUtil;
import com.mortals.framework.util.StringUtils;
import com.mortals.xhx.common.code.CustomerSatusEnum;
import com.mortals.xhx.common.code.UserStatus;
import com.mortals.xhx.module.customer.dao.CustomerDao;
import com.mortals.xhx.module.customer.model.CustomerEntity;
import com.mortals.xhx.module.customer.model.CustomerEntityExt;
......@@ -86,6 +88,9 @@ public class CustomerServiceImpl extends AbstractCRUDServiceImpl<CustomerDao, Cu
if (user == null || !user.getLoginName().equals(loginName)) {
throw new AppException("用户名不存在!");
}
if(user.getStatus()!= CustomerSatusEnum.NORMAL.getValue()){
throw new AppException("该账号已被禁用!");
}
try {
if (!user.getPassword().equals(SecurityUtil.md5DoubleEncoding(password))) {
throw new AppException("登录密码错误!");
......
......@@ -5,20 +5,20 @@ import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result;
import com.mortals.framework.util.SecurityUtil;
import com.mortals.framework.util.StringUtils;
import com.mortals.xhx.common.code.CustomerSatusEnum;
import com.mortals.xhx.common.code.CustomerSrcEnum;
import com.mortals.xhx.common.code.TrialAcceptEnum;
import com.mortals.xhx.module.customer.dao.CustomerDao;
import com.mortals.xhx.module.customer.model.CustomerEntity;
import com.mortals.xhx.module.customer.model.CustomerTrialEntityExt;
import com.mortals.xhx.module.customer.model.CustomerTrialQuery;
import com.mortals.xhx.module.customer.model.*;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.xhx.module.customer.dao.CustomerTrialDao;
import com.mortals.xhx.module.customer.model.CustomerTrialEntity;
import com.mortals.xhx.module.customer.service.CustomerTrialService;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
......@@ -35,23 +35,28 @@ public class CustomerTrialServiceImpl extends AbstractCRUDServiceImpl<CustomerTr
private CustomerDao customerDao;
@Override
public Result<CustomerTrialEntityExt> findExt(CustomerTrialEntity params, PageInfo pageInfo, Context context) throws AppException {
protected CustomerTrialEntity findBefore(CustomerTrialEntity entity, PageInfo pageInfo, Context context) throws AppException {
CustomerTrialQuery query = new CustomerTrialQuery();
BeanUtils.copyProperties(params,query);
if(StringUtils.isNotEmpty(params.getQuery())){
BeanUtils.copyProperties(entity,query);
if(StringUtils.isNotEmpty(entity.getQuery())){
StringBuffer condition = new StringBuffer("%");
condition.append(params.getQuery()).append("%");
condition.append(entity.getQuery()).append("%");
CustomerTrialQuery condition1 = new CustomerTrialQuery();
CustomerTrialQuery condition2 = new CustomerTrialQuery();
condition1.setCustName(condition.toString());
condition2.setContactTelphone(condition.toString());
condition1.setContactTelphone(condition.toString());
condition2.setCustName(condition.toString());
List<CustomerTrialQuery> orConditionList = new ArrayList<>();
orConditionList.add(condition1);
orConditionList.add(condition2);
query.setOrConditionList(orConditionList);
}
return getDao().getListExt(query,pageInfo);
return query;
}
@Override
protected void saveBefore(CustomerTrialEntity entity, Context context) throws AppException {
entity.setIsAccept(TrialAcceptEnum.NOT_ACCEPTED.getValue());
super.saveBefore(entity, context);
}
@Override
......@@ -73,16 +78,29 @@ public class CustomerTrialServiceImpl extends AbstractCRUDServiceImpl<CustomerTr
if(StringUtils.isEmpty(entity.getPassword())){
throw new AppException("登录密码不能为空");
}
if(StringUtils.isEmpty(entity.getEnterpriseConsultant())){
throw new AppException("企业顾问不能为空");
}
CustomerEntity customerEntity = new CustomerEntity();
customerEntity.setId(customerTrialEntity.getCustomerId());
customerEntity.setJob(entity.getJob());
customerEntity.setCustName(entity.getCustName());
customerEntity.setMemberLevel(entity.getMemberLevel());
customerEntity.setOrganization(entity.getOrganization());
customerEntity.setContactTelphone(entity.getContactTelphone());
customerEntity.setSex(entity.getSex());
customerEntity.setMailbox(entity.getMailbox());
customerEntity.setCustomerSrc(1l);
customerEntity.setStatus(CustomerSatusEnum.NORMAL.getValue());
customerEntity.setEnterpriseConsultant(entity.getEnterpriseConsultant());
customerEntity.setCreateUserId(this.getContextUserId(context));
customerEntity.setCreateTime(new Date());
customerEntity.setLoginName(entity.getLoginName());
try {
customerEntity.setPassword(SecurityUtil.md5DoubleEncoding(entity.getPassword()));
} catch (Exception e) {
throw new AppException("密码转换异常!", e);
}
customerEntity.setMemberLevel(customerTrialEntity.getMemberLevel());
customerDao.update(customerEntity);
customerDao.insert(customerEntity);
}
CustomerTrialEntity update = new CustomerTrialEntity();
update.setId(customerTrialEntity.getId());
......
......@@ -56,35 +56,35 @@ public class CustomerTrialController extends BaseCRUDJsonBodyMappingController<C
super.init(model, context);
}
@Override
public Rest<Object> list(@RequestBody(required = false) CustomerTrialEntity query) {
Map<String, Object> model = new HashMap();
Rest<Object> ret = new Rest();
Context context = this.getContext();
String busiDesc = "查询" + this.getModuleDesc();
int code;
try {
PageInfo pageInfo = this.buildPageInfo(query);
this.doListBefore(query, model, context);
Result result = this.getService().findExt(query, pageInfo, context);
model.put("data", result.getList());
model.put("pageInfo", result.getPageInfo());
this.parsePageInfo(model, result.getPageInfo());
code = this.doListAfter(query, model, context);
this.recordSysLog(this.request, busiDesc + " 【成功】");
} catch (Exception var9) {
code = -1;
this.doException(this.request, busiDesc, model, var9);
}
this.init(model, context);
ret.setCode(code);
ret.setData(model);
ret.setDict(model.get("dict") == null ? null : (Map)model.remove("dict"));
ret.setMsg(model.get("message_info") == null ? "" : model.remove("message_info").toString());
return ret;
}
// @Override
// public Rest<Object> list(@RequestBody(required = false) CustomerTrialEntity query) {
// Map<String, Object> model = new HashMap();
// Rest<Object> ret = new Rest();
// Context context = this.getContext();
// String busiDesc = "查询" + this.getModuleDesc();
//
// int code;
// try {
// PageInfo pageInfo = this.buildPageInfo(query);
// this.doListBefore(query, model, context);
// Result result = this.getService().findExt(query, pageInfo, context);
// model.put("data", result.getList());
// model.put("pageInfo", result.getPageInfo());
// this.parsePageInfo(model, result.getPageInfo());
// code = this.doListAfter(query, model, context);
// this.recordSysLog(this.request, busiDesc + " 【成功】");
// } catch (Exception var9) {
// code = -1;
// this.doException(this.request, busiDesc, model, var9);
// }
//
// this.init(model, context);
// ret.setCode(code);
// ret.setData(model);
// ret.setDict(model.get("dict") == null ? null : (Map)model.remove("dict"));
// ret.setMsg(model.get("message_info") == null ? "" : model.remove("message_info").toString());
// return ret;
// }
@PostMapping({"accept"})
public String accept(@RequestBody CustomerTrialEntity entity) {
......
......@@ -10,7 +10,7 @@ import com.mortals.xhx.module.design.model.vo.DesignMasterplateVo;
* 模版管理实体对象
*
* @author zxfei
* @date 2022-07-08
* @date 2022-07-26
*/
public class DesignMasterplateEntity extends DesignMasterplateVo {
......@@ -68,6 +68,10 @@ public class DesignMasterplateEntity extends DesignMasterplateVo {
* 设计草稿
*/
private String draft;
/**
* 版式。1:横版2竖版默认:1
*/
private Integer plateType;
......@@ -254,6 +258,20 @@ public class DesignMasterplateEntity extends DesignMasterplateVo {
public void setDraft(String draft){
this.draft = draft;
}
/**
* 获取 版式。1:横版2竖版默认:1
* @return Integer
*/
public Integer getPlateType(){
return plateType;
}
/**
* 设置 版式。1:横版2竖版默认:1
* @param plateType
*/
public void setPlateType(Integer plateType){
this.plateType = plateType;
}
......@@ -289,6 +307,7 @@ public class DesignMasterplateEntity extends DesignMasterplateVo {
sb.append(",masterplateUseNum:").append(getMasterplateUseNum());
sb.append(",previewUrl:").append(getPreviewUrl());
sb.append(",draft:").append(getDraft());
sb.append(",plateType:").append(getPlateType());
return sb.toString();
}
......@@ -319,5 +338,7 @@ public class DesignMasterplateEntity extends DesignMasterplateVo {
this.previewUrl = "";
this.draft = "";
this.plateType = null;
}
}
\ No newline at end of file
......@@ -6,7 +6,7 @@ import com.mortals.xhx.module.design.model.DesignMasterplateEntity;
* 模版管理查询对象
*
* @author zxfei
* @date 2022-07-08
* @date 2022-07-26
*/
public class DesignMasterplateQuery extends DesignMasterplateEntity {
/** 开始 主键ID,主键,自增长 */
......@@ -93,6 +93,18 @@ public class DesignMasterplateQuery extends DesignMasterplateEntity {
/** 设计草稿 */
private List<String> draftList;
/** 开始 版式。1:横版2竖版默认:1 */
private Integer plateTypeStart;
/** 结束 版式。1:横版2竖版默认:1 */
private Integer plateTypeEnd;
/** 增加 版式。1:横版2竖版默认:1 */
private Integer plateTypeIncrement;
/** 版式。1:横版2竖版默认:1列表 */
private List <Integer> plateTypeList;
/** OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) */
private List<DesignMasterplateQuery> orConditionList;
......@@ -539,6 +551,70 @@ public class DesignMasterplateQuery extends DesignMasterplateEntity {
public void setDraftList(List<String> draftList){
this.draftList = draftList;
}
/**
* 获取 开始 版式。1:横版2竖版默认:1
* @return plateTypeStart
*/
public Integer getPlateTypeStart(){
return this.plateTypeStart;
}
/**
* 设置 开始 版式。1:横版2竖版默认:1
* @param plateTypeStart
*/
public void setPlateTypeStart(Integer plateTypeStart){
this.plateTypeStart = plateTypeStart;
}
/**
* 获取 结束 版式。1:横版2竖版默认:1
* @return $plateTypeEnd
*/
public Integer getPlateTypeEnd(){
return this.plateTypeEnd;
}
/**
* 设置 结束 版式。1:横版2竖版默认:1
* @param plateTypeEnd
*/
public void setPlateTypeEnd(Integer plateTypeEnd){
this.plateTypeEnd = plateTypeEnd;
}
/**
* 获取 增加 版式。1:横版2竖版默认:1
* @return plateTypeIncrement
*/
public Integer getPlateTypeIncrement(){
return this.plateTypeIncrement;
}
/**
* 设置 增加 版式。1:横版2竖版默认:1
* @param plateTypeIncrement
*/
public void setPlateTypeIncrement(Integer plateTypeIncrement){
this.plateTypeIncrement = plateTypeIncrement;
}
/**
* 获取 版式。1:横版2竖版默认:1
* @return plateTypeList
*/
public List<Integer> getPlateTypeList(){
return this.plateTypeList;
}
/**
* 设置 版式。1:横版2竖版默认:1
* @param plateTypeList
*/
public void setPlateTypeList(List<Integer> plateTypeList){
this.plateTypeList = plateTypeList;
}
/**
* 设置 主键ID,主键,自增长
* @param id
......@@ -910,6 +986,51 @@ public class DesignMasterplateQuery extends DesignMasterplateEntity {
return this;
}
/**
* 设置 版式。1:横版2竖版默认:1
* @param plateType
*/
public DesignMasterplateQuery plateType(Integer plateType){
setPlateType(plateType);
return this;
}
/**
* 设置 开始 版式。1:横版2竖版默认:1
* @param plateTypeStart
*/
public DesignMasterplateQuery plateTypeStart(Integer plateTypeStart){
this.plateTypeStart = plateTypeStart;
return this;
}
/**
* 设置 结束 版式。1:横版2竖版默认:1
* @param plateTypeEnd
*/
public DesignMasterplateQuery plateTypeEnd(Integer plateTypeEnd){
this.plateTypeEnd = plateTypeEnd;
return this;
}
/**
* 设置 增加 版式。1:横版2竖版默认:1
* @param plateTypeIncrement
*/
public DesignMasterplateQuery plateTypeIncrement(Integer plateTypeIncrement){
this.plateTypeIncrement = plateTypeIncrement;
return this;
}
/**
* 设置 版式。1:横版2竖版默认:1
* @param plateTypeList
*/
public DesignMasterplateQuery plateTypeList(List<Integer> plateTypeList){
this.plateTypeList = plateTypeList;
return this;
}
/**
* 获取 OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4)
* @return orConditionList
......
......@@ -34,8 +34,8 @@ mybatis:
application:
auth:
unloginUrl: /refresh,/error,/login/login,/login/index,/login/logout,/customer/login/login,customer/login/logout,/securitycode/createCode,/file/common/*,/file/preview/*,/test*,/api/asset/*,/api/*,/zwfw/*,/ws/*,/swagger-ui*,/topic/*,/uploads/*
uncheckUrl: /refresh,/error,/login/login,/login/index,/login/logout,/customer/login/login,customer/login/logout,/securitycode/createCode,/file/common/*,/file/preview/*,/test*,/api/asset/*,/api/*,/zwfw/*,/ws/*,/swagger-ui*,/topic/*,/uploads/*
unloginUrl: /refresh,/error,/login/login,/login/index,/login/logout,/customer/login/login,/customer/login/logout,/securitycode/createCode,/customer/trial/save,/file/common/*,/file/preview/*,/test*,/api/asset/*,/api/*,/zwfw/*,/ws/*,/swagger-ui*,/topic/*,/uploads/*
uncheckUrl: /refresh,/error,/login/login,/login/index,/login/logout,/customer/login/login,/customer/login/logout,/securitycode/createCode,/customer/trial/save,/file/common/*,/file/preview/*,/test*,/api/asset/*,/api/*,/zwfw/*,/ws/*,/swagger-ui*,/topic/*,/uploads/*
workflow:
tenantId: ${spring.application.name}
token:
......
......@@ -20,6 +20,7 @@
<result property="masterplateUseNum" column="masterplateUseNum" />
<result property="previewUrl" column="previewUrl" />
<result property="draft" column="draft" />
<result property="plateType" column="plateType" />
</resultMap>
......@@ -72,23 +73,26 @@
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('draft') or colPickMode == 1 and data.containsKey('draft')))">
a.draft,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('plateType') or colPickMode == 1 and data.containsKey('plateType')))">
a.plateType,
</if>
</trim>
</sql>
<!-- 新增 区分主键自增加还是业务插入 -->
<insert id="insert" parameterType="DesignMasterplateEntity" useGeneratedKeys="true" keyProperty="id">
insert into mortals_xhx_design_masterplate
(masterplateName,masterplateCode,customerId,customerName,createTime,masterplateDesc,masterplatePath,pictureIds,pictureSrcIds,pictureBackgroundIds,fontIds,masterplateUseNum,previewUrl,draft)
(masterplateName,masterplateCode,customerId,customerName,createTime,masterplateDesc,masterplatePath,pictureIds,pictureSrcIds,pictureBackgroundIds,fontIds,masterplateUseNum,previewUrl,draft,plateType)
VALUES
(#{masterplateName},#{masterplateCode},#{customerId},#{customerName},#{createTime},#{masterplateDesc},#{masterplatePath},#{pictureIds},#{pictureSrcIds},#{pictureBackgroundIds},#{fontIds},#{masterplateUseNum},#{previewUrl},#{draft})
(#{masterplateName},#{masterplateCode},#{customerId},#{customerName},#{createTime},#{masterplateDesc},#{masterplatePath},#{pictureIds},#{pictureSrcIds},#{pictureBackgroundIds},#{fontIds},#{masterplateUseNum},#{previewUrl},#{draft},#{plateType})
</insert>
<!-- 批量新增 -->
<insert id="insertBatch" parameterType="paramDto">
insert into mortals_xhx_design_masterplate
(masterplateName,masterplateCode,customerId,customerName,createTime,masterplateDesc,masterplatePath,pictureIds,pictureSrcIds,pictureBackgroundIds,fontIds,masterplateUseNum,previewUrl,draft)
(masterplateName,masterplateCode,customerId,customerName,createTime,masterplateDesc,masterplatePath,pictureIds,pictureSrcIds,pictureBackgroundIds,fontIds,masterplateUseNum,previewUrl,draft,plateType)
VALUES
<foreach collection="data.dataList" item="item" index="index" separator="," >
(#{item.masterplateName},#{item.masterplateCode},#{item.customerId},#{item.customerName},#{item.createTime},#{item.masterplateDesc},#{item.masterplatePath},#{item.pictureIds},#{item.pictureSrcIds},#{item.pictureBackgroundIds},#{item.fontIds},#{item.masterplateUseNum},#{item.previewUrl},#{item.draft})
(#{item.masterplateName},#{item.masterplateCode},#{item.customerId},#{item.customerName},#{item.createTime},#{item.masterplateDesc},#{item.masterplatePath},#{item.pictureIds},#{item.pictureSrcIds},#{item.pictureBackgroundIds},#{item.fontIds},#{item.masterplateUseNum},#{item.previewUrl},#{item.draft},#{item.plateType})
</foreach>
</insert>
......@@ -149,6 +153,12 @@
<if test="(colPickMode==0 and data.containsKey('draft')) or (colPickMode==1 and !data.containsKey('draft'))">
a.draft=#{data.draft},
</if>
<if test="(colPickMode==0 and data.containsKey('plateType')) or (colPickMode==1 and !data.containsKey('plateType'))">
a.plateType=#{data.plateType},
</if>
<if test="(colPickMode==0 and data.containsKey('plateTypeIncrement')) or (colPickMode==1 and !data.containsKey('plateTypeIncrement'))">
a.plateType=ifnull(a.plateType,0) + #{data.plateTypeIncrement},
</if>
</trim>
<trim suffixOverrides="where" suffix="">
where
......@@ -274,6 +284,18 @@
</if>
</foreach>
</trim>
<trim prefix="plateType=(case" suffix="ELSE plateType end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('plateType')) or (colPickMode==1 and !item.containsKey('plateType'))">
when a.id=#{item.id} then #{item.plateType}
</when>
<when test="(colPickMode==0 and item.containsKey('plateTypeIncrement')) or (colPickMode==1 and !item.containsKey('plateTypeIncrement'))">
when a.id=#{item.id} then ifnull(a.plateType,0) + #{item.plateTypeIncrement}
</when>
</choose>
</foreach>
</trim>
</trim>
where id in
<foreach collection="data.dataList" item="item" index="index" open="(" separator="," close=")">
......@@ -624,6 +646,27 @@
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('plateType')">
<if test="conditionParamRef.plateType != null ">
${_conditionType_} a.plateType = #{${_conditionParam_}.plateType}
</if>
<if test="conditionParamRef.plateType == null">
${_conditionType_} a.plateType is null
</if>
</if>
<if test="conditionParamRef.containsKey('plateTypeList')">
${_conditionType_} a.plateType in
<foreach collection="conditionParamRef.plateTypeList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('plateTypeStart') and conditionParamRef.plateTypeStart != null">
${_conditionType_} a.plateType <![CDATA[ >= ]]> #{${_conditionParam_}.plateTypeStart}
</if>
<if test="conditionParamRef.containsKey('plateTypeEnd') and conditionParamRef.plateTypeEnd != null">
${_conditionType_} a.plateType <![CDATA[ <= ]]> #{${_conditionParam_}.plateTypeEnd}
</if>
</sql>
<sql id="_orderCols_">
<if test="orderColList != null and !orderColList.isEmpty()">
......@@ -712,6 +755,11 @@
<if test='orderCol.draft != null and "DESC".equalsIgnoreCase(orderCol.draft)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('plateType')">
a.plateType
<if test='orderCol.plateType != null and "DESC".equalsIgnoreCase(orderCol.plateType)'>DESC</if>
,
</if>
</trim>
</if>
</sql>
......
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