The following issues were found
litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/task/GrouponRuleExpiredTask.java
21 issues
Line: 27
@Override
public void run() {
logger.info("系统开始处理延时任务---团购规则过期---" + this.grouponRuleId);
LitemallOrderService orderService = BeanUtil.getBean(LitemallOrderService.class);
LitemallGrouponService grouponService = BeanUtil.getBean(LitemallGrouponService.class);
LitemallGrouponRulesService grouponRulesService = BeanUtil.getBean(LitemallGrouponRulesService.class);
Reported by PMD.
Line: 66
}
}
}
logger.info("系统结束处理延时任务---团购规则过期---" + this.grouponRuleId);
}
}
Reported by PMD.
Line: 17
import java.util.List;
public class GrouponRuleExpiredTask extends Task {
private final Log logger = LogFactory.getLog(GrouponRuleExpiredTask.class);
private int grouponRuleId = -1;
public GrouponRuleExpiredTask(Integer grouponRuleId, long delayInMilliseconds){
super("GrouponRuleExpiredTask-" + grouponRuleId, delayInMilliseconds);
this.grouponRuleId = grouponRuleId;
Reported by PMD.
Line: 17
import java.util.List;
public class GrouponRuleExpiredTask extends Task {
private final Log logger = LogFactory.getLog(GrouponRuleExpiredTask.class);
private int grouponRuleId = -1;
public GrouponRuleExpiredTask(Integer grouponRuleId, long delayInMilliseconds){
super("GrouponRuleExpiredTask-" + grouponRuleId, delayInMilliseconds);
this.grouponRuleId = grouponRuleId;
Reported by PMD.
Line: 18
public class GrouponRuleExpiredTask extends Task {
private final Log logger = LogFactory.getLog(GrouponRuleExpiredTask.class);
private int grouponRuleId = -1;
public GrouponRuleExpiredTask(Integer grouponRuleId, long delayInMilliseconds){
super("GrouponRuleExpiredTask-" + grouponRuleId, delayInMilliseconds);
this.grouponRuleId = grouponRuleId;
}
Reported by PMD.
Line: 18
public class GrouponRuleExpiredTask extends Task {
private final Log logger = LogFactory.getLog(GrouponRuleExpiredTask.class);
private int grouponRuleId = -1;
public GrouponRuleExpiredTask(Integer grouponRuleId, long delayInMilliseconds){
super("GrouponRuleExpiredTask-" + grouponRuleId, delayInMilliseconds);
this.grouponRuleId = grouponRuleId;
}
Reported by PMD.
Line: 18
public class GrouponRuleExpiredTask extends Task {
private final Log logger = LogFactory.getLog(GrouponRuleExpiredTask.class);
private int grouponRuleId = -1;
public GrouponRuleExpiredTask(Integer grouponRuleId, long delayInMilliseconds){
super("GrouponRuleExpiredTask-" + grouponRuleId, delayInMilliseconds);
this.grouponRuleId = grouponRuleId;
}
Reported by PMD.
Line: 33
LitemallGrouponService grouponService = BeanUtil.getBean(LitemallGrouponService.class);
LitemallGrouponRulesService grouponRulesService = BeanUtil.getBean(LitemallGrouponRulesService.class);
LitemallGrouponRules grouponRules = grouponRulesService.findById(grouponRuleId);
if(grouponRules == null){
return;
}
if(!grouponRules.getStatus().equals(GrouponConstant.RULE_STATUS_ON)){
return;
Reported by PMD.
Line: 37
if(grouponRules == null){
return;
}
if(!grouponRules.getStatus().equals(GrouponConstant.RULE_STATUS_ON)){
return;
}
// 团购活动取消
grouponRules.setStatus(GrouponConstant.RULE_STATUS_DOWN_EXPIRE);
Reported by PMD.
Line: 37
if(grouponRules == null){
return;
}
if(!grouponRules.getStatus().equals(GrouponConstant.RULE_STATUS_ON)){
return;
}
// 团购活动取消
grouponRules.setStatus(GrouponConstant.RULE_STATUS_DOWN_EXPIRE);
Reported by PMD.
litemall-core/src/main/java/org/linlinjava/litemall/core/notify/config/NotifyAutoConfiguration.java
21 issues
Line: 19
@EnableConfigurationProperties(NotifyProperties.class)
public class NotifyAutoConfiguration {
private final NotifyProperties properties;
public NotifyAutoConfiguration(NotifyProperties properties) {
this.properties = properties;
}
Reported by PMD.
Line: 30
NotifyService notifyService = new NotifyService();
NotifyProperties.Mail mailConfig = properties.getMail();
if (mailConfig.isEnable()) {
notifyService.setMailSender(mailSender());
notifyService.setSendFrom(mailConfig.getSendfrom());
notifyService.setSendTo(mailConfig.getSendto());
}
Reported by PMD.
Line: 37
}
NotifyProperties.Sms smsConfig = properties.getSms();
if (smsConfig.isEnable()) {
if(smsConfig.getActive().equals("tencent")) {
notifyService.setSmsSender(tencentSmsSender());
}
else if(smsConfig.getActive().equals("aliyun")) {
notifyService.setSmsSender(aliyunSmsSender());
Reported by PMD.
Line: 38
NotifyProperties.Sms smsConfig = properties.getSms();
if (smsConfig.isEnable()) {
if(smsConfig.getActive().equals("tencent")) {
notifyService.setSmsSender(tencentSmsSender());
}
else if(smsConfig.getActive().equals("aliyun")) {
notifyService.setSmsSender(aliyunSmsSender());
}
Reported by PMD.
Line: 38
NotifyProperties.Sms smsConfig = properties.getSms();
if (smsConfig.isEnable()) {
if(smsConfig.getActive().equals("tencent")) {
notifyService.setSmsSender(tencentSmsSender());
}
else if(smsConfig.getActive().equals("aliyun")) {
notifyService.setSmsSender(aliyunSmsSender());
}
Reported by PMD.
Line: 41
if(smsConfig.getActive().equals("tencent")) {
notifyService.setSmsSender(tencentSmsSender());
}
else if(smsConfig.getActive().equals("aliyun")) {
notifyService.setSmsSender(aliyunSmsSender());
}
notifyService.setSmsTemplate(smsConfig.getTemplate());
}
Reported by PMD.
Line: 41
if(smsConfig.getActive().equals("tencent")) {
notifyService.setSmsSender(tencentSmsSender());
}
else if(smsConfig.getActive().equals("aliyun")) {
notifyService.setSmsSender(aliyunSmsSender());
}
notifyService.setSmsTemplate(smsConfig.getTemplate());
}
Reported by PMD.
Line: 54
public JavaMailSender mailSender() {
NotifyProperties.Mail mailConfig = properties.getMail();
JavaMailSenderImpl mailSender = new JavaMailSenderImpl();
mailSender.setHost(mailConfig.getHost());
mailSender.setUsername(mailConfig.getUsername());
mailSender.setPassword(mailConfig.getPassword());
mailSender.setPort(mailConfig.getPort());
Properties properties = new Properties();
properties.put("mail.smtp.auth",true);
Reported by PMD.
Line: 55
NotifyProperties.Mail mailConfig = properties.getMail();
JavaMailSenderImpl mailSender = new JavaMailSenderImpl();
mailSender.setHost(mailConfig.getHost());
mailSender.setUsername(mailConfig.getUsername());
mailSender.setPassword(mailConfig.getPassword());
mailSender.setPort(mailConfig.getPort());
Properties properties = new Properties();
properties.put("mail.smtp.auth",true);
properties.put("mail.smtp.timeout",5000);
Reported by PMD.
Line: 56
JavaMailSenderImpl mailSender = new JavaMailSenderImpl();
mailSender.setHost(mailConfig.getHost());
mailSender.setUsername(mailConfig.getUsername());
mailSender.setPassword(mailConfig.getPassword());
mailSender.setPort(mailConfig.getPort());
Properties properties = new Properties();
properties.put("mail.smtp.auth",true);
properties.put("mail.smtp.timeout",5000);
properties.put("mail.smtp.starttls.enable",true);
Reported by PMD.
litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/web/AdminCategoryController.java
20 issues
Line: 26
@RequestMapping("/admin/category")
@Validated
public class AdminCategoryController {
private final Log logger = LogFactory.getLog(AdminCategoryController.class);
@Autowired
private LitemallCategoryService categoryService;
@RequiresPermissions("admin:category:list")
Reported by PMD.
Line: 26
@RequestMapping("/admin/category")
@Validated
public class AdminCategoryController {
private final Log logger = LogFactory.getLog(AdminCategoryController.class);
@Autowired
private LitemallCategoryService categoryService;
@RequiresPermissions("admin:category:list")
Reported by PMD.
Line: 29
private final Log logger = LogFactory.getLog(AdminCategoryController.class);
@Autowired
private LitemallCategoryService categoryService;
@RequiresPermissions("admin:category:list")
@RequiresPermissionsDesc(menu = {"商场管理", "类目管理"}, button = "查询")
@GetMapping("/list")
public Object list() {
Reported by PMD.
Line: 32
private LitemallCategoryService categoryService;
@RequiresPermissions("admin:category:list")
@RequiresPermissionsDesc(menu = {"商场管理", "类目管理"}, button = "查询")
@GetMapping("/list")
public Object list() {
List<CategoryVo> categoryVoList = new ArrayList<>();
List<LitemallCategory> categoryList = categoryService.queryByPid(0);
Reported by PMD.
Line: 32
private LitemallCategoryService categoryService;
@RequiresPermissions("admin:category:list")
@RequiresPermissionsDesc(menu = {"商场管理", "类目管理"}, button = "查询")
@GetMapping("/list")
public Object list() {
List<CategoryVo> categoryVoList = new ArrayList<>();
List<LitemallCategory> categoryList = categoryService.queryByPid(0);
Reported by PMD.
Line: 39
List<LitemallCategory> categoryList = categoryService.queryByPid(0);
for (LitemallCategory category : categoryList) {
CategoryVo categoryVO = new CategoryVo();
categoryVO.setId(category.getId());
categoryVO.setDesc(category.getDesc());
categoryVO.setIconUrl(category.getIconUrl());
categoryVO.setPicUrl(category.getPicUrl());
categoryVO.setKeywords(category.getKeywords());
Reported by PMD.
Line: 48
categoryVO.setName(category.getName());
categoryVO.setLevel(category.getLevel());
List<CategoryVo> children = new ArrayList<>();
List<LitemallCategory> subCategoryList = categoryService.queryByPid(category.getId());
for (LitemallCategory subCategory : subCategoryList) {
CategoryVo subCategoryVo = new CategoryVo();
subCategoryVo.setId(subCategory.getId());
subCategoryVo.setDesc(subCategory.getDesc());
Reported by PMD.
Line: 51
List<CategoryVo> children = new ArrayList<>();
List<LitemallCategory> subCategoryList = categoryService.queryByPid(category.getId());
for (LitemallCategory subCategory : subCategoryList) {
CategoryVo subCategoryVo = new CategoryVo();
subCategoryVo.setId(subCategory.getId());
subCategoryVo.setDesc(subCategory.getDesc());
subCategoryVo.setIconUrl(subCategory.getIconUrl());
subCategoryVo.setPicUrl(subCategory.getPicUrl());
subCategoryVo.setKeywords(subCategory.getKeywords());
Reported by PMD.
Line: 80
if (StringUtils.isEmpty(level)) {
return ResponseUtil.badArgument();
}
if (!level.equals("L1") && !level.equals("L2")) {
return ResponseUtil.badArgumentValue();
}
Integer pid = category.getPid();
if (level.equals("L2") && (pid == null)) {
Reported by PMD.
Line: 80
if (StringUtils.isEmpty(level)) {
return ResponseUtil.badArgument();
}
if (!level.equals("L1") && !level.equals("L2")) {
return ResponseUtil.badArgumentValue();
}
Integer pid = category.getPid();
if (level.equals("L2") && (pid == null)) {
Reported by PMD.
litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/web/AdminRoleController.java
20 issues
Line: 37
@RequestMapping("/admin/role")
@Validated
public class AdminRoleController {
private final Log logger = LogFactory.getLog(AdminRoleController.class);
@Autowired
private LitemallRoleService roleService;
@Autowired
private LitemallPermissionService permissionService;
Reported by PMD.
Line: 37
@RequestMapping("/admin/role")
@Validated
public class AdminRoleController {
private final Log logger = LogFactory.getLog(AdminRoleController.class);
@Autowired
private LitemallRoleService roleService;
@Autowired
private LitemallPermissionService permissionService;
Reported by PMD.
Line: 40
private final Log logger = LogFactory.getLog(AdminRoleController.class);
@Autowired
private LitemallRoleService roleService;
@Autowired
private LitemallPermissionService permissionService;
@Autowired
private LitemallAdminService adminService;
Reported by PMD.
Line: 42
@Autowired
private LitemallRoleService roleService;
@Autowired
private LitemallPermissionService permissionService;
@Autowired
private LitemallAdminService adminService;
@RequiresPermissions("admin:role:list")
@RequiresPermissionsDesc(menu = {"系统管理", "角色管理"}, button = "角色查询")
Reported by PMD.
Line: 44
@Autowired
private LitemallPermissionService permissionService;
@Autowired
private LitemallAdminService adminService;
@RequiresPermissions("admin:role:list")
@RequiresPermissionsDesc(menu = {"系统管理", "角色管理"}, button = "角色查询")
@GetMapping("/list")
public Object list(String name,
Reported by PMD.
Line: 47
private LitemallAdminService adminService;
@RequiresPermissions("admin:role:list")
@RequiresPermissionsDesc(menu = {"系统管理", "角色管理"}, button = "角色查询")
@GetMapping("/list")
public Object list(String name,
@RequestParam(defaultValue = "1") Integer page,
@RequestParam(defaultValue = "10") Integer limit,
@Sort @RequestParam(defaultValue = "add_time") String sort,
Reported by PMD.
Line: 47
private LitemallAdminService adminService;
@RequiresPermissions("admin:role:list")
@RequiresPermissionsDesc(menu = {"系统管理", "角色管理"}, button = "角色查询")
@GetMapping("/list")
public Object list(String name,
@RequestParam(defaultValue = "1") Integer page,
@RequestParam(defaultValue = "10") Integer limit,
@Sort @RequestParam(defaultValue = "add_time") String sort,
Reported by PMD.
Line: 62
public Object options() {
List<LitemallRole> roleList = roleService.queryAll();
List<Map<String, Object>> options = new ArrayList<>(roleList.size());
for (LitemallRole role : roleList) {
Map<String, Object> option = new HashMap<>(2);
option.put("value", role.getId());
option.put("label", role.getName());
options.add(option);
Reported by PMD.
Line: 64
List<Map<String, Object>> options = new ArrayList<>(roleList.size());
for (LitemallRole role : roleList) {
Map<String, Object> option = new HashMap<>(2);
option.put("value", role.getId());
option.put("label", role.getName());
options.add(option);
}
Reported by PMD.
Line: 148
@Autowired
private ApplicationContext context;
private List<PermVo> systemPermissions = null;
private Set<String> systemPermissionsString = null;
private List<PermVo> getSystemPermissions() {
final String basicPackage = "org.linlinjava.litemall.admin";
Reported by PMD.
litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/web/AdminGrouponController.java
20 issues
Line: 37
@RequestMapping("/admin/groupon")
@Validated
public class AdminGrouponController {
private final Log logger = LogFactory.getLog(AdminGrouponController.class);
@Autowired
private LitemallGrouponRulesService rulesService;
@Autowired
private LitemallGoodsService goodsService;
Reported by PMD.
Line: 37
@RequestMapping("/admin/groupon")
@Validated
public class AdminGrouponController {
private final Log logger = LogFactory.getLog(AdminGrouponController.class);
@Autowired
private LitemallGrouponRulesService rulesService;
@Autowired
private LitemallGoodsService goodsService;
Reported by PMD.
Line: 40
private final Log logger = LogFactory.getLog(AdminGrouponController.class);
@Autowired
private LitemallGrouponRulesService rulesService;
@Autowired
private LitemallGoodsService goodsService;
@Autowired
private LitemallGrouponService grouponService;
@Autowired
Reported by PMD.
Line: 42
@Autowired
private LitemallGrouponRulesService rulesService;
@Autowired
private LitemallGoodsService goodsService;
@Autowired
private LitemallGrouponService grouponService;
@Autowired
private TaskService taskService;
Reported by PMD.
Line: 44
@Autowired
private LitemallGoodsService goodsService;
@Autowired
private LitemallGrouponService grouponService;
@Autowired
private TaskService taskService;
@RequiresPermissions("admin:groupon:read")
@RequiresPermissionsDesc(menu = {"推广管理", "团购管理"}, button = "详情")
Reported by PMD.
Line: 46
@Autowired
private LitemallGrouponService grouponService;
@Autowired
private TaskService taskService;
@RequiresPermissions("admin:groupon:read")
@RequiresPermissionsDesc(menu = {"推广管理", "团购管理"}, button = "详情")
@GetMapping("/listRecord")
public Object listRecord(String grouponRuleId,
Reported by PMD.
Line: 49
private TaskService taskService;
@RequiresPermissions("admin:groupon:read")
@RequiresPermissionsDesc(menu = {"推广管理", "团购管理"}, button = "详情")
@GetMapping("/listRecord")
public Object listRecord(String grouponRuleId,
@RequestParam(defaultValue = "1") Integer page,
@RequestParam(defaultValue = "10") Integer limit,
@Sort @RequestParam(defaultValue = "add_time") String sort,
Reported by PMD.
Line: 49
private TaskService taskService;
@RequiresPermissions("admin:groupon:read")
@RequiresPermissionsDesc(menu = {"推广管理", "团购管理"}, button = "详情")
@GetMapping("/listRecord")
public Object listRecord(String grouponRuleId,
@RequestParam(defaultValue = "1") Integer page,
@RequestParam(defaultValue = "10") Integer limit,
@Sort @RequestParam(defaultValue = "add_time") String sort,
Reported by PMD.
Line: 61
List<Map<String, Object>> groupons = new ArrayList<>();
for (LitemallGroupon groupon : grouponList) {
try {
Map<String, Object> recordData = new HashMap<>();
List<LitemallGroupon> subGrouponList = grouponService.queryJoinRecord(groupon.getId());
LitemallGrouponRules rules = rulesService.findById(groupon.getRulesId());
LitemallGoods goods = goodsService.findById(rules.getGoodsId());
recordData.put("groupon", groupon);
Reported by PMD.
Line: 64
Map<String, Object> recordData = new HashMap<>();
List<LitemallGroupon> subGrouponList = grouponService.queryJoinRecord(groupon.getId());
LitemallGrouponRules rules = rulesService.findById(groupon.getRulesId());
LitemallGoods goods = goodsService.findById(rules.getGoodsId());
recordData.put("groupon", groupon);
recordData.put("subGroupons", subGrouponList);
recordData.put("rules", rules);
recordData.put("goods", goods);
Reported by PMD.
litemall-db/src/main/java/org/linlinjava/litemall/db/service/LitemallCategoryService.java
20 issues
Line: 15
import java.util.List;
@Service
public class LitemallCategoryService {
@Resource
private LitemallCategoryMapper categoryMapper;
private LitemallCategory.Column[] CHANNEL = {LitemallCategory.Column.id, LitemallCategory.Column.name, LitemallCategory.Column.iconUrl};
public List<LitemallCategory> queryL1WithoutRecommend(int offset, int limit) {
Reported by PMD.
Line: 17
@Service
public class LitemallCategoryService {
@Resource
private LitemallCategoryMapper categoryMapper;
private LitemallCategory.Column[] CHANNEL = {LitemallCategory.Column.id, LitemallCategory.Column.name, LitemallCategory.Column.iconUrl};
public List<LitemallCategory> queryL1WithoutRecommend(int offset, int limit) {
LitemallCategoryExample example = new LitemallCategoryExample();
example.or().andLevelEqualTo("L1").andNameNotEqualTo("推荐").andDeletedEqualTo(false);
Reported by PMD.
Line: 18
public class LitemallCategoryService {
@Resource
private LitemallCategoryMapper categoryMapper;
private LitemallCategory.Column[] CHANNEL = {LitemallCategory.Column.id, LitemallCategory.Column.name, LitemallCategory.Column.iconUrl};
public List<LitemallCategory> queryL1WithoutRecommend(int offset, int limit) {
LitemallCategoryExample example = new LitemallCategoryExample();
example.or().andLevelEqualTo("L1").andNameNotEqualTo("推荐").andDeletedEqualTo(false);
PageHelper.startPage(offset, limit);
Reported by PMD.
Line: 18
public class LitemallCategoryService {
@Resource
private LitemallCategoryMapper categoryMapper;
private LitemallCategory.Column[] CHANNEL = {LitemallCategory.Column.id, LitemallCategory.Column.name, LitemallCategory.Column.iconUrl};
public List<LitemallCategory> queryL1WithoutRecommend(int offset, int limit) {
LitemallCategoryExample example = new LitemallCategoryExample();
example.or().andLevelEqualTo("L1").andNameNotEqualTo("推荐").andDeletedEqualTo(false);
PageHelper.startPage(offset, limit);
Reported by PMD.
Line: 22
public List<LitemallCategory> queryL1WithoutRecommend(int offset, int limit) {
LitemallCategoryExample example = new LitemallCategoryExample();
example.or().andLevelEqualTo("L1").andNameNotEqualTo("推荐").andDeletedEqualTo(false);
PageHelper.startPage(offset, limit);
return categoryMapper.selectByExample(example);
}
public List<LitemallCategory> queryL1(int offset, int limit) {
Reported by PMD.
Line: 22
public List<LitemallCategory> queryL1WithoutRecommend(int offset, int limit) {
LitemallCategoryExample example = new LitemallCategoryExample();
example.or().andLevelEqualTo("L1").andNameNotEqualTo("推荐").andDeletedEqualTo(false);
PageHelper.startPage(offset, limit);
return categoryMapper.selectByExample(example);
}
public List<LitemallCategory> queryL1(int offset, int limit) {
Reported by PMD.
Line: 22
public List<LitemallCategory> queryL1WithoutRecommend(int offset, int limit) {
LitemallCategoryExample example = new LitemallCategoryExample();
example.or().andLevelEqualTo("L1").andNameNotEqualTo("推荐").andDeletedEqualTo(false);
PageHelper.startPage(offset, limit);
return categoryMapper.selectByExample(example);
}
public List<LitemallCategory> queryL1(int offset, int limit) {
Reported by PMD.
Line: 29
public List<LitemallCategory> queryL1(int offset, int limit) {
LitemallCategoryExample example = new LitemallCategoryExample();
example.or().andLevelEqualTo("L1").andDeletedEqualTo(false);
PageHelper.startPage(offset, limit);
return categoryMapper.selectByExample(example);
}
public List<LitemallCategory> queryL1() {
Reported by PMD.
Line: 29
public List<LitemallCategory> queryL1(int offset, int limit) {
LitemallCategoryExample example = new LitemallCategoryExample();
example.or().andLevelEqualTo("L1").andDeletedEqualTo(false);
PageHelper.startPage(offset, limit);
return categoryMapper.selectByExample(example);
}
public List<LitemallCategory> queryL1() {
Reported by PMD.
Line: 36
public List<LitemallCategory> queryL1() {
LitemallCategoryExample example = new LitemallCategoryExample();
example.or().andLevelEqualTo("L1").andDeletedEqualTo(false);
return categoryMapper.selectByExample(example);
}
public List<LitemallCategory> queryByPid(Integer pid) {
LitemallCategoryExample example = new LitemallCategoryExample();
Reported by PMD.
litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/task/OrderUnpaidTask.java
19 issues
Line: 54
order.setOrderStatus(OrderUtil.STATUS_AUTO_CANCEL);
order.setEndTime(LocalDateTime.now());
if (orderService.updateWithOptimisticLocker(order) == 0) {
throw new RuntimeException("更新数据已失效");
}
// 商品货品数量增加
Integer orderId = order.getId();
List<LitemallOrderGoods> orderGoodsList = orderGoodsService.queryByOid(orderId);
Reported by PMD.
Line: 64
Integer productId = orderGoods.getProductId();
Short number = orderGoods.getNumber();
if (productService.addStock(productId, number) == 0) {
throw new RuntimeException("商品货品库存增加失败");
}
}
//返还优惠券
wxOrderService.releaseCoupon(orderId);
Reported by PMD.
Line: 35
@Override
public void run() {
logger.info("系统开始处理延时任务---订单超时未付款---" + this.orderId);
LitemallOrderService orderService = BeanUtil.getBean(LitemallOrderService.class);
LitemallOrderGoodsService orderGoodsService = BeanUtil.getBean(LitemallOrderGoodsService.class);
LitemallGoodsProductService productService = BeanUtil.getBean(LitemallGoodsProductService.class);
WxOrderService wxOrderService = BeanUtil.getBean(WxOrderService.class);
Reported by PMD.
Line: 71
//返还优惠券
wxOrderService.releaseCoupon(orderId);
logger.info("系统结束处理延时任务---订单超时未付款---" + this.orderId);
}
}
Reported by PMD.
Line: 20
import java.util.List;
public class OrderUnpaidTask extends Task {
private final Log logger = LogFactory.getLog(OrderUnpaidTask.class);
private int orderId = -1;
public OrderUnpaidTask(Integer orderId, long delayInMilliseconds){
super("OrderUnpaidTask-" + orderId, delayInMilliseconds);
this.orderId = orderId;
Reported by PMD.
Line: 20
import java.util.List;
public class OrderUnpaidTask extends Task {
private final Log logger = LogFactory.getLog(OrderUnpaidTask.class);
private int orderId = -1;
public OrderUnpaidTask(Integer orderId, long delayInMilliseconds){
super("OrderUnpaidTask-" + orderId, delayInMilliseconds);
this.orderId = orderId;
Reported by PMD.
Line: 21
public class OrderUnpaidTask extends Task {
private final Log logger = LogFactory.getLog(OrderUnpaidTask.class);
private int orderId = -1;
public OrderUnpaidTask(Integer orderId, long delayInMilliseconds){
super("OrderUnpaidTask-" + orderId, delayInMilliseconds);
this.orderId = orderId;
}
Reported by PMD.
Line: 21
public class OrderUnpaidTask extends Task {
private final Log logger = LogFactory.getLog(OrderUnpaidTask.class);
private int orderId = -1;
public OrderUnpaidTask(Integer orderId, long delayInMilliseconds){
super("OrderUnpaidTask-" + orderId, delayInMilliseconds);
this.orderId = orderId;
}
Reported by PMD.
Line: 21
public class OrderUnpaidTask extends Task {
private final Log logger = LogFactory.getLog(OrderUnpaidTask.class);
private int orderId = -1;
public OrderUnpaidTask(Integer orderId, long delayInMilliseconds){
super("OrderUnpaidTask-" + orderId, delayInMilliseconds);
this.orderId = orderId;
}
Reported by PMD.
Line: 42
LitemallGoodsProductService productService = BeanUtil.getBean(LitemallGoodsProductService.class);
WxOrderService wxOrderService = BeanUtil.getBean(WxOrderService.class);
LitemallOrder order = orderService.findById(this.orderId);
if(order == null){
return;
}
if(!OrderUtil.isCreateStatus(order)){
return;
Reported by PMD.
litemall-db/src/main/java/org/linlinjava/litemall/db/service/LitemallGrouponRulesService.java
19 issues
Line: 23
@Service
public class LitemallGrouponRulesService {
@Resource
private LitemallGrouponRulesMapper mapper;
@Resource
private LitemallGoodsMapper goodsMapper;
private LitemallGoods.Column[] goodsColumns = new LitemallGoods.Column[]{LitemallGoods.Column.id, LitemallGoods.Column.name, LitemallGoods.Column.brief, LitemallGoods.Column.picUrl, LitemallGoods.Column.counterPrice, LitemallGoods.Column.retailPrice};
public int createRules(LitemallGrouponRules rules) {
Reported by PMD.
Line: 25
@Resource
private LitemallGrouponRulesMapper mapper;
@Resource
private LitemallGoodsMapper goodsMapper;
private LitemallGoods.Column[] goodsColumns = new LitemallGoods.Column[]{LitemallGoods.Column.id, LitemallGoods.Column.name, LitemallGoods.Column.brief, LitemallGoods.Column.picUrl, LitemallGoods.Column.counterPrice, LitemallGoods.Column.retailPrice};
public int createRules(LitemallGrouponRules rules) {
rules.setAddTime(LocalDateTime.now());
rules.setUpdateTime(LocalDateTime.now());
Reported by PMD.
Line: 26
private LitemallGrouponRulesMapper mapper;
@Resource
private LitemallGoodsMapper goodsMapper;
private LitemallGoods.Column[] goodsColumns = new LitemallGoods.Column[]{LitemallGoods.Column.id, LitemallGoods.Column.name, LitemallGoods.Column.brief, LitemallGoods.Column.picUrl, LitemallGoods.Column.counterPrice, LitemallGoods.Column.retailPrice};
public int createRules(LitemallGrouponRules rules) {
rules.setAddTime(LocalDateTime.now());
rules.setUpdateTime(LocalDateTime.now());
return mapper.insertSelective(rules);
Reported by PMD.
Line: 26
private LitemallGrouponRulesMapper mapper;
@Resource
private LitemallGoodsMapper goodsMapper;
private LitemallGoods.Column[] goodsColumns = new LitemallGoods.Column[]{LitemallGoods.Column.id, LitemallGoods.Column.name, LitemallGoods.Column.brief, LitemallGoods.Column.picUrl, LitemallGoods.Column.counterPrice, LitemallGoods.Column.retailPrice};
public int createRules(LitemallGrouponRules rules) {
rules.setAddTime(LocalDateTime.now());
rules.setUpdateTime(LocalDateTime.now());
return mapper.insertSelective(rules);
Reported by PMD.
Line: 52
*/
public List<LitemallGrouponRules> queryByGoodsId(Integer goodsId) {
LitemallGrouponRulesExample example = new LitemallGrouponRulesExample();
example.or().andGoodsIdEqualTo(goodsId).andStatusEqualTo(GrouponConstant.RULE_STATUS_ON).andDeletedEqualTo(false);
return mapper.selectByExample(example);
}
public int countByGoodsId(Integer goodsId) {
LitemallGrouponRulesExample example = new LitemallGrouponRulesExample();
Reported by PMD.
Line: 52
*/
public List<LitemallGrouponRules> queryByGoodsId(Integer goodsId) {
LitemallGrouponRulesExample example = new LitemallGrouponRulesExample();
example.or().andGoodsIdEqualTo(goodsId).andStatusEqualTo(GrouponConstant.RULE_STATUS_ON).andDeletedEqualTo(false);
return mapper.selectByExample(example);
}
public int countByGoodsId(Integer goodsId) {
LitemallGrouponRulesExample example = new LitemallGrouponRulesExample();
Reported by PMD.
Line: 52
*/
public List<LitemallGrouponRules> queryByGoodsId(Integer goodsId) {
LitemallGrouponRulesExample example = new LitemallGrouponRulesExample();
example.or().andGoodsIdEqualTo(goodsId).andStatusEqualTo(GrouponConstant.RULE_STATUS_ON).andDeletedEqualTo(false);
return mapper.selectByExample(example);
}
public int countByGoodsId(Integer goodsId) {
LitemallGrouponRulesExample example = new LitemallGrouponRulesExample();
Reported by PMD.
Line: 58
public int countByGoodsId(Integer goodsId) {
LitemallGrouponRulesExample example = new LitemallGrouponRulesExample();
example.or().andGoodsIdEqualTo(goodsId).andStatusEqualTo(GrouponConstant.RULE_STATUS_ON).andDeletedEqualTo(false);
return (int)mapper.countByExample(example);
}
public List<LitemallGrouponRules> queryByStatus(Short status) {
LitemallGrouponRulesExample example = new LitemallGrouponRulesExample();
Reported by PMD.
Line: 58
public int countByGoodsId(Integer goodsId) {
LitemallGrouponRulesExample example = new LitemallGrouponRulesExample();
example.or().andGoodsIdEqualTo(goodsId).andStatusEqualTo(GrouponConstant.RULE_STATUS_ON).andDeletedEqualTo(false);
return (int)mapper.countByExample(example);
}
public List<LitemallGrouponRules> queryByStatus(Short status) {
LitemallGrouponRulesExample example = new LitemallGrouponRulesExample();
Reported by PMD.
Line: 58
public int countByGoodsId(Integer goodsId) {
LitemallGrouponRulesExample example = new LitemallGrouponRulesExample();
example.or().andGoodsIdEqualTo(goodsId).andStatusEqualTo(GrouponConstant.RULE_STATUS_ON).andDeletedEqualTo(false);
return (int)mapper.countByExample(example);
}
public List<LitemallGrouponRules> queryByStatus(Short status) {
LitemallGrouponRulesExample example = new LitemallGrouponRulesExample();
Reported by PMD.
litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/web/AdminRegionController.java
19 issues
Line: 25
@RequestMapping("/admin/region")
@Validated
public class AdminRegionController {
private final Log logger = LogFactory.getLog(AdminRegionController.class);
@Autowired
private LitemallRegionService regionService;
@GetMapping("/clist")
Reported by PMD.
Line: 25
@RequestMapping("/admin/region")
@Validated
public class AdminRegionController {
private final Log logger = LogFactory.getLog(AdminRegionController.class);
@Autowired
private LitemallRegionService regionService;
@GetMapping("/clist")
Reported by PMD.
Line: 28
private final Log logger = LogFactory.getLog(AdminRegionController.class);
@Autowired
private LitemallRegionService regionService;
@GetMapping("/clist")
public Object clist(@NotNull Integer id) {
List<LitemallRegion> regionList = regionService.queryByPid(id);
return ResponseUtil.okList(regionList);
Reported by PMD.
Line: 41
List<RegionVo> regionVoList = new ArrayList<>();
List<LitemallRegion> litemallRegions = regionService.getAll();
Map<Byte, List<LitemallRegion>> collect = litemallRegions.stream().collect(Collectors.groupingBy(LitemallRegion::getType));
byte provinceType = 1;
List<LitemallRegion> provinceList = collect.get(provinceType);
byte cityType = 2;
List<LitemallRegion> city = collect.get(cityType);
Map<Integer, List<LitemallRegion>> cityListMap = city.stream().collect(Collectors.groupingBy(LitemallRegion::getPid));
Reported by PMD.
Line: 41
List<RegionVo> regionVoList = new ArrayList<>();
List<LitemallRegion> litemallRegions = regionService.getAll();
Map<Byte, List<LitemallRegion>> collect = litemallRegions.stream().collect(Collectors.groupingBy(LitemallRegion::getType));
byte provinceType = 1;
List<LitemallRegion> provinceList = collect.get(provinceType);
byte cityType = 2;
List<LitemallRegion> city = collect.get(cityType);
Map<Integer, List<LitemallRegion>> cityListMap = city.stream().collect(Collectors.groupingBy(LitemallRegion::getPid));
Reported by PMD.
Line: 43
List<LitemallRegion> litemallRegions = regionService.getAll();
Map<Byte, List<LitemallRegion>> collect = litemallRegions.stream().collect(Collectors.groupingBy(LitemallRegion::getType));
byte provinceType = 1;
List<LitemallRegion> provinceList = collect.get(provinceType);
byte cityType = 2;
List<LitemallRegion> city = collect.get(cityType);
Map<Integer, List<LitemallRegion>> cityListMap = city.stream().collect(Collectors.groupingBy(LitemallRegion::getPid));
byte areaType = 3;
List<LitemallRegion> areas = collect.get(areaType);
Reported by PMD.
Line: 45
byte provinceType = 1;
List<LitemallRegion> provinceList = collect.get(provinceType);
byte cityType = 2;
List<LitemallRegion> city = collect.get(cityType);
Map<Integer, List<LitemallRegion>> cityListMap = city.stream().collect(Collectors.groupingBy(LitemallRegion::getPid));
byte areaType = 3;
List<LitemallRegion> areas = collect.get(areaType);
Map<Integer, List<LitemallRegion>> areaListMap = areas.stream().collect(Collectors.groupingBy(LitemallRegion::getPid));
Reported by PMD.
Line: 46
List<LitemallRegion> provinceList = collect.get(provinceType);
byte cityType = 2;
List<LitemallRegion> city = collect.get(cityType);
Map<Integer, List<LitemallRegion>> cityListMap = city.stream().collect(Collectors.groupingBy(LitemallRegion::getPid));
byte areaType = 3;
List<LitemallRegion> areas = collect.get(areaType);
Map<Integer, List<LitemallRegion>> areaListMap = areas.stream().collect(Collectors.groupingBy(LitemallRegion::getPid));
for (LitemallRegion province : provinceList) {
Reported by PMD.
Line: 46
List<LitemallRegion> provinceList = collect.get(provinceType);
byte cityType = 2;
List<LitemallRegion> city = collect.get(cityType);
Map<Integer, List<LitemallRegion>> cityListMap = city.stream().collect(Collectors.groupingBy(LitemallRegion::getPid));
byte areaType = 3;
List<LitemallRegion> areas = collect.get(areaType);
Map<Integer, List<LitemallRegion>> areaListMap = areas.stream().collect(Collectors.groupingBy(LitemallRegion::getPid));
for (LitemallRegion province : provinceList) {
Reported by PMD.
Line: 48
List<LitemallRegion> city = collect.get(cityType);
Map<Integer, List<LitemallRegion>> cityListMap = city.stream().collect(Collectors.groupingBy(LitemallRegion::getPid));
byte areaType = 3;
List<LitemallRegion> areas = collect.get(areaType);
Map<Integer, List<LitemallRegion>> areaListMap = areas.stream().collect(Collectors.groupingBy(LitemallRegion::getPid));
for (LitemallRegion province : provinceList) {
RegionVo provinceVO = new RegionVo();
provinceVO.setId(province.getId());
Reported by PMD.
litemall-core/src/main/java/org/linlinjava/litemall/core/util/IpUtil.java
19 issues
Line: 13
/**
* IP地址相关工具类
*/
public class IpUtil {
private static final Log logger = LogFactory.getLog(IpUtil.class);
public static String getIpAddr(HttpServletRequest request) {
String ipAddress;
Reported by PMD.
Line: 13
/**
* IP地址相关工具类
*/
public class IpUtil {
private static final Log logger = LogFactory.getLog(IpUtil.class);
public static String getIpAddr(HttpServletRequest request) {
String ipAddress;
Reported by PMD.
Line: 13
/**
* IP地址相关工具类
*/
public class IpUtil {
private static final Log logger = LogFactory.getLog(IpUtil.class);
public static String getIpAddr(HttpServletRequest request) {
String ipAddress;
Reported by PMD.
Line: 15
*/
public class IpUtil {
private static final Log logger = LogFactory.getLog(IpUtil.class);
public static String getIpAddr(HttpServletRequest request) {
String ipAddress;
try {
ipAddress = request.getHeader("x-forwarded-for");
Reported by PMD.
Line: 17
private static final Log logger = LogFactory.getLog(IpUtil.class);
public static String getIpAddr(HttpServletRequest request) {
String ipAddress;
try {
ipAddress = request.getHeader("x-forwarded-for");
if (ipAddress == null || ipAddress.length() == 0 || "unknown".equalsIgnoreCase(ipAddress)) {
ipAddress = request.getHeader("Proxy-Client-IP");
Reported by PMD.
Line: 17
private static final Log logger = LogFactory.getLog(IpUtil.class);
public static String getIpAddr(HttpServletRequest request) {
String ipAddress;
try {
ipAddress = request.getHeader("x-forwarded-for");
if (ipAddress == null || ipAddress.length() == 0 || "unknown".equalsIgnoreCase(ipAddress)) {
ipAddress = request.getHeader("Proxy-Client-IP");
Reported by PMD.
Line: 21
String ipAddress;
try {
ipAddress = request.getHeader("x-forwarded-for");
if (ipAddress == null || ipAddress.length() == 0 || "unknown".equalsIgnoreCase(ipAddress)) {
ipAddress = request.getHeader("Proxy-Client-IP");
}
if (ipAddress == null || ipAddress.length() == 0 || "unknown".equalsIgnoreCase(ipAddress)) {
ipAddress = request.getHeader("WL-Proxy-Client-IP");
}
Reported by PMD.
Line: 24
if (ipAddress == null || ipAddress.length() == 0 || "unknown".equalsIgnoreCase(ipAddress)) {
ipAddress = request.getHeader("Proxy-Client-IP");
}
if (ipAddress == null || ipAddress.length() == 0 || "unknown".equalsIgnoreCase(ipAddress)) {
ipAddress = request.getHeader("WL-Proxy-Client-IP");
}
if (ipAddress == null || ipAddress.length() == 0 || "unknown".equalsIgnoreCase(ipAddress)) {
ipAddress = request.getRemoteAddr();
if (ipAddress.equals("127.0.0.1")) {
Reported by PMD.
Line: 27
if (ipAddress == null || ipAddress.length() == 0 || "unknown".equalsIgnoreCase(ipAddress)) {
ipAddress = request.getHeader("WL-Proxy-Client-IP");
}
if (ipAddress == null || ipAddress.length() == 0 || "unknown".equalsIgnoreCase(ipAddress)) {
ipAddress = request.getRemoteAddr();
if (ipAddress.equals("127.0.0.1")) {
// 根据网卡取本机配置的IP
InetAddress inet = null;
try {
Reported by PMD.
Line: 29
}
if (ipAddress == null || ipAddress.length() == 0 || "unknown".equalsIgnoreCase(ipAddress)) {
ipAddress = request.getRemoteAddr();
if (ipAddress.equals("127.0.0.1")) {
// 根据网卡取本机配置的IP
InetAddress inet = null;
try {
inet = InetAddress.getLocalHost();
} catch (UnknownHostException e) {
Reported by PMD.