12 changed files with 247 additions and 15 deletions
-
9src/main/java/com/example/demo/controller/DetailYController.java
-
4src/main/java/com/example/demo/domain/entity/Recharge.java
-
31src/main/java/com/example/demo/domain/vo/ERP.java
-
8src/main/java/com/example/demo/mapper/ConsumeMapper.java
-
13src/main/java/com/example/demo/mapper/OtherMapper.java
-
4src/main/java/com/example/demo/mapper/RefundMapper.java
-
4src/main/java/com/example/demo/serviceImpl/ActivityServiceImpl.java
-
2src/main/java/com/example/demo/serviceImpl/AuditServiceImpl.java
-
8src/main/java/com/example/demo/serviceImpl/ConsumeServiceImpl.java
-
170src/main/java/com/example/demo/serviceImpl/OtherServiceImpl.java
-
2src/main/java/com/example/demo/serviceImpl/RechargeServiceImpl.java
-
7src/main/java/com/example/demo/sevice/OtherService.java
@ -0,0 +1,31 @@ |
|||||
|
package com.example.demo.domain.vo; |
||||
|
|
||||
|
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
|
import lombok.Data; |
||||
|
import lombok.NoArgsConstructor; |
||||
|
|
||||
|
import java.math.BigDecimal; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
@Data |
||||
|
@NoArgsConstructor |
||||
|
public class ERP { |
||||
|
private String jwcode; |
||||
|
private BigDecimal taskJb; |
||||
|
private BigDecimal freeJb; |
||||
|
private BigDecimal rechargeJb; |
||||
|
private String adminName; |
||||
|
private String productName; |
||||
|
private String reamrk; |
||||
|
private String type; |
||||
|
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss") |
||||
|
private Date createTime; |
||||
|
private String consumePlatform; |
||||
|
private String name; |
||||
|
private Integer consumeType ; |
||||
|
private Integer refundType; |
||||
|
private String refundGoods; |
||||
|
private Integer updateType; |
||||
|
private String area; |
||||
|
private String token; |
||||
|
} |
@ -0,0 +1,13 @@ |
|||||
|
package com.example.demo.mapper; |
||||
|
|
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
import org.apache.ibatis.annotations.Select; |
||||
|
|
||||
|
@Mapper |
||||
|
public interface OtherMapper { |
||||
|
|
||||
|
@Select({ |
||||
|
"select remark_cn from gold_type_info where id=#{type}" |
||||
|
}) |
||||
|
String selectWay(String type); |
||||
|
} |
@ -0,0 +1,170 @@ |
|||||
|
package com.example.demo.serviceImpl; |
||||
|
|
||||
|
import com.example.demo.domain.entity.DetailY; |
||||
|
import com.example.demo.domain.vo.ERP; |
||||
|
import com.example.demo.mapper.DetailYMapper; |
||||
|
import com.example.demo.mapper.OtherMapper; |
||||
|
import com.example.demo.sevice.OtherService; |
||||
|
import lombok.RequiredArgsConstructor; |
||||
|
import org.springframework.cache.annotation.CacheConfig; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.springframework.transaction.annotation.Transactional; |
||||
|
|
||||
|
import java.math.BigDecimal; |
||||
|
import java.util.Set; |
||||
|
import java.util.HashSet; |
||||
|
|
||||
|
@Service |
||||
|
@Transactional |
||||
|
@RequiredArgsConstructor |
||||
|
@CacheConfig(cacheNames = "other") |
||||
|
public class OtherServiceImpl implements OtherService { |
||||
|
|
||||
|
private static final Set<String> typesToUpdateZero = new HashSet<>(); |
||||
|
private static final Set<String> typesToUpdateOne = new HashSet<>(); |
||||
|
private static final Set<String> typesToUpdateTwo = new HashSet<>(); |
||||
|
private static final Set<String> typesToUpdateThree = new HashSet<>(); |
||||
|
private final OtherMapper otherMapper; |
||||
|
private final DetailYMapper detailYMapper; |
||||
|
|
||||
|
static { |
||||
|
typesToUpdateZero.add("1"); |
||||
|
typesToUpdateZero.add("2"); |
||||
|
typesToUpdateZero.add("3"); |
||||
|
typesToUpdateZero.add("4"); |
||||
|
typesToUpdateZero.add("5"); |
||||
|
typesToUpdateZero.add("6"); |
||||
|
typesToUpdateZero.add("7"); |
||||
|
typesToUpdateZero.add("8"); |
||||
|
typesToUpdateZero.add("11"); |
||||
|
typesToUpdateZero.add("12"); |
||||
|
typesToUpdateZero.add("13"); |
||||
|
typesToUpdateZero.add("14"); |
||||
|
typesToUpdateZero.add("18"); |
||||
|
typesToUpdateZero.add("19"); |
||||
|
typesToUpdateZero.add("20"); |
||||
|
typesToUpdateZero.add("21"); |
||||
|
typesToUpdateZero.add("22"); |
||||
|
typesToUpdateZero.add("23"); |
||||
|
typesToUpdateZero.add("24"); |
||||
|
typesToUpdateZero.add("26"); |
||||
|
typesToUpdateZero.add("28"); |
||||
|
typesToUpdateZero.add("29"); |
||||
|
typesToUpdateZero.add("35"); |
||||
|
typesToUpdateZero.add("36"); |
||||
|
typesToUpdateZero.add("40"); |
||||
|
typesToUpdateZero.add("45"); |
||||
|
typesToUpdateZero.add("46"); |
||||
|
typesToUpdateZero.add("47"); |
||||
|
typesToUpdateZero.add("48"); |
||||
|
typesToUpdateZero.add("49"); |
||||
|
typesToUpdateZero.add("53"); |
||||
|
typesToUpdateZero.add("54"); |
||||
|
typesToUpdateZero.add("60"); |
||||
|
|
||||
|
typesToUpdateOne.add("9"); |
||||
|
typesToUpdateOne.add("15"); |
||||
|
typesToUpdateOne.add("17"); |
||||
|
typesToUpdateOne.add("25"); |
||||
|
typesToUpdateOne.add("27"); |
||||
|
typesToUpdateOne.add("37"); |
||||
|
typesToUpdateOne.add("41"); |
||||
|
typesToUpdateOne.add("42"); |
||||
|
typesToUpdateOne.add("43"); |
||||
|
typesToUpdateOne.add("50"); |
||||
|
typesToUpdateOne.add("51"); |
||||
|
typesToUpdateOne.add("52"); |
||||
|
|
||||
|
typesToUpdateTwo.add("55"); |
||||
|
typesToUpdateTwo.add("56"); |
||||
|
typesToUpdateTwo.add("57"); |
||||
|
typesToUpdateTwo.add("58"); |
||||
|
typesToUpdateTwo.add("59"); |
||||
|
typesToUpdateTwo.add("61"); |
||||
|
|
||||
|
typesToUpdateThree.add("9"); |
||||
|
typesToUpdateThree.add("15"); |
||||
|
typesToUpdateThree.add("17"); |
||||
|
typesToUpdateThree.add("25"); |
||||
|
typesToUpdateThree.add("27"); |
||||
|
typesToUpdateThree.add("37"); |
||||
|
typesToUpdateThree.add("41"); |
||||
|
typesToUpdateThree.add("42"); |
||||
|
typesToUpdateThree.add("43"); |
||||
|
typesToUpdateThree.add("50"); |
||||
|
typesToUpdateThree.add("51"); |
||||
|
typesToUpdateThree.add("52"); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public int addERP(ERP erp) { |
||||
|
DetailY detailY = new DetailY(); |
||||
|
String type = erp.getType(); |
||||
|
String JwCode = erp.getJwcode(); |
||||
|
BigDecimal taskJb = erp.getTaskJb(); |
||||
|
BigDecimal freeJb = erp.getFreeJb(); |
||||
|
BigDecimal rechargeJb = erp.getRechargeJb(); |
||||
|
String adminName = erp.getAdminName(); |
||||
|
String productName = erp.getProductName(); |
||||
|
String remark = erp.getReamrk(); |
||||
|
String Way = otherMapper.selectWay(type); |
||||
|
if (typesToUpdateZero.contains(type)) { |
||||
|
detailY.setUpdateType(0);// 设置 updateType 为 0 |
||||
|
detailY.setJwcode(JwCode); |
||||
|
detailY.setRechargeCoin(rechargeJb); |
||||
|
detailY.setFreeCoin(freeJb); |
||||
|
detailY.setTaskCoin(taskJb); |
||||
|
detailY.setRemark(remark); |
||||
|
detailY.setName(adminName); |
||||
|
// detailY.setUsername(username); |
||||
|
// detailY.setArea(area); |
||||
|
detailY.setProductName(productName); |
||||
|
detailY.setConsumePlatform("ERP充值"); |
||||
|
detailY.setRechargeWay(Way); |
||||
|
|
||||
|
|
||||
|
|
||||
|
} else if (typesToUpdateOne.contains(type)) { |
||||
|
detailY.setUpdateType(1); // 设置 updateType 为 1 |
||||
|
detailY.setJwcode(JwCode); |
||||
|
detailY.setRechargeCoin(rechargeJb); |
||||
|
detailY.setFreeCoin(freeJb); |
||||
|
detailY.setTaskCoin(taskJb); |
||||
|
detailY.setRemark(remark); |
||||
|
detailY.setName(adminName); |
||||
|
// detailY.setUsername(username); |
||||
|
// detailY.setArea(area); |
||||
|
detailY.setProductName(productName); |
||||
|
detailY.setConsumePlatform("ERP充值"); |
||||
|
detailY.setConsumeType(Way); |
||||
|
} else if (typesToUpdateTwo.contains(type)) { |
||||
|
detailY.setUpdateType(2); // 设置 updateType 为 2 |
||||
|
detailY.setJwcode(JwCode); |
||||
|
detailY.setRechargeCoin(rechargeJb); |
||||
|
detailY.setFreeCoin(freeJb); |
||||
|
detailY.setTaskCoin(taskJb); |
||||
|
detailY.setRemark(remark); |
||||
|
detailY.setName(adminName); |
||||
|
// detailY.setUsername(username); |
||||
|
// detailY.setArea(area); |
||||
|
detailY.setProductName(productName); |
||||
|
detailY.setConsumePlatform("ERP充值"); |
||||
|
detailY.setRefundType(Way); |
||||
|
}else if (typesToUpdateThree.contains(type)) { |
||||
|
detailY.setUpdateType(3); // 设置 updateType 为 3 |
||||
|
detailY.setJwcode(JwCode); |
||||
|
detailY.setRechargeCoin(rechargeJb); |
||||
|
detailY.setFreeCoin(freeJb); |
||||
|
detailY.setTaskCoin(taskJb); |
||||
|
detailY.setRemark(remark); |
||||
|
detailY.setName(adminName); |
||||
|
// detailY.setUsername(username); |
||||
|
// detailY.setArea(area); |
||||
|
detailY.setProductName(productName); |
||||
|
detailY.setConsumePlatform("ERP充值"); |
||||
|
detailY.setReson(Way); |
||||
|
} |
||||
|
// 添加其他业务逻辑 |
||||
|
return detailYMapper.add(detailY); |
||||
|
} |
||||
|
} |
@ -0,0 +1,7 @@ |
|||||
|
package com.example.demo.sevice; |
||||
|
|
||||
|
import com.example.demo.domain.vo.ERP; |
||||
|
|
||||
|
public interface OtherService { |
||||
|
int addERP(ERP erp); |
||||
|
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue