Compare commits

...

10 Commits

Author SHA1 Message Date
mzr 093d05b5ce 审批消息-发送用户查询调整-一个用户兼任业务部长和大区经理优化 2025-08-20 08:53:35 +08:00
mzr 92f493f686 审批消息发送调整 2025-08-15 18:31:57 +08:00
mzr 810e85e081 经销商档案导出时增加客户认证状态 2025-07-09 16:02:39 +08:00
mzr ac6b321f6d 定时同步发货单调整 2025-07-09 09:57:28 +08:00
lj bdfad6b0f3 Merge remote-tracking branch 'origin/master' 2025-07-04 16:36:55 +08:00
lj a5244f1a99 修改申请表的联系人-创建人调整 2025-07-04 16:36:03 +08:00
mzr a1c385fcf1 优化用户角色映射查询排序 2025-06-03 16:19:06 +08:00
mzr 9be598529b feat(stock): 增加营销区域参数并优化权限判断
- 在 StockReportApi 和 StockReportController 中添加 areaId 参数,用于筛选营销区域
- 修改 roleUtiles 方法调用,传入 areaId 参数,以实现更精确的权限控制
2025-05-15 18:29:42 +08:00
mzr 11ec6d4839 市场活动报表查询调整 2025-03-15 14:42:42 +08:00
mzr e79ef356dc 收发货记录查询调整 2025-03-13 10:57:01 +08:00
10 changed files with 28 additions and 87 deletions

View File

@ -233,10 +233,13 @@ public class BizTodoItemService {
if (applyMap != null) {
map.put("areaId", applyMap.get("marketingAreaId"));
todoUserIdsList = userService.listAll(map, ".selectTodoUserListByTaskId");
if (CollectionUtils.isEmpty(todoUserIdsList)) {
todoUserIdsList = userService.listAll(map, ".selectTodoUserListByTaskId1");
}
}
}
// 如果营销区域的上级是华南业务部,且审批流到了业务部长,该区域的部长离职后未找到合适人选,审核直接提交给营销总监
if (("da_company").equals(codeMap.get("staffNo") + "")) {
/*if (("da_company").equals(codeMap.get("staffNo") + "")) {
Map<String, Object> tempMap = new HashMap<>();
tempMap.put("areaId", areaId);
Map areaMap = marketingAreaService.oneBySql(tempMap, ".oneBySql");
@ -248,7 +251,7 @@ public class BizTodoItemService {
userInfo.setUserId("ad5f919896fb4a5daefb3a3afa5f59e3");
todoUserIdsList.add(userInfo);
}
}
}*/
if (!CollectionUtils.isEmpty(todoUserIdsList)) {
for (int i = 0; i < todoUserIdsList.size(); i++) {
UserInfo userInfo = (UserInfo) todoUserIdsList.get(i);

View File

@ -71,6 +71,9 @@ public class ReceiptRecordsController extends BaseController {
@ApiParam(required = false, value = "经销商出货开始时间") @RequestParam(required = false) String startDate,
@ApiParam(required = false, value = "经销商出货结束时间") @RequestParam(required = false) String endDate,
@ApiParam(required = false, value = "发货单客户id") @RequestParam(required = false) String invoiceClientId,
@ApiParam(required = false, value = "商品编码") @RequestParam(required = false) String goodsNo,
@ApiParam(required = false, value = "商品名称") @RequestParam(required = false) String goodsName,
@ApiParam(required = false, value = "商品规格") @RequestParam(required = false) String specifications,
@ApiParam(required = true, value = "页码", defaultValue = "1") @RequestParam(value = "page") Integer pageNum,
@ApiParam(required = true, value = "每页条数", defaultValue = "10") @RequestParam(value = "pageSize") Integer pageSize,
HttpServletRequest request) {
@ -96,6 +99,9 @@ public class ReceiptRecordsController extends BaseController {
params.put("startDate", startDate);
params.put("endDate", endDate);
params.put("invoiceClientId", invoiceClientId);
params.put("goodsNo", goodsNo);
params.put("goodsName", goodsName);
params.put("specifications", specifications);
params.put("page", pageNum);
params.put("pageSize", pageSize);
return toPage(receiptRecordsService.pageList(params, ".findRecordsByCondition"));

View File

@ -51,6 +51,7 @@ public class StockReportApi extends BaseController {
@ApiParam(required = false, value = "规格") @RequestParam(required = false) String specifications,
@ApiParam(required = false, value = "开始日期") @RequestParam(required = false) String startDate,
@ApiParam(required = false, value = "结束日期") @RequestParam(required = false) String endDate,
@ApiParam(required = false, value = "营销区域id") @RequestParam(required = false) String areaId,
@ApiParam(required = true, value = "页码", defaultValue = "1") @RequestParam(value = "page") Integer pageNum,
@ApiParam(required = true, value = "每页条数", defaultValue = "10") @RequestParam(value = "pageSize") Integer pageSize,
HttpServletRequest request) {
@ -60,7 +61,7 @@ public class StockReportApi extends BaseController {
if (!redisService.exists(token)) {
return AjaxResult.error(ErrorUtils.IS_NOT_LOGIN_ERROR, "用户未登录");
}
params = roleDateUtils.roleUtiles(token, "", "", "");
params = roleDateUtils.roleUtiles(token, areaId, "", "");
if ("0".equals(params.get("code"))) {
return AjaxResult.error(ErrorUtils.USERNAME_POWER_ERROR, "无权查看");
}

View File

@ -61,6 +61,7 @@ public class StockReportController extends BaseController {
@ApiParam(required = false, value = "发起开始日期") @RequestParam(required = false) String startTime,
@ApiParam(required = false, value = "发起开始日期") @RequestParam(required = false) String endTime,
@ApiParam(required = false, value = "结束日期") @RequestParam(required = false) String endDate,
@ApiParam(required = false, value = "营销区域id") @RequestParam(required = false) String areaId,
@ApiParam(required = true, value = "页码", defaultValue = "1") @RequestParam(value = "page") Integer pageNum,
@ApiParam(required = true, value = "每页条数", defaultValue = "10") @RequestParam(value = "pageSize") Integer pageSize,
HttpServletRequest request) {
@ -70,7 +71,7 @@ public class StockReportController extends BaseController {
if (!redisService.isKey(token)) {
return AjaxResult.error(ErrorUtils.IS_NOT_LOGIN_ERROR, "用户未登录");
}
params = roleDateUtils.roleUtiles(token, "", "", "");
params = roleDateUtils.roleUtiles(token, areaId, "", "");
if ("0".equals(params.get("code"))) {
return AjaxResult.error(ErrorUtils.USERNAME_POWER_ERROR, "无权查看");
}

View File

@ -180,7 +180,7 @@
)
</if>
</where>
ORDER BY b.create_time DESC
ORDER BY b.create_time DESC, b.id
</select>
<select id="countUserByRole" parameterType="map" resultType="Integer">

View File

@ -419,6 +419,7 @@
GROUP BY
t1.sem_id ) mact
LEFT JOIN crm_marketing_area_info b ON mact.sem_id = b.id
WHERE b.status = '1'
</select>
<!-- 市场活动报表-按照业务员分组统计 -->

View File

@ -10,10 +10,8 @@ import com.yb.lb.common.config.UserConfig;
import com.yb.lb.common.utils.*;
import com.yb.lb.webapp.Invoice.entity.InvoiceDetail;
import com.yb.lb.webapp.Invoice.entity.InvoiceInfo;
import com.yb.lb.webapp.goodsinfo.goods.entity.GoodsInfo;
import com.yb.lb.webapp.random.service.RandomService;
import com.yb.lb.webapp.redis.service.RedisService;
import com.yb.lb.webapp.u8.ueight.entity.CustomerInfo;
import com.yb.lb.webapp.u8.ueight.service.OrderUeightService;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Param;
@ -22,7 +20,6 @@ import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -49,84 +46,6 @@ public class CrmInvoiceService {
@Autowired
BaseSqlServer2Dao<InvoiceInfo> dao2;
/**
* 新增
*
* @author lyb
* @date 20210526
*/
public boolean addInfo(Map<String, String> params, String id, String json) {
String companyId = params.get("companyId") + "";
String invoiceNo = randomService.randomUtils2(FINALCMD.INVOICE_NO, DateUtil.getDays(), companyId);
params.put("invoiceNo", invoiceNo);
if (dao.counts(InvoiceInfo.class.getName() + ".findCode", params) > 0) {
invoiceNo = randomService.randomUtils2(FINALCMD.INVOICE_NO, DateUtil.getDays(), companyId);
params.put("invoiceNo", invoiceNo);
}
//添加主表
if (dao.add_obj(InvoiceInfo.class.getName() + id, params)) {
List lists = new ArrayList();
List goodsList = new ArrayList();
List<Map<String, Object>> list = ListOrMapForJson.getlistForJson(json);
for (Map map : list) {
map.put("invoiceId", params.get("id") + "");
map.put("id", IdUtil.simpleUUID());
map.put("createTime", DateUtil.getTime());
lists.add(map);
// 引用
Map tMap = new HashMap();
tMap.put("id", IdUtil.simpleUUID());
tMap.put("archivesId", params.get("id") + "");
tMap.put("quoteId", map.get("goodsId") + "");
goodsList.add(tMap);
}
if (dao.add_obj(InvoiceDetail.class.getName() + ".addCrmInvoiceDetails", lists)) {
// 添加对商品的引用
dao.add_obj(GoodsInfo.class.getName() + ".addQuotes", goodsList);
return true;
}
}
return false;
}
/**
* 发货单修改
*
* @author lyb
* @date 20210526
*/
public boolean updateInfo(Map<String, String> params, String id, String json) {
if (dao.update(InvoiceInfo.class.getName() + id, params)) {
Map<String, Object> info = new HashMap<>();
String invoiceId = params.get("id") + "";
info.put("invoiceId", invoiceId);
dao.delete(InvoiceDetail.class.getName() + ".deleteCrmInvoiceDetailById", info);
List lists = new ArrayList();
List goodsList = new ArrayList();
List<Map<String, Object>> list = ListOrMapForJson.getlistForJson(json);
for (Map map : list) {
map.put("invoiceId", invoiceId);
map.put("id", IdUtil.simpleUUID());
map.put("createTime", DateUtil.getTime());
lists.add(map);
// 引用
Map tMap = new HashMap();
tMap.put("id", IdUtil.simpleUUID());
tMap.put("archivesId", invoiceId);
tMap.put("quoteId", map.get("goodsId") + "");
goodsList.add(tMap);
}
if (dao.add_obj(InvoiceDetail.class.getName() + ".addCrmInvoiceDetails", lists)) {
// 删除商品的引用
dao.delete(GoodsInfo.class.getName() + ".deleteQuoteById", invoiceId);
// 添加对商品的引用
dao.add_obj(GoodsInfo.class.getName() + ".addQuotes", goodsList);
return true;
}
}
return false;
}
/**
* 通用修改
*

View File

@ -175,7 +175,7 @@ public class ApplyClientInfoService {
// 建档人id
applyContact.setCreateUserId(applyClientInfo.getCreateUserId());
// 建档人名称
applyContact.setCreateUser(params.get("id") + "");
applyContact.setCreateUser(params.get("realName") + "");
// 建档时间
applyContact.setCreateTime(DateUtil.getTime());
// 公司组织id

View File

@ -427,6 +427,7 @@ public class DistributorInfo implements Serializable {
/**
* 0待认证1已认证
*/
@Excel(name = "认证状态", width = 15, orderNum = "15", replace = {"待认证_0", "已认证_1"})
private String isVerify;
/**

View File

@ -97,6 +97,8 @@ public class OrderCronService {
goodsMap1.put("createTime", createTime);
}
if (orderUeightService.addOrderDetail(goodsList1)) {
// 因为U8的id是存到100和4002个数据库中的可能会重复因此视图中加了字符便于区分所以这里需要获取U8的原始id回写U8
info.put("id", getBeforeDash(orderId));
// 回写U8销售出库单的状态
if (FINALCMD.KESAI.equals(companyId)) {
orderUeightService.update(".updateOrderInfo", info);
@ -137,4 +139,11 @@ public class OrderCronService {
}
}
public String getBeforeDash(String input) {
if (input == null || !input.contains("-")) {
return input;
}
return input.split("-")[0];
}
}