Commit 9e9feff5 by 墨竹

feat:活码修改

parent bedd7a7a
......@@ -4,6 +4,7 @@ import com.gic.haoban.base.api.common.BasePageInfo;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* 活码(TabHaobanHmQrcode)实体类
......@@ -16,8 +17,7 @@ public class HmQrcodeListQDTO extends BasePageInfo implements Serializable {
private static final long serialVersionUID = 887910678030827375L;
private Long hmId;
private String hmCode;
/**
* 1单人 2多人
*/
......@@ -27,11 +27,10 @@ public class HmQrcodeListQDTO extends BasePageInfo implements Serializable {
private String enterpriseId;
private String name;
private String keyword;
private String creatorName;
private String storeSearch;
private Date createTimeStart;
private Date createTimeEnd;
......@@ -42,10 +41,6 @@ public class HmQrcodeListQDTO extends BasePageInfo implements Serializable {
private String storeId;
private String storeName;
private String storeCode;
private String clerkId;
private String clerkName;
......@@ -57,6 +52,8 @@ public class HmQrcodeListQDTO extends BasePageInfo implements Serializable {
*/
private Long hmGroupId;
private List<String> storeIdList;
public Long getHmId() {
return hmId;
}
......@@ -65,14 +62,6 @@ public class HmQrcodeListQDTO extends BasePageInfo implements Serializable {
this.hmId = hmId;
}
public String getHmCode() {
return hmCode;
}
public void setHmCode(String hmCode) {
this.hmCode = hmCode;
}
public Integer getHmType() {
return hmType;
}
......@@ -97,20 +86,12 @@ public class HmQrcodeListQDTO extends BasePageInfo implements Serializable {
this.enterpriseId = enterpriseId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCreatorName() {
return creatorName;
public String getKeyword() {
return keyword;
}
public void setCreatorName(String creatorName) {
this.creatorName = creatorName;
public void setKeyword(String keyword) {
this.keyword = keyword;
}
public Date getCreateTimeStart() {
......@@ -145,20 +126,12 @@ public class HmQrcodeListQDTO extends BasePageInfo implements Serializable {
this.storeId = storeId;
}
public String getStoreName() {
return storeName;
public String getStoreSearch() {
return storeSearch;
}
public void setStoreName(String storeName) {
this.storeName = storeName;
}
public String getStoreCode() {
return storeCode;
}
public void setStoreCode(String storeCode) {
this.storeCode = storeCode;
public void setStoreSearch(String storeSearch) {
this.storeSearch = storeSearch;
}
public String getClerkId() {
......@@ -192,5 +165,13 @@ public class HmQrcodeListQDTO extends BasePageInfo implements Serializable {
public void setHmGroupId(Long hmGroupId) {
this.hmGroupId = hmGroupId;
}
public List<String> getStoreIdList() {
return storeIdList;
}
public void setStoreIdList(List<String> storeIdList) {
this.storeIdList = storeIdList;
}
}
......@@ -51,4 +51,15 @@ public interface HmQrcodeApiService {
* @date 2022-07-05 10:59:03
*/
HmQrcodeDTO queryById(Long hmId);
/**
* 作废
*
* @param hmId hm id
* @return boolean
* @author mozhu
* @date 2022-07-06 13:40:27
*/
boolean delById(Long hmId);
}
......@@ -61,5 +61,17 @@ public interface TabHaobanHmQrcodeMapper {
*/
int deleteById(Long hmId);
/**
* 更新状态通过id
*
* @param statusFlag 状态标志
* @param hmId hm id
* @return int
* @author mozhu
* @date 2022-07-06 13:42:07
*/
int updateStatusById(@Param("statusFlag") Integer statusFlag, @Param("hmId")Long hmId);
}
......@@ -65,6 +65,6 @@ public class TabHaobanHmQrcodeServiceImpl implements TabHaobanHmQrcodeService {
*/
@Override
public boolean deleteById(Long hmId) {
return this.tabHaobanHmQrcodeMapper.deleteById(hmId) > 0;
return this.tabHaobanHmQrcodeMapper.updateStatusById(2,hmId) > 0;
}
}
......@@ -15,6 +15,7 @@ import com.gic.haoban.manage.api.dto.qdto.hm.HmQrcodeListQDTO;
import com.gic.haoban.manage.api.dto.qdto.hm.HmQrcodeQDTO;
import com.gic.haoban.manage.api.service.hm.HmQrcodeApiService;
import com.gic.haoban.manage.service.config.Config;
import com.gic.haoban.manage.service.pojo.bo.hm.HmQrcodeBO;
import com.gic.haoban.manage.service.service.StaffClerkRelationService;
import com.gic.haoban.manage.service.service.WxEnterpriseService;
import com.gic.haoban.manage.service.service.hm.TabHaobanHmClerkRelationService;
......@@ -163,4 +164,18 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
public HmQrcodeDTO queryById(Long hmId) {
return EntityUtil.changeEntityByOrika(HmQrcodeDTO.class, hmQrcodeService.queryById(hmId));
}
@Override
public boolean delById(Long hmId) {
HmQrcodeBO hmQrcodeBO = hmQrcodeService.queryById(hmId);
if (hmQrcodeBO == null) {
return false;
}
WxEnterpriseDTO wxEnterpriseDTO = wxEnterpriseService.selectById(hmQrcodeBO.getWxEnterpriseId());
boolean flag = qywxUserApiService.delContactWay(wxEnterpriseDTO.getCorpid(), config.getWxSuiteid(), hmQrcodeBO.getWxConfigId());
if (flag) {
hmQrcodeService.deleteById(hmId);
}
return true;
}
}
......@@ -87,78 +87,39 @@
<if test="enterpriseId != null and enterpriseId != ''">
and enterprise_id = #{enterpriseId}
</if>
<if test="name != null and name != ''">
and name = #{name}
</if>
<if test="creatorId != null and creatorId != ''">
and creator_id = #{creatorId}
</if>
<if test="creatorName != null and creatorName != ''">
and creator_name = #{creatorName}
</if>
<if test="modifierId != null and modifierId != ''">
and modifier_id = #{modifierId}
<if test="keyword != null and keyword != ''">
and ( name like CONCAT('%',#{keyword},'%') or hm_code like CONCAT('%',#{keyword},'%') or
creator_name like CONCAT('%',#{keyword},'%'))
</if>
<if test="modifierName != null and modifierName != ''">
and modifier_name = #{modifierName}
</if>
<if test="createTime != null">
and create_time = #{createTime}
<if test="createTimeStart != null">
and create_time <![CDATA[ >= ]]> #{createTime}
</if>
<if test="updateTime != null">
and update_time = #{updateTime}
</if>
<if test="memberLabelId != null and memberLabelId != ''">
and member_label_id = #{memberLabelId}
<if test="createTimeEnd != null">
and create_time <![CDATA[ >= ]]> #{createTimeEnd}
</if>
<if test="passFlag != null">
and pass_flag = #{passFlag}
</if>
<if test="welcomeId != null and welcomeId != ''">
and welcome_id = #{welcomeId}
</if>
<if test="statusFlag != null">
and status_flag = #{statusFlag}
</if>
<if test="addNum != null">
and add_num = #{addNum}
</if>
<if test="overFlag != null">
and over_flag = #{overFlag}
</if>
<if test="wxConfigId != null and wxConfigId != ''">
and wx_config_id = #{wxConfigId}
</if>
<if test="wxQrcode != null and wxQrcode != ''">
and wx_qrcode = #{wxQrcode}
</if>
<if test="wxUserId != null and wxUserId != ''">
and wx_user_id = #{wxUserId}
</if>
<if test="storeId != null and storeId != ''">
and store_id = #{storeId}
</if>
<if test="storeName != null and storeName != ''">
and store_name = #{storeName}
</if>
<if test="storeCode != null and storeCode != ''">
and store_code = #{storeCode}
</if>
<if test="clerkId != null and clerkId != ''">
and clerk_id = #{clerkId}
</if>
<if test="clerkName != null and clerkName != ''">
and clerk_name = #{clerkName}
</if>
<if test="clerkCode != null and clerkCode != ''">
and clerk_code = #{clerkCode}
</if>
<if test="hmUserNum != null">
and hm_user_num = #{hmUserNum}
<if test="storeSearch != null and storeSearch != ''">
and ( store_name like CONCAT('%',#{storeSearch},'%') or store_code like CONCAT('%',#{storeSearch},'%') )
</if>
<if test="hmGroupId != null">
and hm_group_id = #{hmGroupId}
</if>
<if test="null != storeIdList and storeIdList.size gt 0">
and store_id in
<foreach collection="storeIdList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where>
</select>
......@@ -292,5 +253,14 @@
where hm_id = #{hmId}
</delete>
<update id="updateStatusById">
update tab_haoban_hm_qrcode
<set>
status_flag = #{statusFlag},
update_time = now()
</set>
where hm_id = #{hmId}
</update>
</mapper>
package com.gic.haoban.manage.web.controller.hm;
import cn.hutool.core.convert.Convert;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.haoban.base.api.common.PageResult2;
import com.gic.haoban.base.api.common.pojo.dto.WebLoginDTO;
......@@ -9,13 +10,18 @@ import com.gic.haoban.manage.api.dto.hm.HmQrcodeDTO;
import com.gic.haoban.manage.api.dto.hm.HmQrcodeListDTO;
import com.gic.haoban.manage.api.dto.qdto.hm.HmQrcodeListQDTO;
import com.gic.haoban.manage.api.dto.qdto.hm.HmQrcodeQDTO;
import com.gic.haoban.manage.api.service.StaffApiService;
import com.gic.haoban.manage.api.service.hm.HmQrcodeApiService;
import com.gic.haoban.manage.web.errCode.HaoBanErrCode;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* 活码(TabHaobanHmQrcode)表控制层
*
......@@ -27,6 +33,8 @@ import org.springframework.web.bind.annotation.RestController;
public class HmQrcodeController {
@Autowired
private HmQrcodeApiService hmQrcodeApiService;
@Autowired
private StaffApiService staffApiService;
/**
* 新增
......@@ -71,6 +79,14 @@ public class HmQrcodeController {
*/
@RequestMapping(value = "list", method = RequestMethod.POST)
public RestResponse<PageResult2<HmQrcodeListDTO>> update(@RequestBody HmQrcodeListQDTO hmQrcodeListQDTO) {
WebLoginDTO loginUser = AuthWebRequestUtil.getLoginUser();
List<String> storeList = staffApiService.getHaoBanStoreIdsRolesByClerkId(loginUser.getClerkId(), loginUser.getWxEnterpriseId());
if (CollectionUtils.isEmpty(storeList)) {
return RestResponse.failure(Convert.toStr(HaoBanErrCode.ERR_100007.getCode()),HaoBanErrCode.ERR_100007.getMsg());
}
if (!storeList.contains("-1")) {
hmQrcodeListQDTO.setStoreIdList(storeList);
}
return RestResponse.successResult(this.hmQrcodeApiService.queryListByPage(hmQrcodeListQDTO));
}
......@@ -80,9 +96,20 @@ public class HmQrcodeController {
* @return
*/
@RequestMapping(value = "detail", method = RequestMethod.GET)
public RestResponse update(Long hmId) {
public RestResponse detail(Long hmId) {
HmQrcodeDTO hmQrcodeDTO = this.hmQrcodeApiService.queryById(hmId);
return RestResponse.successResult(hmQrcodeDTO);
}
/**
* 作废
* @param hmId
* @return
*/
@RequestMapping(value = "del", method = RequestMethod.DELETE)
public RestResponse del(Long hmId) {
this.hmQrcodeApiService.delById(hmId);
return RestResponse.successResult();
}
}
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