From 854d9d55a86b7076abc4f526e90001bd806d324c Mon Sep 17 00:00:00 2001 From: Helius <wangdoubleone@gmail.com> Date: Mon, 11 Jan 2021 10:19:54 +0800 Subject: [PATCH] Merge branch 'api' into order_reform --- zq-erp/src/main/java/com/matrix/system/hive/bean/SysFollowup.java | 251 ++++++++ zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/demo/MsgDemo3.java | 2 zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/weixinUtil/WeixinServiceUtil.java | 8 zq-erp/src/main/resources/mybatis/mapper/hive/SysVipInfoDao.xml | 2 zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/common/HttpsRequest2.java | 6 zq-erp/src/main/java/com/matrix/system/hive/dao/SysFollowupDao.java | 44 + zq-erp/src/main/java/com/matrix/system/hive/dao/SysVipAlbumDao.java | 42 + zq-erp/src/main/resources/mybatis/mapper/hive/SysFollowupDao.xml | 395 +++++++++++++ zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/demo/MsgDemo2.java | 4 zq-erp/src/main/java/com/matrix/system/hive/dao/SysFollowupCommentDao.java | 42 + zq-erp/src/main/resources/config/application.properties | 2 zq-erp/src/main/java/com/matrix/system/hive/bean/SysVipAlbum.java | 96 +++ zq-erp/src/main/java/com/matrix/system/app/dto/FollowupCommonetListDto.java | 135 ++++ zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/protocol/refundProtocol/RefundReqData.java | 4 zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/demo/MsgDemo.java | 3 zq-erp/src/main/resources/mybatis/mapper/hive/SysFollowupCommentDao.xml | 228 +++++++ zq-erp/src/main/resources/mybatis/mapper/hive/SysVipAlbumDao.xml | 241 ++++++++ zq-erp/src/main/java/com/matrix/system/common/constance/AppConstance.java | 2 zq-erp/src/main/java/com/matrix/system/hive/bean/SysFollowupComment.java | 90 +++ zq-erp/src/main/java/com/matrix/system/app/action/ApiFollowupAction.java | 150 +++++ 20 files changed, 1,735 insertions(+), 12 deletions(-) diff --git a/zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/common/HttpsRequest2.java b/zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/common/HttpsRequest2.java index 6f05de1..6e4594f 100644 --- a/zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/common/HttpsRequest2.java +++ b/zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/common/HttpsRequest2.java @@ -1,5 +1,9 @@ package com.matrix.component.wechat.externalInterface.common; +import com.matrix.core.tools.WebUtil; +import com.matrix.system.common.bean.BusParameterSettings; +import com.matrix.system.common.constance.AppConstance; +import com.matrix.system.common.dao.BusParameterSettingsDao; import com.thoughtworks.xstream.XStream; import com.thoughtworks.xstream.io.xml.DomDriver; import com.thoughtworks.xstream.io.xml.XmlFriendlyNameCoder; @@ -62,7 +66,7 @@ private String mchId; public HttpsRequest2() throws UnrecoverableKeyException, KeyManagementException, NoSuchAlgorithmException, KeyStoreException, IOException { - init(); + } private void init() throws IOException, KeyStoreException, UnrecoverableKeyException, NoSuchAlgorithmException, KeyManagementException { diff --git a/zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/protocol/refundProtocol/RefundReqData.java b/zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/protocol/refundProtocol/RefundReqData.java index adff5d8..9cac6cf 100644 --- a/zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/protocol/refundProtocol/RefundReqData.java +++ b/zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/protocol/refundProtocol/RefundReqData.java @@ -43,10 +43,10 @@ public RefundReqData(String mchID,String appID,String paySecret ,String outTradeNo,String outRefundNo,int totalFee,int refundFee,String opUserID){ //微信分配的公众号ID(开通公众号之后可以获取到) - setAppid(mchID); + setAppid(appID); //微信支付分配的商户号ID(开通公众号的微信支付功能之后可以获取到) - setMch_id(appID); + setMch_id(mchID); //transaction_id是微信系统为每一笔支付交易分配的订单号,通过这个订单号可以标识这笔交易,它由支付订单API支付成功时返回的数据里面获取到。 //setTransaction_id(transactionID); diff --git a/zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/weixinUtil/WeixinServiceUtil.java b/zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/weixinUtil/WeixinServiceUtil.java index 7a00022..30c7d4d 100644 --- a/zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/weixinUtil/WeixinServiceUtil.java +++ b/zq-erp/src/main/java/com/matrix/component/wechat/externalInterface/weixinUtil/WeixinServiceUtil.java @@ -76,7 +76,7 @@ Long companyId=HostInterceptor.getCompanyId(); - BusParameterSettings mchID = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.WECHARPAY_APPID, companyId); + BusParameterSettings mchID = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.WECHARPAY_MCHID, companyId); BusParameterSettings paySecret = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.WECHARPAY_SECRET, companyId); BusParameterSettings notifyUrl = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.WECHARPAY_NOTIFYURL, companyId); @@ -149,7 +149,7 @@ JsApiPayBusiness jsApiPayBusiness = new JsApiPayBusiness(); // TODO 企业付款 Long companyId=HostInterceptor.getCompanyId(); - BusParameterSettings mchID = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.WECHARPAY_APPID, companyId); + BusParameterSettings mchID = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.WECHARPAY_MCHID, companyId); BusParameterSettings paySecret = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.WECHARPAY_SECRET, companyId); @@ -183,7 +183,7 @@ int refundFee, String opUserID){ LogUtil.info("#---outTradeNo:{}#---outRefundNo:{}#---totalFee:{}#---refundFee:{}", outTradeNo,outRefundNo,totalFee,refundFee); - BusParameterSettings mchID = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.WECHARPAY_APPID, HostInterceptor.getCompanyId()); + BusParameterSettings mchID = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.WECHARPAY_MCHID, HostInterceptor.getCompanyId()); if(opUserID==null){ opUserID=mchID.getParamValue(); } @@ -193,7 +193,7 @@ JsApiPayBusiness jsApiPayBusiness = new JsApiPayBusiness(); Long companyId=HostInterceptor.getCompanyId(); BusParameterSettings paySecret = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.WECHARPAY_SECRET, companyId); - BusParameterSettings appId = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.WECHARPAY_APPID, companyId); + BusParameterSettings appId = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.MINIPROGRAM_APPID, companyId); BusParameterSettings certLocalPath = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.WECHARPAY_CERTLOCAL_PATH, companyId); RefundReqData refundReqData=new RefundReqData(mchID.getParamValue(),appId.getParamValue(),paySecret.getParamValue(), outTradeNo, outRefundNo, totalFee, refundFee,opUserID); diff --git a/zq-erp/src/main/java/com/matrix/system/app/action/ApiFollowupAction.java b/zq-erp/src/main/java/com/matrix/system/app/action/ApiFollowupAction.java new file mode 100644 index 0000000..c059963 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/action/ApiFollowupAction.java @@ -0,0 +1,150 @@ +package com.matrix.system.app.action; + +import com.matrix.core.constance.MatrixConstance; +import com.matrix.core.exception.GlobleException; +import com.matrix.core.pojo.AjaxResult; +import com.matrix.core.pojo.PaginationVO; +import com.matrix.core.tools.StringUtils; +import com.matrix.core.tools.WebUtil; +import com.matrix.system.app.dto.*; +import com.matrix.system.app.vo.OrderDetailVo; +import com.matrix.system.app.vo.ShoppingGoodsDetailVo; +import com.matrix.system.app.vo.ShoppingGoodsListVo; +import com.matrix.system.common.bean.SysUsers; +import com.matrix.system.common.tools.DataAuthUtil; +import com.matrix.system.hive.bean.*; +import com.matrix.system.hive.dao.SysFollowupCommentDao; +import com.matrix.system.hive.dao.SysFollowupDao; +import com.matrix.system.hive.dao.SysVipAlbumDao; +import com.matrix.system.hive.dao.SysVipInfoDao; +import com.matrix.system.hive.plugin.util.CollectionUtils; +import com.matrix.system.hive.pojo.ShoppingCarItem; +import com.matrix.system.hive.pojo.ShoppingCarItemsVo; +import com.matrix.system.hive.service.ShoppingGoodsCategoryService; +import com.matrix.system.hive.service.ShoppingGoodsService; +import com.matrix.system.hive.service.SysOrderService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponse; +import io.swagger.annotations.ApiResponses; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * @author jyy + * @date 2020-12-21 + **/ +@Api(value = "ApiFollowupAction", tags = "跟进记录接口类") +@RestController +@RequestMapping(value = "/api/followup") +public class ApiFollowupAction { + + @Autowired + private SysFollowupDao followupDao; + + @Autowired + private SysVipAlbumDao vipAlbumDao; + + @Autowired + private SysVipInfoDao vipInfoDao; + + @Autowired + private SysFollowupCommentDao followupCommentDao; + + + @ApiOperation(value = "新增跟进记录", notes = "新增跟进记录") + @ApiResponses({ + @ApiResponse(code = 200, message = "ok", response = SysFollowup.class) + }) + @PostMapping(value = "/addFollowup") + public AjaxResult addFollowup(@RequestBody @Validated SysFollowup followup) { + SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + followup.setCreateBy(user.getSuName()); + followup.setUpdateBy(user.getSuName()); + followup.setStaffId(user.getSuId()); + followup.setCompanyId(user.getCompanyId()); + followup.setShopId(user.getShopId()); + followupDao.insert(followup); + //插入图片 + List<SysVipAlbum> albums=followup.getAlbums(); + for (SysVipAlbum vipAlbum:albums){ + if(StringUtils.isNotBlank(vipAlbum.getImg())){ + vipAlbum.setCreateBy(user.getSuName()); + vipAlbum.setUpdateBy(user.getSuName()); + vipAlbum.setSource(SysVipAlbum.SOURCE_FOLLOW); + vipAlbum.setVipId(followup.getVipId()); + vipAlbum.setSourceId(followup.getId()); + vipAlbumDao.insert(vipAlbum); + } + } + return AjaxResult.buildSuccessInstance("保存成功"); + } + + @ApiOperation(value = "跟进记录点赞或者取消点赞", notes = "跟进记录点赞或者取消点赞") + @ApiResponses({ + @ApiResponse(code = 200, message = "ok", response = AjaxResult.class) + }) + @GetMapping(value = "/zanFollowup/{id}") + public AjaxResult zanFollowup(@PathVariable("id")Long id) { + SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + SysFollowup followup = followupDao.selectById(id); + String zans=followup.getZans(); + if(StringUtils.isNotBlank(zans)){ + List<Long> zanIds = StringUtils.strToCollToLong(zans, ","); + List<Long> zaned = zanIds.stream().filter(zanid -> zanid.equals(user.getSuId())).collect(Collectors.toList()); + if(CollectionUtils.isNotEmpty(zaned)){ + //取消赞 + List<Long> newZaned = zanIds.stream().filter(zanid -> !zanid.equals(user.getSuId())).collect(Collectors.toList()); + zans=StringUtils.collToStr(newZaned,","); + + }else{ + //点赞 + zaned.add(user.getSuId()); + zans=StringUtils.collToStr(zaned,","); + } + }else{ + //直接点赞 + zans=user.getSuId()+""; + } + followupDao.updateZan(id,zans); + return AjaxResult.buildSuccessInstance("修改成功"); + } + + + @ApiOperation(value = "评论跟进", notes = "评论跟进") + @ApiResponses({ + @ApiResponse(code = 200, message = "ok", response = AjaxResult.class) + }) + @PostMapping(value = "/addFollowupComment") + public AjaxResult addFollowupComment(@RequestBody @Validated SysFollowupComment followupComment) { + SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + followupComment.setCreateBy(user.getSuName()); + followupComment.setUpdateBy(user.getSuName()); + followupComment.setStaffId(user.getSuId()); + followupCommentDao.insert(followupComment); + return AjaxResult.buildSuccessInstance("评论成功"); + } + + + @ApiOperation(value = "查询跟进记录", notes = "查询跟进记录") + @ApiResponses({ + @ApiResponse(code = 200, message = "ok", response = SysFollowup.class) + }) + @PostMapping(value = "/findFollowup") + public AjaxResult findFollowup(@RequestBody @Validated FollowupCommonetListDto followupCommonetListDto) { + SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + followupCommonetListDto.setShopId(user.getShopId()); + followupCommonetListDto.setCompanyId(user.getCompanyId()); + followupCommonetListDto.setSelfStaff(user.getSuId()); + //TODO 需要设置跨店数据权限 + List<SysFollowup> rows= followupDao.selectByAppDto(followupCommonetListDto); + return AjaxResult.buildSuccessInstance(rows,"查询成功"); + } + + + +} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/app/dto/FollowupCommonetListDto.java b/zq-erp/src/main/java/com/matrix/system/app/dto/FollowupCommonetListDto.java new file mode 100644 index 0000000..b61d760 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/app/dto/FollowupCommonetListDto.java @@ -0,0 +1,135 @@ +package com.matrix.system.app.dto; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.matrix.core.anotations.Extend; +import com.matrix.core.tools.DateUtil; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import javax.validation.constraints.NotNull; +import java.util.Date; +import java.util.List; + +/** + * @author jyy + * @date 2020-12-23 + **/ +@ApiModel(value = "FollowupCommonetListDto", description = "跟进记录查询参数") +public class FollowupCommonetListDto { + + @NotNull(message = "参数错误") + @ApiModelProperty(value = "查询条数", example = "10") + private Integer limit = 10; + + @NotNull(message = "查询起点") + @ApiModelProperty(value = "第0条开始", example = "0") + private Integer offset = 0; + + @ApiModelProperty(value = "门店ID 后台自动赋值", example = "0") + private Long shopId; + + @ApiModelProperty(value = "公司ID 后台自动赋值", example = "0") + private Long companyId; + + @ApiModelProperty(value = "当前员工ID 后台自动赋值", example = "0") + private Long selfStaff; + + @JsonFormat(pattern = DateUtil.DATE_FORMAT_DD, timezone = "GMT+8") + @ApiModelProperty(value = "查询参数开始时间", example = "2021-01-10") + private Date startTime; + + + @JsonFormat(pattern = DateUtil.DATE_FORMAT_DD, timezone = "GMT+8") + @ApiModelProperty(value = "查询参数结束时间", example = "2021-01-10") + private Date endTime; + + + @ApiModelProperty(value = "查询参数员工ID数组", example = "[1,2]") + private List<Long> staffIds; + + @ApiModelProperty(value = "查询参数客户ID数组", example = "[1,2]") + private List<Long> vipIds; + + @ApiModelProperty(value = "查询参数,查询跟进类型,1=全部,2=我发出的,3=我的团队", example = "1") + private Integer queryType=1; + + public Integer getQueryType() { + return queryType; + } + + public void setQueryType(Integer queryType) { + this.queryType = queryType; + } + + public Date getStartTime() { + return startTime; + } + + public void setStartTime(Date startTime) { + this.startTime = startTime; + } + + public Date getEndTime() { + return endTime; + } + + public void setEndTime(Date endTime) { + this.endTime = endTime; + } + + public Long getShopId() { + return shopId; + } + + public void setShopId(Long shopId) { + this.shopId = shopId; + } + + public Long getSelfStaff() { + return selfStaff; + } + + public void setSelfStaff(Long selfStaff) { + this.selfStaff = selfStaff; + } + + public List<Long> getStaffIds() { + return staffIds; + } + + public void setStaffIds(List<Long> staffIds) { + this.staffIds = staffIds; + } + + public List<Long> getVipIds() { + return vipIds; + } + + public void setVipIds(List<Long> vipIds) { + this.vipIds = vipIds; + } + + public Integer getLimit() { + return limit; + } + + public void setLimit(Integer limit) { + this.limit = limit; + } + + public Integer getOffset() { + return offset; + } + + public void setOffset(Integer offset) { + this.offset = offset; + } + + public Long getCompanyId() { + return companyId; + } + + public void setCompanyId(Long companyId) { + this.companyId = companyId; + } +} diff --git a/zq-erp/src/main/java/com/matrix/system/common/constance/AppConstance.java b/zq-erp/src/main/java/com/matrix/system/common/constance/AppConstance.java index 56216fc..705a50f 100644 --- a/zq-erp/src/main/java/com/matrix/system/common/constance/AppConstance.java +++ b/zq-erp/src/main/java/com/matrix/system/common/constance/AppConstance.java @@ -605,7 +605,7 @@ /** * 微信商户号 */ - public static final String WECHARPAY_APPID = "wecharPayAppid"; + public static final String WECHARPAY_MCHID = "wecharPayMchId"; /** * 支付秘钥 */ diff --git a/zq-erp/src/main/java/com/matrix/system/hive/bean/SysFollowup.java b/zq-erp/src/main/java/com/matrix/system/hive/bean/SysFollowup.java new file mode 100644 index 0000000..80839f0 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/hive/bean/SysFollowup.java @@ -0,0 +1,251 @@ +package com.matrix.system.hive.bean; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.matrix.core.pojo.EntityDTO; +import com.matrix.core.anotations.Extend; +import com.matrix.core.tools.DateUtil; +import com.matrix.system.common.bean.EntityDTOExt; +import com.matrix.system.common.bean.SysUsers; +import io.swagger.annotations.ApiModelProperty; +import org.springframework.format.annotation.DateTimeFormat; + +import javax.validation.constraints.NotNull; +import java.util.Date; +import java.util.List; + +/** + * @description 跟进 + * @author + * @date 2021-01-10 15:15 + */ +public class SysFollowup extends EntityDTOExt{ + @Extend + private static final long serialVersionUID = 1L; + + + /** + * 主键 + */ + private Long id; + + + /** + * 员工ID + */ + @NotNull(message = "员工ID") + private Long staffId; + + + /** + * 客户ID + */ + @NotNull(message = "客户ID不能为空") + @ApiModelProperty(value = "客户ID", example = "10") + private Long vipId; + + + /** + * 订单id + */ + @ApiModelProperty(value = "订单id", example = "10") + private Long orderId; + + + /** + * 服务单id + */ + @ApiModelProperty(value = "服务单id", example = "10") + private Long serviceId; + + + /** + * 门店id + */ + private Long shopId; + + + /** + * 公司id + */ + private Long companyId; + + + /** + * 下次跟进时间 + */ + @ApiModelProperty(value = "下次跟进时间", example = "2021-01-02 12:22") + @JsonFormat(pattern = DateUtil.DATE_FORMAT_MM, timezone = "GMT+8") + private Date nextNotifyTime; + + + /** + * 跟进内容 + */ + @NotNull(message = "跟进内容不能为空") + @ApiModelProperty(value = "跟进内容", example = "") + private String content; + + + /** + * 可见范围1公开,2仅自己可见 + */ + @NotNull(message = "可见范围不能为空") + @ApiModelProperty(value = "可见范围1公开,2仅自己可见", example = "") + private Integer visible; + + + /** + * 订单摘要信息 + */ + @ApiModelProperty(value = "订单摘要信息", example = "") + private String orderAbstract; + + /** + * 点赞人ids + */ + @ApiModelProperty(value = "点赞人ids", example = "1,2") + private String zans; + + @Extend + @ApiModelProperty(value = "点赞人列表",example ="") + private List<SysUsers> zanUsers; + + @Extend + @ApiModelProperty(value = "图片集合", example = "") + private List<SysVipAlbum> albums; + + @Extend + @ApiModelProperty(value = "评论集合",example ="") + private List<SysFollowupComment> followupComments; + + public List<SysFollowupComment> getFollowupComments() { + return followupComments; + } + + public void setFollowupComments(List<SysFollowupComment> followupComments) { + this.followupComments = followupComments; + } + + public Integer getVisible() { + return visible; + } + + public void setVisible(Integer visible) { + this.visible = visible; + } + + public List<SysUsers> getZanUsers() { + return zanUsers; + } + + public void setZanUsers(List<SysUsers> zanUsers) { + this.zanUsers = zanUsers; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getStaffId() { + return staffId; + } + + public void setStaffId(Long staffId) { + this.staffId = staffId; + } + + public Long getVipId() { + return vipId; + } + + public void setVipId(Long vipId) { + this.vipId = vipId; + } + + public Long getOrderId() { + return orderId; + } + + public void setOrderId(Long orderId) { + this.orderId = orderId; + } + + public Long getServiceId() { + return serviceId; + } + + public void setServiceId(Long serviceId) { + this.serviceId = serviceId; + } + + public Long getShopId() { + return shopId; + } + + public void setShopId(Long shopId) { + this.shopId = shopId; + } + + public Long getCompanyId() { + return companyId; + } + + public void setCompanyId(Long companyId) { + this.companyId = companyId; + } + + public List<SysVipAlbum> getAlbums() { + return albums; + } + + public void setAlbums(List<SysVipAlbum> albums) { + this.albums = albums; + } + + public Date getNextNotifyTime() { + return nextNotifyTime; + } + + public SysFollowup setNextNotifyTime(Date nextNotifyTime) { + this.nextNotifyTime=nextNotifyTime; + return this; + } + + + public String getContent() { + return content; + } + + public SysFollowup setContent(String content) { + this.content=content; + return this; + } + + + public String getOrderAbstract() { + return orderAbstract; + } + + public SysFollowup setOrderAbstract(String orderAbstract) { + this.orderAbstract=orderAbstract; + return this; + } + + + public String getZans() { + return zans; + } + + public SysFollowup setZans(String zans) { + this.zans=zans; + return this; + } + + + + +} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/hive/bean/SysFollowupComment.java b/zq-erp/src/main/java/com/matrix/system/hive/bean/SysFollowupComment.java new file mode 100644 index 0000000..75602b4 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/hive/bean/SysFollowupComment.java @@ -0,0 +1,90 @@ +package com.matrix.system.hive.bean; + +import com.matrix.core.pojo.EntityDTO; +import com.matrix.core.anotations.Extend; +import io.swagger.annotations.ApiModelProperty; + +import javax.validation.constraints.NotNull; + +/** + * @description 跟进评论 + * @author + * @date 2021-01-10 15:15 + */ +public class SysFollowupComment extends EntityDTO{ + @Extend + private static final long serialVersionUID = 1L; + + + /** + * 主键 + */ + private Long id; + + + /** + * 跟进id + */ + @NotNull(message = "跟进记录id不能为空") + @ApiModelProperty(value = "跟进id", example = "1") + private Long follId; + + + /** + * 员工ID + */ + private Long staffId; + + + /** + * 评论内容 + */ + @NotNull(message = "评论内容不能为空") + @ApiModelProperty(value = "评论内容不能为空", example = "不错") + private String content; + + + + public Long getId() { + return id; + } + + public SysFollowupComment setId(Long id) { + this.id=id; + return this; + } + + + public Long getFollId() { + return follId; + } + + public SysFollowupComment setFollId(Long follId) { + this.follId=follId; + return this; + } + + + public Long getStaffId() { + return staffId; + } + + public SysFollowupComment setStaffId(Long staffId) { + this.staffId=staffId; + return this; + } + + + public String getContent() { + return content; + } + + public SysFollowupComment setContent(String content) { + this.content=content; + return this; + } + + + + +} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/hive/bean/SysVipAlbum.java b/zq-erp/src/main/java/com/matrix/system/hive/bean/SysVipAlbum.java new file mode 100644 index 0000000..b6e2a82 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/hive/bean/SysVipAlbum.java @@ -0,0 +1,96 @@ +package com.matrix.system.hive.bean; + +import com.matrix.core.pojo.EntityDTO; +import com.matrix.core.anotations.Extend; + +/** + * @description 客户相册 + * @author + * @date 2021-01-10 15:15 + */ +public class SysVipAlbum extends EntityDTO{ + @Extend + private static final long serialVersionUID = 1L; + public static final int SOURCE_FOLLOW = 1; + public static final int SOURCE_SKILL = 2; + + + /** + * 主键 + */ + private Long id; + + + /** + * 客户ID + */ + private Long vipId; + + + /** + * 图片路径 + */ + private String img; + + + /** + * 来源1,跟进,2批发检测 + */ + private Integer source; + + + /** + * 来源主键 + */ + private Long sourceId; + + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getVipId() { + return vipId; + } + + public void setVipId(Long vipId) { + this.vipId = vipId; + } + + public String getImg() { + return img; + } + + public SysVipAlbum setImg(String img) { + this.img=img; + return this; + } + + + public Integer getSource() { + return source; + } + + public SysVipAlbum setSource(Integer source) { + this.source=source; + return this; + } + + + public Long getSourceId() { + return sourceId; + } + + public SysVipAlbum setSourceId(Long sourceId) { + this.sourceId=sourceId; + return this; + } + + + + +} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/hive/dao/SysFollowupCommentDao.java b/zq-erp/src/main/java/com/matrix/system/hive/dao/SysFollowupCommentDao.java new file mode 100644 index 0000000..224e6c1 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/hive/dao/SysFollowupCommentDao.java @@ -0,0 +1,42 @@ +package com.matrix.system.hive.dao; + +import org.apache.ibatis.annotations.Param; +import java.util.List; +import java.util.Map; +import com.matrix.core.pojo.PaginationVO; +import com.matrix.system.hive.bean.SysFollowupComment; + +/** + * @description 跟进评论 + * @author + * @date 2021-01-10 15:15 + */ +public interface SysFollowupCommentDao{ + + public int insert(@Param("item") SysFollowupComment sysFollowupComment); + + public int batchInsert(@Param("list") List<SysFollowupComment> sysFollowupCommentList); + + public int updateByMap(Map<String, Object> modifyMap); + + public int updateByModel(@Param("record")SysFollowupComment sysFollowupComment); + + public int deleteByIds(@Param("list") List<String> list); + + public int deleteById(Integer id); + + public int deleteByModel(@Param("record") SysFollowupComment sysFollowupComment); + + public List<SysFollowupComment> selectInPage(@Param("record") SysFollowupComment sysFollowupComment, @Param("pageVo") PaginationVO pageVo); + + public List<SysFollowupComment> selectByfollId(Long follId); + + public List<SysFollowupComment> selectByModel(@Param("record") SysFollowupComment sysFollowupComment); + + public int selectTotalRecord(@Param("record") SysFollowupComment sysFollowupComment); + + public SysFollowupComment selectById(Long id); + + public SysFollowupComment selectForUpdate(Long id); + +} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/hive/dao/SysFollowupDao.java b/zq-erp/src/main/java/com/matrix/system/hive/dao/SysFollowupDao.java new file mode 100644 index 0000000..8a10139 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/hive/dao/SysFollowupDao.java @@ -0,0 +1,44 @@ +package com.matrix.system.hive.dao; + +import com.matrix.system.app.dto.FollowupCommonetListDto; +import org.apache.ibatis.annotations.Param; +import java.util.List; +import java.util.Map; +import com.matrix.core.pojo.PaginationVO; +import com.matrix.system.hive.bean.SysFollowup; + +/** + * @description 跟进 + * @author + * @date 2021-01-10 15:15 + */ +public interface SysFollowupDao{ + + public int insert(@Param("item") SysFollowup sysFollowup); + + public int batchInsert(@Param("list") List<SysFollowup> sysFollowupList); + + public int updateByMap(Map<String, Object> modifyMap); + + public int updateByModel(@Param("record")SysFollowup sysFollowup); + + public int deleteByIds(@Param("list") List<String> list); + + public int deleteById(Long id); + + public int deleteByModel(@Param("record") SysFollowup sysFollowup); + + public List<SysFollowup> selectInPage(@Param("record") SysFollowup sysFollowup, @Param("pageVo") PaginationVO pageVo); + + public List<SysFollowup> selectByModel(@Param("record") SysFollowup sysFollowup); + + public int selectTotalRecord(@Param("record") SysFollowup sysFollowup); + + public SysFollowup selectById(Long id); + + public SysFollowup selectForUpdate(Long id); + + void updateZan(@Param("id")Long id, @Param("zans")String zans); + + List<SysFollowup> selectByAppDto(FollowupCommonetListDto followupCommonetListDto); +} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/hive/dao/SysVipAlbumDao.java b/zq-erp/src/main/java/com/matrix/system/hive/dao/SysVipAlbumDao.java new file mode 100644 index 0000000..70f2950 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/hive/dao/SysVipAlbumDao.java @@ -0,0 +1,42 @@ +package com.matrix.system.hive.dao; + +import org.apache.ibatis.annotations.Param; +import java.util.List; +import java.util.Map; +import com.matrix.core.pojo.PaginationVO; +import com.matrix.system.hive.bean.SysVipAlbum; + +/** + * @description 客户相册 + * @author + * @date 2021-01-10 15:15 + */ +public interface SysVipAlbumDao{ + + public int insert(@Param("item") SysVipAlbum sysVipAlbum); + + public int batchInsert(@Param("list") List<SysVipAlbum> sysVipAlbumList); + + public int updateByMap(Map<String, Object> modifyMap); + + public int updateByModel(@Param("record")SysVipAlbum sysVipAlbum); + + public int deleteByIds(@Param("list") List<String> list); + + public int deleteById(Integer id); + + public int deleteByModel(@Param("record") SysVipAlbum sysVipAlbum); + + public List<SysVipAlbum> selectInPage(@Param("record") SysVipAlbum sysVipAlbum, @Param("pageVo") PaginationVO pageVo); + + public List<SysVipAlbum> selectBySourceId(Long sourceId); + + public List<SysVipAlbum> selectByModel(@Param("record") SysVipAlbum sysVipAlbum); + + public int selectTotalRecord(@Param("record") SysVipAlbum sysVipAlbum); + + public SysVipAlbum selectById(Long id); + + public SysVipAlbum selectForUpdate(Long id); + +} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/MsgDemo.java b/zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/demo/MsgDemo.java similarity index 95% rename from zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/MsgDemo.java rename to zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/demo/MsgDemo.java index e5c650d..8c211a2 100644 --- a/zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/MsgDemo.java +++ b/zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/demo/MsgDemo.java @@ -1,4 +1,4 @@ -package com.matrix.system.wechart.templateMsg; +package com.matrix.system.wechart.templateMsg.demo; import com.alibaba.fastjson.JSONObject; import com.matrix.component.tools.HttpClientUtil; @@ -6,6 +6,7 @@ import com.matrix.system.hive.plugin.util.HttpUtils; import com.matrix.system.shopXcx.api.WeChatGzhApiTools; import com.matrix.system.shopXcx.bean.ShopAdvertisType; +import com.matrix.system.wechart.templateMsg.GzhTemplateMessagePojo; import org.apache.commons.httpclient.HttpClient; import org.apache.commons.httpclient.HttpException; import org.apache.commons.httpclient.NameValuePair; diff --git a/zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/MsgDemo2.java b/zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/demo/MsgDemo2.java similarity index 93% rename from zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/MsgDemo2.java rename to zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/demo/MsgDemo2.java index b50626a..edbb168 100644 --- a/zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/MsgDemo2.java +++ b/zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/demo/MsgDemo2.java @@ -1,10 +1,12 @@ -package com.matrix.system.wechart.templateMsg; +package com.matrix.system.wechart.templateMsg.demo; import com.alibaba.fastjson.JSONObject; import com.matrix.component.tools.HttpClientUtil; import com.matrix.core.pojo.AjaxResult; import com.matrix.system.hive.plugin.util.HttpUtils; import com.matrix.system.shopXcx.api.WeChatGzhApiTools; +import com.matrix.system.wechart.templateMsg.GzhTemplateMessagePojo; +import com.matrix.system.wechart.templateMsg.UniformMsgPojo; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; diff --git a/zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/MsgDemo3.java b/zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/demo/MsgDemo3.java similarity index 94% rename from zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/MsgDemo3.java rename to zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/demo/MsgDemo3.java index 5531bf7..db1e7cd 100644 --- a/zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/MsgDemo3.java +++ b/zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/demo/MsgDemo3.java @@ -1,4 +1,4 @@ -package com.matrix.system.wechart.templateMsg; +package com.matrix.system.wechart.templateMsg.demo; import com.alibaba.fastjson.JSONObject; import com.matrix.component.tools.HttpClientUtil; diff --git a/zq-erp/src/main/resources/config/application.properties b/zq-erp/src/main/resources/config/application.properties index e14f492..0cc9ddf 100644 --- a/zq-erp/src/main/resources/config/application.properties +++ b/zq-erp/src/main/resources/config/application.properties @@ -1,4 +1,4 @@ -evn=devbb +evn=dev server.port=8080 diff --git a/zq-erp/src/main/resources/mybatis/mapper/hive/SysFollowupCommentDao.xml b/zq-erp/src/main/resources/mybatis/mapper/hive/SysFollowupCommentDao.xml new file mode 100644 index 0000000..82af5be --- /dev/null +++ b/zq-erp/src/main/resources/mybatis/mapper/hive/SysFollowupCommentDao.xml @@ -0,0 +1,228 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" +"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> + +<mapper namespace="com.matrix.system.hive.dao.SysFollowupCommentDao"> + <!-- 定义SysFollowupComment 的复杂关联map --> + <resultMap type="com.matrix.system.hive.bean.SysFollowupComment" id="SysFollowupCommentMap"> + <id property="id" column="id" /> + <result property="createBy" column="create_by" /> + <result property="createTime" column="create_time" /> + <result property="updateBy" column="update_by" /> + <result property="updateTime" column="update_time" /> + <result property="follId" column="foll_id" /> + <result property="staffId" column="staff_id" /> + <result property="content" column="content" /> + </resultMap> + + + <!-- 定义SysFollowupComment 的简单map ,本map不添加其他的关联属性 --> + <resultMap type="com.matrix.system.hive.bean.SysFollowupComment" id="SysFollowupCommentSimpleMap"> + <id property="id" column="id" /> + <result property="createBy" column="create_by" /> + <result property="createTime" column="create_time" /> + <result property="updateBy" column="update_by" /> + <result property="updateTime" column="update_time" /> + <result property="follId" column="foll_id" /> + <result property="staffId" column="staff_id" /> + <result property="content" column="content" /> + </resultMap> + + <!-- 字段sql --> + <sql id="columns"> + create_by, + create_time, + update_by, + update_time, + id, + foll_id, + staff_id, + content + </sql> + + <!-- 属性sql --> + <sql id="propertys"> + #{item.createBy}, + now(), + #{item.updateBy}, + now(), + #{item.id}, + #{item.follId}, + #{item.staffId}, + #{item.content} + </sql> + + <!-- where sql --> + <sql id="where_sql"> + + <if test="record!=null"> + <if test="(record.id!=null and record.id!='') or (record.id!='' and record.id==0) "> + and id = #{record.id} + </if> + <if test="(record.follId!=null and record.follId!='') or (record.follId!='' and record.follId==0) "> + and foll_id = #{record.follId} + </if> + <if test="(record.staffId!=null and record.staffId!='') or (record.staffId!='' and record.staffId==0) "> + and staff_id = #{record.staffId} + </if> + <if test="(record.content!=null and record.content!='') or (record.content!='' and record.content==0) "> + and content = #{record.content} + </if> + </if> + + </sql> + + <!-- 插入方法 --> + <insert id="insert" parameterType="com.matrix.system.hive.bean.SysFollowupComment" + useGeneratedKeys="true" keyProperty="item.id"> + INSERT INTO sys_followup_comment ( + <include refid="columns"></include> + ) + VALUES ( + <include refid="propertys"></include> + ) + </insert> + + + + <!-- 批量插入 --> + <insert id="batchInsert" parameterType="java.util.List"> + INSERT INTO sys_followup_comment ( + <include refid="columns"></include> + ) + VALUES + <foreach collection="list" item="item" index="index" separator=",">( + <include refid="propertys"></include> + )</foreach> + </insert> + + + + + + <!-- 根据Map更新 部分更新 --> + <update id="updateByMap" parameterType="java.util.HashMap" > + UPDATE sys_followup_comment + <set> + <if test="_parameter.containsKey('follId')"> + foll_id = #{follId}, + </if> + <if test="_parameter.containsKey('staffId')"> + staff_id = #{staffId}, + </if> + <if test="_parameter.containsKey('content')"> + content = #{content}, + </if> + </set> + WHERE id=#{id} + </update> + + + <!-- 根据对象更新 部分更新 --> + <update id="updateByModel" parameterType="Integer"> + UPDATE sys_followup_comment + <set> + <if test="record.follId != null "> + foll_id = #{record.follId}, + </if> + <if test="record.staffId != null "> + staff_id = #{record.staffId}, + </if> + <if test="record.content != null and record.content != '' "> + content = #{record.content}, + </if> + </set> + WHERE id=#{record.id} + </update> + + <!-- 批量删除 --> + <delete id="deleteByIds" parameterType="java.util.List"> + delete from sys_followup_comment where id in + <foreach collection="list" index="index" item="item" open="(" + separator="," close=")"> + #{item} + </foreach> + </delete> + + <!-- 根据id删除--> + <delete id="deleteById" parameterType="Integer"> + DELETE FROM sys_followup_comment + where id=#{id} + </delete> + + <!-- 根据对象删除--> + <delete id="deleteByModel" parameterType="com.matrix.system.hive.bean.SysFollowupComment"> + DELETE FROM sys_followup_comment + <where> + <include refid="where_sql" ></include> + </where> + </delete> + + + + <!-- 分页查询 --> + <select id="selectInPage" resultMap="SysFollowupCommentMap"> + select + <include refid="columns" ></include> + from sys_followup_comment + <where> + <include refid="where_sql"></include> + </where> + <if test="pageVo !=null"><!-- 判断pageVo对象是否为空 --> + <if test="pageVo.sort !=null and pageVo.order !=null"> + order by + ${pageVo.sort} ${pageVo.order} + </if> + <if test="pageVo.offset >=0 and pageVo.limit >0"> + limit + #{pageVo.offset},#{pageVo.limit} + </if> + </if> + </select> + + <!-- 查询总条数 --> + <select id="selectTotalRecord" parameterType="long" resultType="java.lang.Integer"> + select count(*) + from sys_followup_comment + <where> + <include refid="where_sql"></include> + </where> + </select> + + <!-- 根据id查询--> + <select id="selectById" resultMap="SysFollowupCommentMap"> + select + <include refid="columns" ></include> + from sys_followup_comment + where id=#{id} + </select> + + + <!-- 根据id 锁表查询--> + <select id="selectForUpdate" resultMap="SysFollowupCommentMap"> + select + <include refid="columns" ></include> + from sys_followup_comment + where id=#{id} + for update + </select> + + + + <!-- 根据对象查询--> + <select id="selectByModel" resultMap="SysFollowupCommentMap"> + select + <include refid="columns" ></include> + from sys_followup_comment + <where> + <include refid="where_sql"></include> + </where> + </select> + + <select id="selectByfollId" resultMap="SysFollowupCommentMap"> + select + <include refid="columns" ></include> + from sys_followup_comment + where foll_id=#{follId} + </select> +</mapper> \ No newline at end of file diff --git a/zq-erp/src/main/resources/mybatis/mapper/hive/SysFollowupDao.xml b/zq-erp/src/main/resources/mybatis/mapper/hive/SysFollowupDao.xml new file mode 100644 index 0000000..6d5c625 --- /dev/null +++ b/zq-erp/src/main/resources/mybatis/mapper/hive/SysFollowupDao.xml @@ -0,0 +1,395 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" +"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> + +<mapper namespace="com.matrix.system.hive.dao.SysFollowupDao" > + <!-- 定义SysFollowup 的复杂关联map --> + <resultMap type="com.matrix.system.hive.bean.SysFollowup" id="SysFollowupMap"> + <id property="id" column="id" /> + <result property="createBy" column="create_by" /> + <result property="createTime" column="create_time" /> + <result property="updateBy" column="update_by" /> + <result property="updateTime" column="update_time" /> + <result property="staffId" column="staff_id" /> + <result property="vipId" column="vip_id" /> + <result property="orderId" column="order_id" /> + <result property="serviceId" column="service_id" /> + <result property="shopId" column="shop_id" /> + <result property="companyId" column="company_id" /> + <result property="nextNotifyTime" column="next_notify_time" /> + <result property="content" column="content" /> + <result property="visible" column="visible" /> + <result property="orderAbstract" column="order_abstract" /> + <result property="zans" column="zans" /> + + <collection property="albums" column="{sourceId=id}" select="com.matrix.system.hive.dao.SysVipAlbumDao.selectBySourceId" /> + + <collection property="followupComments" column="{follId=id}" select="com.matrix.system.hive.dao.SysFollowupCommentDao.selectByfollId" ></collection> + + <collection property="zanUsers" column="{zans=zans}" select="selectUserByZaqns" ></collection> + + + </resultMap> + + <select id="selectUserByZaqns" resultMap="com.matrix.system.common.dao.SysUsersDao.SysUsersMap" > + select su_id,su_name from sys_users where FIND_IN_SET(#{zans}, su_id) + </select> + + <!-- 定义SysFollowup 的简单map ,本map不添加其他的关联属性 --> + <resultMap type="com.matrix.system.hive.bean.SysFollowup" id="SysFollowupSimpleMap"> + <id property="id" column="id" /> + <result property="createBy" column="create_by" /> + <result property="createTime" column="create_time" /> + <result property="updateBy" column="update_by" /> + <result property="updateTime" column="update_time" /> + <result property="staffId" column="staff_id" /> + <result property="vipId" column="vip_id" /> + <result property="orderId" column="order_id" /> + <result property="serviceId" column="service_id" /> + <result property="shopId" column="shop_id" /> + <result property="companyId" column="company_id" /> + <result property="nextNotifyTime" column="next_notify_time" /> + <result property="content" column="content" /> + <result property="visible" column="visible" /> + <result property="orderAbstract" column="order_abstract" /> + <result property="zans" column="zans" /> + </resultMap> + + <!-- 字段sql --> + <sql id="columns"> + create_by, + create_time, + update_by, + update_time, + id, + staff_id, + vip_id, + order_id, + service_id, + shop_id, + company_id, + next_notify_time, + content, + visible, + order_abstract, + zans + </sql> + + <!-- 属性sql --> + <sql id="propertys"> + #{item.createBy}, + now(), + #{item.updateBy}, + now(), + #{item.id}, + #{item.staffId}, + #{item.vipId}, + #{item.orderId}, + #{item.serviceId}, + #{item.shopId}, + #{item.companyId}, + #{item.nextNotifyTime}, + #{item.content}, + #{item.visible}, + #{item.orderAbstract}, + #{item.zans} + </sql> + + <!-- where sql --> + <sql id="where_sql"> + + <if test="record!=null"> + <if test="(record.id!=null and record.id!='') or (record.id!='' and record.id==0) "> + and id = #{record.id} + </if> + <if test="(record.staffId!=null and record.staffId!='') or (record.staffId!='' and record.staffId==0) "> + and staff_id = #{record.staffId} + </if> + <if test="(record.vipId!=null and record.vipId!='') or (record.vipId!='' and record.vipId==0) "> + and vip_id = #{record.vipId} + </if> + <if test="(record.orderId!=null and record.orderId!='') or (record.orderId!='' and record.orderId==0) "> + and order_id = #{record.orderId} + </if> + <if test="(record.serviceId!=null and record.serviceId!='') or (record.serviceId!='' and record.serviceId==0) "> + and service_id = #{record.serviceId} + </if> + <if test="(record.shopId!=null and record.shopId!='') or (record.shopId!='' and record.shopId==0) "> + and shop_id = #{record.shopId} + </if> + <if test="(record.companyId!=null and record.companyId!='') or (record.companyId!='' and record.companyId==0) "> + and company_id = #{record.companyId} + </if> + <if test="(record.nextNotifyTime!=null and record.nextNotifyTime!='') or (record.nextNotifyTime!='' and record.nextNotifyTime==0) "> + and next_notify_time = #{record.nextNotifyTime} + </if> + <if test="(record.content!=null and record.content!='') or (record.content!='' and record.content==0) "> + and content = #{record.content} + </if> + <if test="(record.visible!=null and record.visible!='') or (record.visible!='' and record.visible==0) "> + and visible = #{record.visible} + </if> + <if test="(record.orderAbstract!=null and record.orderAbstract!='') or (record.orderAbstract!='' and record.orderAbstract==0) "> + and order_abstract = #{record.orderAbstract} + </if> + <if test="(record.zans!=null and record.zans!='') or (record.zans!='' and record.zans==0) "> + and zans = #{record.zans} + </if> + </if> + + </sql> + + <!-- 插入方法 --> + <insert id="insert" parameterType="com.matrix.system.hive.bean.SysFollowup" + useGeneratedKeys="true" keyProperty="item.id"> + INSERT INTO sys_followup ( + <include refid="columns"></include> + ) + VALUES ( + <include refid="propertys"></include> + ) + </insert> + + + + <!-- 批量插入 --> + <insert id="batchInsert" parameterType="java.util.List"> + INSERT INTO sys_followup ( + <include refid="columns"></include> + ) + VALUES + <foreach collection="list" item="item" index="index" separator=",">( + <include refid="propertys"></include> + )</foreach> + </insert> + + + + + + <!-- 根据Map更新 部分更新 --> + <update id="updateByMap" parameterType="java.util.HashMap" > + UPDATE sys_followup + <set> + <if test="_parameter.containsKey('staffId')"> + staff_id = #{staffId}, + </if> + <if test="_parameter.containsKey('vipId')"> + vip_id = #{vipId}, + </if> + <if test="_parameter.containsKey('orderId')"> + order_id = #{orderId}, + </if> + <if test="_parameter.containsKey('serviceId')"> + service_id = #{serviceId}, + </if> + <if test="_parameter.containsKey('shopId')"> + shop_id = #{shopId}, + </if> + <if test="_parameter.containsKey('companyId')"> + company_id = #{companyId}, + </if> + <if test="_parameter.containsKey('nextNotifyTime')"> + next_notify_time = #{nextNotifyTime}, + </if> + <if test="_parameter.containsKey('content')"> + content = #{content}, + </if> + <if test="_parameter.containsKey('visible')"> + visible = #{visible}, + </if> + <if test="_parameter.containsKey('orderAbstract')"> + order_abstract = #{orderAbstract}, + </if> + <if test="_parameter.containsKey('zans')"> + zans = #{zans}, + </if> + </set> + WHERE id=#{id} + </update> + + + <!-- 根据对象更新 部分更新 --> + <update id="updateByModel" parameterType="Integer"> + UPDATE sys_followup + <set> + <if test="record.staffId != null "> + staff_id = #{record.staffId}, + </if> + <if test="record.vipId != null "> + vip_id = #{record.vipId}, + </if> + <if test="record.orderId != null "> + order_id = #{record.orderId}, + </if> + <if test="record.serviceId != null "> + service_id = #{record.serviceId}, + </if> + <if test="record.shopId != null "> + shop_id = #{record.shopId}, + </if> + <if test="record.companyId != null "> + company_id = #{record.companyId}, + </if> + <if test="record.nextNotifyTime != null "> + next_notify_time = #{record.nextNotifyTime}, + </if> + <if test="record.content != null and record.content != '' "> + content = #{record.content}, + </if> + <if test="record.visible != null "> + visible = #{record.visible}, + </if> + <if test="record.orderAbstract != null and record.orderAbstract != '' "> + order_abstract = #{record.orderAbstract}, + </if> + <if test="record.zans != null and record.zans != '' "> + zans = #{record.zans}, + </if> + </set> + WHERE id=#{record.id} + </update> + + <!-- 更新点赞人数 --> + <update id="updateZan"> + update sys_followup set zans=#{zans} where id=#{id} + </update> + + <!-- 批量删除 --> + <delete id="deleteByIds" parameterType="java.util.List"> + delete from sys_followup where id in + <foreach collection="list" index="index" item="item" open="(" + separator="," close=")"> + #{item} + </foreach> + </delete> + + <!-- 根据id删除--> + <delete id="deleteById" parameterType="Integer"> + DELETE FROM sys_followup + where id=#{id} + </delete> + + <!-- 根据对象删除--> + <delete id="deleteByModel" parameterType="com.matrix.system.hive.bean.SysFollowup"> + DELETE FROM sys_followup + <where> + <include refid="where_sql" ></include> + </where> + </delete> + + + + <!-- 分页查询 --> + <select id="selectInPage" resultMap="SysFollowupMap"> + select + <include refid="columns" ></include> + from sys_followup + <where> + <include refid="where_sql"></include> + </where> + <if test="pageVo !=null"><!-- 判断pageVo对象是否为空 --> + <if test="pageVo.sort !=null and pageVo.order !=null"> + order by + ${pageVo.sort} ${pageVo.order} + </if> + <if test="pageVo.offset >=0 and pageVo.limit >0"> + limit + #{pageVo.offset},#{pageVo.limit} + </if> + </if> + </select> + + <!-- 查询总条数 --> + <select id="selectTotalRecord" parameterType="long" resultType="java.lang.Integer"> + select count(*) + from sys_followup + <where> + <include refid="where_sql"></include> + </where> + </select> + + <!-- 根据id查询--> + <select id="selectById" resultMap="SysFollowupMap"> + select + <include refid="columns" ></include> + from sys_followup + where id=#{id} + </select> + + + <!-- 根据id 锁表查询--> + <select id="selectForUpdate" resultMap="SysFollowupMap"> + select + <include refid="columns" ></include> + from sys_followup + where id=#{id} + for update + </select> + + + + <!-- 根据对象查询--> + <select id="selectByModel" resultMap="SysFollowupMap"> + select + <include refid="columns" ></include> + from sys_followup + <where> + <include refid="where_sql"></include> + </where> + </select> + + + <select id="selectByAppDto" resultMap="SysFollowupMap"> + select * from sys_followup + <where> + and company_id=#{companyId} + + <if test="shopId != null "> + and shop_id=#{shopId} + </if> + <if test="queryType == 1 "> + and (visible=1 or ( visible!=1 and staff_id=#{selfStaff})) + </if> + <if test="queryType == 2 "> + and staff_id=#{selfStaff} + </if> + <if test="queryType == 3 "> + and( visible=1 and staff_id!=#{selfStaff}) + </if> + + <if test="startTime != null "> + and create_time <![CDATA[ >= ]]> #{startTime} + </if> + <if test="endTime != null "> + and create_time <![CDATA[ <= ]]> #{endTime} + </if> + + <if test="vipIds!=null and vipIds.size()!=0"> + and vip_id in + <foreach collection="vipIds" index="index" item="item" open="(" + separator="," close=")"> + #{item} + </foreach> + </if> + + <if test="staffIds!=null and staffIds.size()!=0"> + and staff_id in + <foreach collection="staffIds" index="index" item="item" open="(" + separator="," close=")"> + #{item} + </foreach> + </if> + + + </where> + + + + + + limit ${offset},${limit} + </select> + + +</mapper> \ No newline at end of file diff --git a/zq-erp/src/main/resources/mybatis/mapper/hive/SysVipAlbumDao.xml b/zq-erp/src/main/resources/mybatis/mapper/hive/SysVipAlbumDao.xml new file mode 100644 index 0000000..c82a8c6 --- /dev/null +++ b/zq-erp/src/main/resources/mybatis/mapper/hive/SysVipAlbumDao.xml @@ -0,0 +1,241 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" +"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> + +<mapper namespace="com.matrix.system.hive.dao.SysVipAlbumDao"> + <!-- 定义SysVipAlbum 的复杂关联map --> + <resultMap type="com.matrix.system.hive.bean.SysVipAlbum" id="SysVipAlbumMap"> + <id property="id" column="id" /> + <result property="createBy" column="create_by" /> + <result property="createTime" column="create_time" /> + <result property="updateBy" column="update_by" /> + <result property="updateTime" column="update_time" /> + <result property="vipId" column="vip_id" /> + <result property="img" column="img" /> + <result property="source" column="source" /> + <result property="sourceId" column="source_id" /> + </resultMap> + + + <!-- 定义SysVipAlbum 的简单map ,本map不添加其他的关联属性 --> + <resultMap type="com.matrix.system.hive.bean.SysVipAlbum" id="SysVipAlbumSimpleMap"> + <id property="id" column="id" /> + <result property="createBy" column="create_by" /> + <result property="createTime" column="create_time" /> + <result property="updateBy" column="update_by" /> + <result property="updateTime" column="update_time" /> + <result property="vipId" column="vip_id" /> + <result property="img" column="img" /> + <result property="source" column="source" /> + <result property="sourceId" column="source_id" /> + </resultMap> + + <!-- 字段sql --> + <sql id="columns"> + create_by, + create_time, + update_by, + update_time, + id, + vip_id, + img, + source, + source_id + </sql> + + <!-- 属性sql --> + <sql id="propertys"> + #{item.createBy}, + now(), + #{item.updateBy}, + now(), + #{item.id}, + #{item.vipId}, + #{item.img}, + #{item.source}, + #{item.sourceId} + </sql> + + <!-- where sql --> + <sql id="where_sql"> + + <if test="record!=null"> + <if test="(record.id!=null and record.id!='') or (record.id!='' and record.id==0) "> + and id = #{record.id} + </if> + <if test="(record.vipId!=null and record.vipId!='') or (record.vipId!='' and record.vipId==0) "> + and vip_id = #{record.vipId} + </if> + <if test="(record.img!=null and record.img!='') or (record.img!='' and record.img==0) "> + and img = #{record.img} + </if> + <if test="(record.source!=null and record.source!='') or (record.source!='' and record.source==0) "> + and source = #{record.source} + </if> + <if test="(record.sourceId!=null and record.sourceId!='') or (record.sourceId!='' and record.sourceId==0) "> + and source_id = #{record.sourceId} + </if> + </if> + + </sql> + + <!-- 插入方法 --> + <insert id="insert" parameterType="com.matrix.system.hive.bean.SysVipAlbum" + useGeneratedKeys="true" keyProperty="item.id"> + INSERT INTO sys_vip_album ( + <include refid="columns"></include> + ) + VALUES ( + <include refid="propertys"></include> + ) + </insert> + + + + <!-- 批量插入 --> + <insert id="batchInsert" parameterType="java.util.List"> + INSERT INTO sys_vip_album ( + <include refid="columns"></include> + ) + VALUES + <foreach collection="list" item="item" index="index" separator=",">( + <include refid="propertys"></include> + )</foreach> + </insert> + + + + + + <!-- 根据Map更新 部分更新 --> + <update id="updateByMap" parameterType="java.util.HashMap" > + UPDATE sys_vip_album + <set> + <if test="_parameter.containsKey('vipId')"> + vip_id = #{vipId}, + </if> + <if test="_parameter.containsKey('img')"> + img = #{img}, + </if> + <if test="_parameter.containsKey('source')"> + source = #{source}, + </if> + <if test="_parameter.containsKey('sourceId')"> + source_id = #{sourceId}, + </if> + </set> + WHERE id=#{id} + </update> + + + <!-- 根据对象更新 部分更新 --> + <update id="updateByModel" parameterType="Integer"> + UPDATE sys_vip_album + <set> + <if test="record.vipId != null "> + vip_id = #{record.vipId}, + </if> + <if test="record.img != null and record.img != '' "> + img = #{record.img}, + </if> + <if test="record.source != null "> + source = #{record.source}, + </if> + <if test="record.sourceId != null "> + source_id = #{record.sourceId}, + </if> + </set> + WHERE id=#{record.id} + </update> + + <!-- 批量删除 --> + <delete id="deleteByIds" parameterType="java.util.List"> + delete from sys_vip_album where id in + <foreach collection="list" index="index" item="item" open="(" + separator="," close=")"> + #{item} + </foreach> + </delete> + + <!-- 根据id删除--> + <delete id="deleteById" parameterType="Integer"> + DELETE FROM sys_vip_album + where id=#{id} + </delete> + + <!-- 根据对象删除--> + <delete id="deleteByModel" parameterType="com.matrix.system.hive.bean.SysVipAlbum"> + DELETE FROM sys_vip_album + <where> + <include refid="where_sql" ></include> + </where> + </delete> + + + <select id="selectBySourceId" resultMap="SysVipAlbumMap"> + select + <include refid="columns" ></include> + from sys_vip_album + where source_id=#{sourceId} + </select> + + <!-- 分页查询 --> + <select id="selectInPage" resultMap="SysVipAlbumMap"> + + select + <include refid="columns" ></include> + from sys_vip_album + <where> + <include refid="where_sql"></include> + </where> + <if test="pageVo !=null"><!-- 判断pageVo对象是否为空 --> + <if test="pageVo.sort !=null and pageVo.order !=null"> + order by + ${pageVo.sort} ${pageVo.order} + </if> + <if test="pageVo.offset >=0 and pageVo.limit >0"> + limit + #{pageVo.offset},#{pageVo.limit} + </if> + </if> + </select> + + <!-- 查询总条数 --> + <select id="selectTotalRecord" parameterType="long" resultType="java.lang.Integer"> + select count(*) + from sys_vip_album + <where> + <include refid="where_sql"></include> + </where> + </select> + + <!-- 根据id查询--> + <select id="selectById" resultMap="SysVipAlbumMap"> + select + <include refid="columns" ></include> + from sys_vip_album + where id=#{id} + </select> + + + <!-- 根据id 锁表查询--> + <select id="selectForUpdate" resultMap="SysVipAlbumMap"> + select + <include refid="columns" ></include> + from sys_vip_album + where id=#{id} + for update + </select> + + + + <!-- 根据对象查询--> + <select id="selectByModel" resultMap="SysVipAlbumMap"> + select + <include refid="columns" ></include> + from sys_vip_album + <where> + <include refid="where_sql"></include> + </where> + </select> +</mapper> \ No newline at end of file diff --git a/zq-erp/src/main/resources/mybatis/mapper/hive/SysVipInfoDao.xml b/zq-erp/src/main/resources/mybatis/mapper/hive/SysVipInfoDao.xml index 417b21f..0f64c0b 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/hive/SysVipInfoDao.xml +++ b/zq-erp/src/main/resources/mybatis/mapper/hive/SysVipInfoDao.xml @@ -538,6 +538,8 @@ where a.ID=#{id} </select> + + <!-- 根据手机和密码查询 --> <select id="selectVipByPhonePassWord" resultMap="SysVipInfoMap"> <include refid="select"></include> -- Gitblit v1.9.1