Merge branch 'master' of gitee.com:darlk/ShengTangManage into develop

This commit is contained in:
huangdeliang
2021-05-25 10:20:33 +08:00
33 changed files with 1338 additions and 36 deletions

View File

@ -79,8 +79,8 @@ public class SysCustomerController extends BaseController {
for (SysCustomer sysCus : list) {
if (StringUtils.isNotEmpty(sysCus.getPhone())) {
sysCus.setPhone(StringUtils.hiddenPhoneNumber(sysCus.getPhone()));
sysCus.setEncId(sysCus.getId() != null ? AesUtils.encrypt(sysCus.getId() + "", null) : "");
}
sysCus.setEncId(sysCus.getId() != null ? AesUtils.encrypt(sysCus.getId() + "", null) : "");
}
}
return getDataTable(list);

View File

@ -1,6 +1,14 @@
package com.stdiet.web.controller.custom;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.stdiet.common.utils.StringUtils;
import com.stdiet.custom.domain.SysImportFanWxAccount;
import com.stdiet.custom.domain.SysWxSaleAccount;
import com.stdiet.custom.service.ISysImportFanWxAccountService;
import com.stdiet.custom.service.ISysWxSaleAccountService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
@ -33,6 +41,12 @@ public class SysImportFanRecordController extends BaseController
@Autowired
private ISysImportFanRecordService sysImportFanRecordService;
@Autowired
private ISysWxSaleAccountService sysWxSaleAccountService;
@Autowired
private ISysImportFanWxAccountService sysImportFanWxAccountService;
/**
* 查询导粉管理列表
*/
@ -42,6 +56,12 @@ public class SysImportFanRecordController extends BaseController
{
startPage();
List<SysImportFanRecord> list = sysImportFanRecordService.selectSysImportFanRecordList(sysImportFanRecord);
SysImportFanWxAccount sysImportFanWxAccount = new SysImportFanWxAccount();
if(list != null && list.size() > 0){
//总导粉量
int totalNum = sysImportFanRecordService.selectTotalSysImportFanNum(sysImportFanRecord);
list.get(0).setTotalFanNum(totalNum);
}
return getDataTable(list);
}
@ -76,7 +96,34 @@ public class SysImportFanRecordController extends BaseController
@PostMapping
public AjaxResult add(@RequestBody SysImportFanRecord sysImportFanRecord)
{
return toAjax(sysImportFanRecordService.insertSysImportFanRecord(sysImportFanRecord));
if(sysImportFanRecord.getImportFanDate() == null){
return AjaxResult.error("导入日期不存在");
}
int row = 0;
//批量保存
if(StringUtils.isNotEmpty(sysImportFanRecord.getImportFanChannels() )){
String[] importFanChannelArray = sysImportFanRecord.getImportFanChannels().split(",");
String[] importFanLiveArray = sysImportFanRecord.getImportFanLives().split(",");
String[] wxAccountIdArray = sysImportFanRecord.getWxAccountIds().split(",");
String[] fanNumArray = sysImportFanRecord.getFanNums().split(",");
int index = -1;
for (String importFanChannel : importFanChannelArray) {
index++;
if(StringUtils.isEmpty(importFanChannel)){
continue;
}
sysImportFanRecord.setImportFanChannel(Long.parseLong(importFanChannel));
sysImportFanRecord.setImportFanLive(StringUtils.isEmpty(importFanLiveArray[index]) ? 0L : Long.parseLong(importFanLiveArray[index]));
sysImportFanRecord.setWxAccountId(Long.parseLong(wxAccountIdArray[index]));
sysImportFanRecord.setFanNum(Long.parseLong(fanNumArray[index]));
row = sysImportFanRecordService.insertSysImportFanRecord(sysImportFanRecord);
}
}else{
if(sysImportFanRecord.getImportFanChannel() != null){
row = sysImportFanRecordService.insertSysImportFanRecord(sysImportFanRecord);
}
}
return toAjax(row);
}
/**
@ -100,4 +147,41 @@ public class SysImportFanRecordController extends BaseController
{
return toAjax(sysImportFanRecordService.deleteSysImportFanRecordByIds(ids));
}
/**
* 获取可接粉的微信号以及对应销售
* @return
*/
@PreAuthorize("@ss.hasPermi('custom:importFanRecord:add')")
@GetMapping(value = "/getWxAccountAndSale")
public AjaxResult getWxAccountAndSale(SysImportFanWxAccount sysImportFanWxAccount){
Map<String, Object> result = new HashMap<>();
List<SysWxSaleAccount> list = sysWxSaleAccountService.getWxAccountAndSale();
List<Map<String,Object>> fanNumList = sysImportFanWxAccountService.getTotalImportFanNum(sysImportFanWxAccount);
result.put("wxSaleAccountList", list);
result.put("fanNumList", fanNumList);
return AjaxResult.success(result);
}
/**
* 删除导粉记录中对应微信记录
*/
@PreAuthorize("@ss.hasPermi('custom:importFanRecord:remove')")
@Log(title = "删除导粉记录中对应微信记录", businessType = BusinessType.DELETE)
@GetMapping("/removeFanWxAccount/{ids}")
public AjaxResult removeFanWxAccount(@PathVariable Long[] ids)
{
return toAjax(sysImportFanWxAccountService.deleteSysImportFanWxAccountByIds(ids));
}
/**
* 删除导粉记录中对应微信记录
*/
@PreAuthorize("@ss.hasPermi('custom:importFanRecord:edit')")
@GetMapping("/saveWxAccountFanNum")
public AjaxResult saveWxAccountFanNum(SysImportFanWxAccount sysImportFanWxAccount)
{
return toAjax(sysImportFanWxAccountService.updateSysImportFanWxAccount(sysImportFanWxAccount));
}
}

View File

@ -233,4 +233,13 @@ public class SysLiveSchedulController extends BaseController
public AjaxResult copyLastTimeLiveSchedul(){
return sysLiveSchedulService.copyLastTimeLiveSchedul();
}
/**
* 根据日期查询直播记录
*/
@GetMapping(value = "/getAllLiveSchedulByDate")
public AjaxResult getAllLiveSchedulByDate(SysLiveSchedul sysLiveSchedul){
List<SysLiveSchedul> list = sysLiveSchedulService.selectSysLiveSchedulList(sysLiveSchedul);
return AjaxResult.success(list);
}
}