修改积分核销失败的问题

master
白美平 4 months ago
parent 8fb9b84ebf
commit 1e44f55bc8

@ -3,6 +3,12 @@
<component name="CopilotChatHistory">
<option name="conversations">
<list>
<Conversation>
<option name="createTime" value="1753679015685" />
<option name="id" value="01984f6a2f05720fb027b99d8d40a3e1" />
<option name="title" value="新对话 2025年7月28日 13:03:35" />
<option name="updateTime" value="1753679015685" />
</Conversation>
<Conversation>
<option name="createTime" value="1752539436295" />
<option name="id" value="01980b7d95077f51acd55ba2f79b7cad" />

@ -10,12 +10,14 @@
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="29bcb86b-1634-41e0-a498-79481163cba8" name="Changes" comment="连接两个数据库进行同步数据,并且保持事务一致性">
<list default="true" id="29bcb86b-1634-41e0-a498-79481163cba8" name="Changes" comment="修改积分核销不显示核销的积分数">
<change beforePath="$PROJECT_DIR$/.idea/CopilotChatHistory.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/CopilotChatHistory.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/com/nmgs/controller/ExportData.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/nmgs/controller/ExportData.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/com/nmgs/service/impl/ExcelDateImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/nmgs/service/impl/ExcelDateImpl.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/com/nmgs/service/impl/IntegralSeriveImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/nmgs/service/impl/IntegralSeriveImpl.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/com/nmgs/service/impl/IntegrationListServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/nmgs/service/impl/IntegrationListServiceImpl.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/com/nmgs/controller/AppointmentInfoController.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/nmgs/controller/AppointmentInfoController.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/com/nmgs/controller/QcodeInfoController.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/nmgs/controller/QcodeInfoController.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/com/nmgs/mapperset/mysqlmapper/UserTableMysqlMapper.xml" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/nmgs/mapperset/mysqlmapper/UserTableMysqlMapper.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/com/nmgs/mapperset/oraclemapper/UserTableMapper.xml" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/nmgs/mapperset/oraclemapper/UserTableMapper.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/com/nmgs/service/impl/ApponintmentInfoServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/nmgs/service/impl/ApponintmentInfoServiceImpl.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/com/nmgs/service/impl/QCodeInfoServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/nmgs/service/impl/QCodeInfoServiceImpl.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/com/nmgs/service/impl/UserTableServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/nmgs/service/impl/UserTableServiceImpl.java" afterDir="false" />
</list>
@ -117,7 +119,7 @@
"deletionFromPopupRequiresConfirmation": "false",
"git-widget-placeholder": "master",
"kotlin-language-version-configured": "true",
"last_opened_file_path": "D:/workspace/IntegralManager_20250714",
"last_opened_file_path": "D:/workspace/JTDataDiv",
"node.js.detected.package.eslint": "true",
"node.js.detected.package.tslint": "true",
"node.js.selected.package.eslint": "(autodetect)",
@ -619,7 +621,10 @@
<workItem from="1752974162251" duration="459000" />
<workItem from="1753088368966" duration="2701000" />
<workItem from="1753150992133" duration="5002000" />
<workItem from="1753165039568" duration="2132000" />
<workItem from="1753165039568" duration="2823000" />
<workItem from="1753673602009" duration="1321000" />
<workItem from="1753679011086" duration="14733000" />
<workItem from="1753747678539" duration="8436000" />
</task>
<task id="LOCAL-00001" summary="特请处理">
<option name="closed" value="true" />
@ -845,7 +850,15 @@
<option name="project" value="LOCAL" />
<updated>1752539808620</updated>
</task>
<option name="localTasksCounter" value="29" />
<task id="LOCAL-00029" summary="修改积分核销不显示核销的积分数">
<option name="closed" value="true" />
<created>1753167913617</created>
<option name="number" value="00029" />
<option name="presentableId" value="LOCAL-00029" />
<option name="project" value="LOCAL" />
<updated>1753167913617</updated>
</task>
<option name="localTasksCounter" value="30" />
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
@ -882,7 +895,8 @@
<MESSAGE value="修改数据库连接池属性信息" />
<MESSAGE value="去除一些不必要日志" />
<MESSAGE value="连接两个数据库进行同步数据,并且保持事务一致性" />
<option name="LAST_COMMIT_MESSAGE" value="连接两个数据库进行同步数据,并且保持事务一致性" />
<MESSAGE value="修改积分核销不显示核销的积分数" />
<option name="LAST_COMMIT_MESSAGE" value="修改积分核销不显示核销的积分数" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager>
@ -909,8 +923,8 @@
</line-breakpoint>
<line-breakpoint enabled="true" type="java-line">
<url>file://$PROJECT_DIR$/src/main/java/com/nmgs/service/impl/QCodeInfoServiceImpl.java</url>
<line>1073</line>
<option name="timeStamp" value="46" />
<line>666</line>
<option name="timeStamp" value="49" />
</line-breakpoint>
</breakpoints>
</breakpoint-manager>

@ -122,6 +122,8 @@ public class AppointmentInfoController {
return ResultData.success(8,"用户已被冻结");
}else if("-1".equals(retStr)){
return ResultData.fail("接口出错了");
} else if ("13".equals(retStr)) {
return ResultData.success(13, "人员积分异常,请联系客服审查");
}
return ResultData.success(1,"预约成功");
}

@ -168,6 +168,14 @@ public class QcodeInfoController {
WebsocketUtil.sendMessage(openId,JSONObject.toJSONString(retJo));
WebsocketUtil.removeSession(openId);
return ResultData.success(12,"数据已经核销");
} else if ("13".equals(retStr)) {
JSONObject retJo = new JSONObject();
retJo.put("code", 13);
retJo.put("msg", "人员积分异常,请联系客服审查");
retJo.put("data", "");
WebsocketUtil.sendMessage(openId, JSONObject.toJSONString(retJo));
WebsocketUtil.removeSession(openId);
return ResultData.success(13, "人员积分异常,请联系客服审查");
}else if("-1".equals(retStr)){
return ResultData.fail("接口出错了");
}

@ -47,14 +47,10 @@
,0,0,0,0,0,0,0,0,0,#{params.REFERRERCODE})
</insert>
<update id="updateUserById" parameterType="java.util.HashMap">
update WEIXN_USER_TABLE SET
<if test="params.enabledTICp !='' and params.enabledTICp != null">
CPENABLEINTEGRATION=#{params.enabledTICp},
</if>
<if test="params.enabledTIOG !='' and params.enabledTIOG != null">
update WEIXN_USER_TABLE
SET CPENABLEINTEGRATION=#{params.enabledTICp},
OGENABLEINTEGRATION=#{params.enabledTIOG},
</if>
ENABLEINTEGRATION= #{params.enabledTI}
ENABLEINTEGRATION= #{params.enabledTI}
where OPENID=#{params.userId}
</update>

@ -47,13 +47,8 @@
,0,0,0,0,0,0,0,0,0,#{params.REFERRERCODE})
</insert>
<update id="updateUserById" parameterType="java.util.HashMap">
update WEIXN_USER_TABLE SET
<if test="params.enabledTICp !='' and params.enabledTICp != null">
CPENABLEINTEGRATION=#{params.enabledTICp},
</if>
<if test="params.enabledTIOG !='' and params.enabledTIOG != null">
OGENABLEINTEGRATION=#{params.enabledTIOG},
</if>
update WEIXN_USER_TABLE SET CPENABLEINTEGRATION=#{params.enabledTICp},
OGENABLEINTEGRATION=#{params.enabledTIOG},
ENABLEINTEGRATION= #{params.enabledTI}
where OPENID=#{params.userId}
</update>

@ -347,9 +347,16 @@ public class ApponintmentInfoServiceImpl implements AppointmentInfoService {
retJo.put("ret", ret);
return retJo;
}
//人员积分是否异常
if (Double.parseDouble(ENABLEINTEGRATION) != (Double.parseDouble(OGENABLEINTEGRATION) + Double.parseDouble(CPENABLEINTEGRATION))) {
LogUtil.WriteLog_Info("人员积分异常:" + userIdNew, "QCodeInfoServiceImpl");
ret = "13";
retJo.put("ret", ret);
return retJo;
}
double discountMoney = PubTools.isNull(mealTotalMoney)?0.0:Double.parseDouble(mealTotalMoney);
double rebateIntegrateSave = 0.0;
retJo.put("ENABLEINTEGRATIONBEFORE", PubTools.doubleSave1(Double.parseDouble(CPENABLEINTEGRATION)));
retJo.put("ENABLEINTEGRATIONBEFORE", Double.parseDouble(CPENABLEINTEGRATION));
String sqlFc = sqlTemp.replace("@TYPE@", "FC");//查询餐饮的兑换比例
List selectforlistFc = this.mapperI.selectforlist(sqlFc);
//判断兑换积分是否够本次折扣
@ -383,8 +390,6 @@ public class ApponintmentInfoServiceImpl implements AppointmentInfoService {
}
String integralListId = "";//积分流水的ID
String enabledIntegral = "";//本次消费之后,剩余的餐饮积分
double restEnabled = Double.parseDouble(ENABLEINTEGRATION);
double lastEnabled = Double.parseDouble(ENABLEINTEGRATION);
double cpEnabled = Double.parseDouble(CPENABLEINTEGRATION);
double consumeInteger = rebateIntegrateIFcZK;
//1、积分流水记录新加
@ -395,26 +400,7 @@ public class ApponintmentInfoServiceImpl implements AppointmentInfoService {
Map<String, Object> o = (Map<String, Object>) selectforlistMax.get(0);
maxId = Integer.parseInt(o.get("ID").toString());
}
restEnabled = restEnabled - consumeInteger;
cpEnabled = cpEnabled - consumeInteger;
/* String cafterSql = "INSERT INTO integration_list_table ( ID, USERID, LASTINTEGRATION, PAYINTEGRATION, RESTINTEGRATION, PAYTYPE,PAYTIME ,OGENABLEINTEGRATION,CPENABLEINTEGRATION )\n" +
"VALUES\n" +
"\t(\n" +
"\t\t" + (maxId + 10) + ",\n" +
"\t\t" + userIdNew + ",\n" +
"\t\t" + PubTools.doubleSave1(lastEnabled * 100) + ",\n" +
"\t\t" + PubTools.doubleSave1(consumeInteger * 100) + ",\n" +
"\t\t" + PubTools.doubleSave1((restEnabled * 100)) + ",\n" +
"\t'FCA', \n";
if ("2".equals(DBType)) {
cafterSql += "\t\tto_date('" + rollbackTime + "','yyyy-MM-dd HH24:mi:ss'),\n";
} else if ("4".equals(DBType)) {
cafterSql += "\t\tstr_to_date('" + rollbackTime + "','%Y-%m-%d %H:%i:%s'),\n";
}
cafterSql += "\t" + PubTools.doubleSave1(((Double.parseDouble(OGENABLEINTEGRATION)) * 100)) + ", \n" +
"\t" + PubTools.doubleSave1(cpEnabled * 100) + " ";
cafterSql += "\t)";
this.mapperI.insert(cafterSql);*/
Map<String,Object> integralList = new HashMap<>();
@ -511,11 +497,11 @@ public class ApponintmentInfoServiceImpl implements AppointmentInfoService {
Map<String, Object> obj1T = (Map<String, Object>) objT;
double enabledT = Double.parseDouble(obj1T.get("ENABLEINTEGRATION").toString());
BigDecimal bd = BigDecimal.valueOf(enabledT - rebateIntegrateSave * 100);
bd = bd.setScale(1, RoundingMode.HALF_UP);
double enabledTI = bd.doubleValue();
double enabledTCp = Double.parseDouble(obj1T.get("CPENABLEINTEGRATION").toString());
double enabledTPG = Double.parseDouble(obj1T.get("OGENABLEINTEGRATION").toString());
BigDecimal bdcp = BigDecimal.valueOf(enabledTCp - rebateIntegrateSave * 100);
bdcp = bdcp.setScale(1, RoundingMode.HALF_UP);
double enabledTICp = bdcp.doubleValue();
enabledIntegral = PubTools.doubleSave1(enabledTICp / 100) + "";
retJo.put("ENABLEINTEGRATION", enabledIntegral);
@ -524,6 +510,7 @@ public class ApponintmentInfoServiceImpl implements AppointmentInfoService {
userParams.put("userId",openId);
userParams.put("enabledTI",enabledTI);
userParams.put("enabledTICp",enabledTICp);
userParams.put("enabledTIOG", enabledTPG);
userParams.put("DBTYPE",DBType);
this.userTableMapper.updateUserById(userParams);
if ("Y".equals(PropertiesUtil.getValue("BAKEnabled"))) {
@ -531,8 +518,6 @@ public class ApponintmentInfoServiceImpl implements AppointmentInfoService {
userParams.put("DBTYPEBAK",bakDBType);
this.userTableMyMapper.updateUserById(userParams);
}
LogUtil.WriteLog_Info("用户更新可用积分完成", "ApponintmentInfoServiceImpl");
}

@ -326,7 +326,7 @@ public class QCodeInfoServiceImpl {
LogUtil.WriteLog_Info("积分恢复=====流水记录已插入","QCodeInfoServiceImpl");
Map<String,Object> updateCafe=new HashMap<>();
updateCafe.put("rollback","SUCCESS");
updateCafe.put("integralrollback",(maxId+1));
updateCafe.put("integralrollback", (maxId + 10));
updateCafe.put("rollbackTime",rollbackTime);
updateCafe.put("orderId",orderId);
updateCafe.put("serverOperationId",serverOperationId);
@ -355,21 +355,19 @@ public class QCodeInfoServiceImpl {
double enabledTI = bd.doubleValue();
double enabledTCp=Double.parseDouble(obj1T.get("CPENABLEINTEGRATION").toString());
BigDecimal bdcp = BigDecimal.valueOf(enabledTCp + Double.parseDouble(payIntegral));
bdcp = bdcp.setScale(1, RoundingMode.HALF_UP);
double enabledTICp =0.0;
if("FC".equals(payType) || "FS".equals(payType)){
BigDecimal bdcp = BigDecimal.valueOf(enabledTCp + Double.parseDouble(payIntegral));
enabledTICp = bdcp.doubleValue();
enabledIntegral=enabledTICp;
}else{
enabledTICp=enabledTCp;
}
double enabledTOG=Double.parseDouble(obj1T.get("OGENABLEINTEGRATION").toString());
BigDecimal bdco = BigDecimal.valueOf(enabledTOG +Double.parseDouble(payIntegral));
bdco = bdco.setScale(1, RoundingMode.HALF_UP);
double enabledTIOG =0.0;
if("FG".equals(payType) || "FP".equals(payType)){
BigDecimal bdco = BigDecimal.valueOf(enabledTOG + Double.parseDouble(payIntegral));
enabledTIOG = bdco.doubleValue();
enabledIntegral=enabledTIOG;
}else{
@ -449,7 +447,7 @@ public class QCodeInfoServiceImpl {
"\tCOALESCE(TO_CHAR(ct.CAFTERTIME,'YYYY-MM-dd HH24:mi:ss'),'') AS CAFTERTIMEBAK,\n" +
"\t\tCOALESCE(TO_CHAR(ct.ROLLBACKTIME,'YYYY-MM-dd HH24:mi:ss'),'') AS ROLLBACKTIME,\n" +
"\t\tCOALESCE(TO_CHAR(ilt.PAYTIME,'YYYY-MM-dd HH24:mi:ss'),'') AS CAFTERTIME,\n" +
"\tROUND(ilt.PAYINTEGRATION/100,1) AS PAYINTEGRATION,\n" +
"\tROUND(ilt.PAYINTEGRATION/100,2) AS PAYINTEGRATION,\n" +
"\tilt.PAYTYPE,\n" +
"\tpt.TEXT AS PAYTYPENAME\n" +
"FROM\n" +
@ -467,7 +465,7 @@ public class QCodeInfoServiceImpl {
"\tCOALESCE(date_format(ct.CAFTERTIME, '%Y-%m-%d %H:%i:%s'),'') AS CAFTERTIMEBAK,\n" +
"\t\tCOALESCE(date_format(ct.ROLLBACKTIME,'%Y-%m-%d %H:%i:%s'),'') AS ROLLBACKTIME,\n" +
"\t\tCOALESCE(date_format(ilt.PAYTIME,'%Y-%m-%d %H:%i:%s'),'') AS CAFTERTIME,\n" +
"\tROUND(ilt.PAYINTEGRATION/100,1) AS PAYINTEGRATION,\n" +
"\tROUND(ilt.PAYINTEGRATION/100,2) AS PAYINTEGRATION,\n" +
"\tilt.PAYTYPE,\n" +
"\tpt.TEXT AS PAYTYPENAME\n" +
"FROM\n" +
@ -547,7 +545,7 @@ public class QCodeInfoServiceImpl {
List ret=null;// -1 代表接口处理失败 1 处理成功
try{
String sqlTemp="SELECT\n" +
"\tCOALESCE(ROUND(sum(ilt.PAYINTEGRATION)/100,1),0) AS PAYINTEGRATION\n" +
"\tCOALESCE(ROUND(sum(ilt.PAYINTEGRATION)/100,2),0) AS PAYINTEGRATION\n" +
"FROM\n" +
"\tCAFTER_TABLE ct,\n" +
"\tINTEGRATION_LIST_TABLE ilt,\n" +
@ -668,6 +666,15 @@ public class QCodeInfoServiceImpl {
String OGENABLEINTEGRATION = obj1.get("OGENABLEINTEGRATION").toString();//加油、加气可用积分
String CPENABLEINTEGRATION = obj1.get("CPENABLEINTEGRATION").toString();//餐饮、消费可用积分
userIdNew = Integer.parseInt(obj1.get("ID").toString());//人员id
//人员积分是否异常
if (Double.parseDouble(ENABLEINTEGRATION) != (Double.parseDouble(OGENABLEINTEGRATION) + Double.parseDouble(CPENABLEINTEGRATION))) {
LogUtil.WriteLog_Info("人员积分异常:" + userIdNew, "QCodeInfoServiceImpl");
Long l = redisConfigUtil.delIntegral(content);
ret = "13";
retJo.put("ret", ret);
return retJo;
}
if (s > 30) {
Object contentNew = Consistant.map.get(content);
if(!PubTools.isEmpty(contentNew)){
@ -736,6 +743,11 @@ public class QCodeInfoServiceImpl {
}
}
if (PubTools.isNull(integrateType)) {
ret = "4";
retJo.put("ret", ret);
return retJo;
}
//查询用户累积获取的总积分
double rebateIntegrateSave = 0.0;
switch (integrateType) {
@ -820,7 +832,6 @@ public class QCodeInfoServiceImpl {
if (selectforlistFc.size() > 0) {
Map<String, Object> o = (Map<String, Object>) selectforlistFc.get(0);
BigDecimal bd = BigDecimal.valueOf(Double.parseDouble(o.get("VALUE").toString()));
bd = bd.setScale(1, BigDecimal.ROUND_HALF_UP);
rebateInFc=bd.intValue();
}
//根据折扣金额计算积分
@ -856,7 +867,6 @@ public class QCodeInfoServiceImpl {
if (selectforlistFs.size() > 0) {
Map<String, Object> o = (Map<String, Object>) selectforlistFs.get(0);
BigDecimal bd = BigDecimal.valueOf(Double.parseDouble(o.get("VALUE").toString()));
bd = bd.setScale(1, BigDecimal.ROUND_HALF_UP);
rebateInFs=bd.intValue();
}
//根据折扣金额计算积分
@ -886,6 +896,7 @@ public class QCodeInfoServiceImpl {
default:
break;
}
//进行积分核减
//1、积分流水记录新加
String sqlMax = "select COALESCE(max(ID),0) AS ID from integration_list_table";
@ -901,27 +912,20 @@ public class QCodeInfoServiceImpl {
integralList.put("maxid",(maxId + 10));
integralList.put("userId",userIdNew);
integralList.put("acarNo","");
integralList.put("lastintegration",PubTools.doubleSave1(Double.parseDouble(ENABLEINTEGRATION) * 100));
integralList.put("payintegration",PubTools.doubleSave1(rebateIntegrateSave * 100));
integralList.put("restintegration",PubTools.doubleSave1(((Double.parseDouble(ENABLEINTEGRATION) - rebateIntegrateSave) * 100)));
integralList.put("lastintegration", new BigDecimal(ENABLEINTEGRATION).multiply(new BigDecimal("100")));
integralList.put("payintegration", new BigDecimal(rebateIntegrateSave).multiply(new BigDecimal("100")));
integralList.put("restintegration", (new BigDecimal(ENABLEINTEGRATION).subtract(new BigDecimal(rebateIntegrateSave))).multiply(new BigDecimal("100")));
integralList.put("payTime",rollbackTime);
integralList.put("paytype",integrateType);
integralList.put("DBTYPE",DBType);
if("FP".equals(integrateType) || "FG".equals(integrateType)){
integralList.put("cpenableintegration",PubTools.doubleSave1(((Double.parseDouble(OGENABLEINTEGRATION) - rebateIntegrateSave) * 100)));
integralList.put("ogenableintegration", PubTools.doubleSave1(Double.parseDouble(CPENABLEINTEGRATION) * 100));
}else if("FC".equals(integrateType) || "FS".equals(integrateType)) {
integralList.put("cpenableintegration",PubTools.doubleSave1(((Double.parseDouble(OGENABLEINTEGRATION)) * 100)));
integralList.put("ogenableintegration",PubTools.doubleSave1((Double.parseDouble(CPENABLEINTEGRATION) - rebateIntegrateSave) * 100));
}
this.integrationListMapper.addIntegralList(integralList);
if ("Y".equals(PropertiesUtil.getValue("BAKEnabled"))) {
String bakDBType = PropertiesUtil.getValue("BakDBType");
integralList.put("DBTYPEBAK",bakDBType);
this.integrationListMyMapper.addIntegralList(integralList);
integralList.put("cpenableintegration", new BigDecimal(CPENABLEINTEGRATION).multiply(new BigDecimal("100")));
integralList.put("ogenableintegration", (new BigDecimal(OGENABLEINTEGRATION).subtract(new BigDecimal(rebateIntegrateSave))).multiply(new BigDecimal("100")));
}else if("FC".equals(integrateType) || "FS".equals(integrateType)) {
integralList.put("cpenableintegration", PubTools.doubleSave1(((Double.parseDouble(CPENABLEINTEGRATION) - rebateIntegrateSave) * 100)));
integralList.put("ogenableintegration", new BigDecimal(OGENABLEINTEGRATION).multiply(new BigDecimal("100")));
}
LogUtil.WriteLog_Info("积分核减=====积分流水已插入", "QCodeInfoServiceImpl");
//2、新加一条消费记录
String maxIdCafeSql="select COALESCE(max(t.ID),0)+1 as ID from CAFTER_TABLE t";
List maxIdCafeSqlMax = this.mapperI.selectforlist(maxIdCafeSql);
@ -942,13 +946,6 @@ public class QCodeInfoServiceImpl {
cafetparam.put("orderId",orderId);
cafetparam.put("content",content);
cafetparam.put("DBTYPE",DBType);
this.cafterTableMapper.addcafter(cafetparam);
if ("Y".equals(PropertiesUtil.getValue("BAKEnabled"))) {
String bakDBType = PropertiesUtil.getValue("BakDBType");
cafetparam.put("DBTYPEBAK",bakDBType);
this.cafterTableMyMapper.addcafter(cafetparam);
}
LogUtil.WriteLog_Info("积分核减=====消费记录已插入", "QCodeInfoServiceImpl");
//3、计算用户可用积分
String sql = "select " +
" ut.ID ,ut.OPENID ,COALESCE(ut.ENABLEINTEGRATION,0) AS ENABLEINTEGRATION,COALESCE(ut.CPENABLEINTEGRATION,0) AS CPENABLEINTEGRATION,COALESCE(ut.OGENABLEINTEGRATION,0) AS OGENABLEINTEGRATION" +
@ -960,41 +957,59 @@ public class QCodeInfoServiceImpl {
Map<String, Object> obj1T = (Map<String, Object>) objT;
double enabledT = Double.parseDouble(obj1T.get("ENABLEINTEGRATION").toString());
BigDecimal bd = BigDecimal.valueOf(enabledT - rebateIntegrateSave * 100);
bd = bd.setScale(1, RoundingMode.HALF_UP);
double enabledTI = bd.doubleValue();
double enabledTCp = Double.parseDouble(obj1T.get("CPENABLEINTEGRATION").toString());
BigDecimal bdcp = BigDecimal.valueOf(enabledTCp - rebateIntegrateSave * 100);
bdcp = bdcp.setScale(1, RoundingMode.HALF_UP);
double enabledTICp = bdcp.doubleValue();
double enabledTPG = Double.parseDouble(obj1T.get("OGENABLEINTEGRATION").toString());
BigDecimal bdcpPG = BigDecimal.valueOf(enabledTPG - rebateIntegrateSave * 100);
BigDecimal bdcpPg = bdcpPG.setScale(1, RoundingMode.HALF_UP);
double enabledTIPG = bdcpPg.doubleValue();
if ("FP".equals(integrateType) || "FG".equals(integrateType)) {
BigDecimal bdcpPG = BigDecimal.valueOf(enabledTPG - rebateIntegrateSave * 100);
enabledTPG = bdcpPG.doubleValue();
} else if ("FC".equals(integrateType) || "FS".equals(integrateType)) {
BigDecimal bdcp = BigDecimal.valueOf(enabledTCp - rebateIntegrateSave * 100);
enabledTCp = bdcp.doubleValue();
} else {
ret = "4";
retJo.put("ret", ret);
return retJo;
}
Map<String,Object> userParams=new HashMap<String,Object>();
userParams.put("userId",openId);
userParams.put("enabledTI",enabledTI);
userParams.put("enabledTIOG", enabledTPG);
userParams.put("enabledTICp", enabledTCp);
if("FP".equals(integrateType) || "FG".equals(integrateType)){
userParams.put("enabledTIPG",enabledTIPG);
enabledIntegral=PubTools.doubleSave1(enabledTIPG / 100)+"";
enabledIntegral = PubTools.doubleSave1(enabledTPG / 100) + "";
retJo.put("ENABLEINTEGRATION",enabledIntegral);
}else if("FC".equals(integrateType) || "FS".equals(integrateType)) {
userParams.put("enabledTICp",enabledTICp);
enabledIntegral=PubTools.doubleSave1(enabledTICp / 100)+"";
enabledIntegral = PubTools.doubleSave1(enabledTCp / 100) + "";
retJo.put("ENABLEINTEGRATION", enabledIntegral);
}else{
} else {
}
LogUtil.WriteLog_Info("积分核减=====消费类型:" + integrateType, "QCodeInfoServiceImpl");
userParams.put("DBTYPE",DBType);
this.integrationListMapper.addIntegralList(integralList);
if ("Y".equals(PropertiesUtil.getValue("BAKEnabled"))) {
String bakDBType = PropertiesUtil.getValue("BakDBType");
integralList.put("DBTYPEBAK", bakDBType);
this.integrationListMyMapper.addIntegralList(integralList);
}
LogUtil.WriteLog_Info("积分核减=====积分流水已插入:" + integralList, "QCodeInfoServiceImpl");
this.cafterTableMapper.addcafter(cafetparam);
if ("Y".equals(PropertiesUtil.getValue("BAKEnabled"))) {
String bakDBType = PropertiesUtil.getValue("BakDBType");
cafetparam.put("DBTYPEBAK", bakDBType);
this.cafterTableMyMapper.addcafter(cafetparam);
}
LogUtil.WriteLog_Info("积分核减=====消费记录已插入:" + cafetparam, "QCodeInfoServiceImpl");
this.userTableMapper.updateUserById(userParams);
if ("Y".equals(PropertiesUtil.getValue("BAKEnabled"))) {
String bakDBType = PropertiesUtil.getValue("BakDBType");
userParams.put("DBTYPEBAK",bakDBType);
this.userTableMyMapper.updateUserById(userParams);
}
LogUtil.WriteLog_Info("用户更新可用积分完成", "QCodeInfoServiceImpl");
LogUtil.WriteLog_Info("积分核减=====用户积分已修改:" + userParams.toString(), "QCodeInfoServiceImpl");
}
Object contentNew = Consistant.map.get(content);
if(!PubTools.isEmpty(contentNew)){
Consistant.map.remove(content);

@ -41,13 +41,13 @@ public class UserTableServiceImpl implements UserTableService {
" ut.REALNAME,substr(ut.IDNUMBER,1,6)||'********'||substr(ut.IDNUMBER,15) AS IDNUMBER," +
" ut.CERTIFICATION,ut.CREATETIME," +
" ut.UNPASSINFO," +
" ROUND((ut.ENABLEINTEGRATION/100),1) AS ENABLEINTEGRATION,ut.REFERRER,ut.BAK1," +
" ut.BAK2,ut.BAK3,ut.STARLEVEL,ROUND((ut.OILENABLEINTEGRATION/100),1) AS OILENABLEINTEGRATION," +
" ROUND((ut.GASENABLEINTEGRATION/100),1) AS GASENABLEINTEGRATION," +
" ROUND((ut.SPENABLEINTEGRATION / 100),1) AS SPENABLEINTEGRATION," +
" ROUND((ut.CAFENABLEINTEGRATION/100),1) AS CAFENABLEINTEGRATION," +
" ROUND((ut.OGENABLEINTEGRATION/100),1) AS OGENABLEINTEGRATION," +
" ROUND((ut.CPENABLEINTEGRATION/100),1) AS CPENABLEINTEGRATION," +
" ROUND((ut.ENABLEINTEGRATION/100),2) AS ENABLEINTEGRATION,ut.REFERRER,ut.BAK1," +
" ut.BAK2,ut.BAK3,ut.STARLEVEL,ROUND((ut.OILENABLEINTEGRATION/100),2) AS OILENABLEINTEGRATION," +
" ROUND((ut.GASENABLEINTEGRATION/100),2) AS GASENABLEINTEGRATION," +
" ROUND((ut.SPENABLEINTEGRATION / 100),2) AS SPENABLEINTEGRATION," +
" ROUND((ut.CAFENABLEINTEGRATION/100),2) AS CAFENABLEINTEGRATION," +
" ROUND((ut.OGENABLEINTEGRATION/100),2) AS OGENABLEINTEGRATION," +
" ROUND((ut.CPENABLEINTEGRATION/100),2) AS CPENABLEINTEGRATION," +
" ut.NUMBERPICNAME AS NUMBERPICNAME," +
" ut.REFERRERCODE AS REFERRERCODE," +
" cst.VALUE as CERTIFICATIONNAME" +
@ -61,13 +61,13 @@ public class UserTableServiceImpl implements UserTableService {
" ut.REALNAME,concat(substr(ut.IDNUMBER,1,6),'********',substr(ut.IDNUMBER,15)) AS IDNUMBER," +
" ut.UNPASSINFO," +
" ut.CERTIFICATION,ut.CREATETIME," +
" ROUND((ut.ENABLEINTEGRATION/100),1) AS ENABLEINTEGRATION,ut.REFERRER,ut.BAK1," +
" ROUND((ut.ENABLEINTEGRATION/100),2) AS ENABLEINTEGRATION,ut.REFERRER,ut.BAK1," +
" ut.BAK2,ut.BAK3,ut.STARLEVEL,ROUND((ut.OILENABLEINTEGRATION/100),1) AS OILENABLEINTEGRATION," +
" ROUND((ut.GASENABLEINTEGRATION/100),1) AS GASENABLEINTEGRATION," +
" ROUND((ut.SPENABLEINTEGRATION / 100),1) AS SPENABLEINTEGRATION," +
" ROUND((ut.CAFENABLEINTEGRATION/100),1) AS CAFENABLEINTEGRATION," +
" ROUND((ut.OGENABLEINTEGRATION/100),1) AS OGENABLEINTEGRATION," +
" ROUND((ut.CPENABLEINTEGRATION/100),1) AS CPENABLEINTEGRATION," +
" ROUND((ut.GASENABLEINTEGRATION/100),2) AS GASENABLEINTEGRATION," +
" ROUND((ut.SPENABLEINTEGRATION / 100),2) AS SPENABLEINTEGRATION," +
" ROUND((ut.CAFENABLEINTEGRATION/100),2) AS CAFENABLEINTEGRATION," +
" ROUND((ut.OGENABLEINTEGRATION/100),2) AS OGENABLEINTEGRATION," +
" ROUND((ut.CPENABLEINTEGRATION/100),2) AS CPENABLEINTEGRATION," +
" ut.REFERRERCODE AS REFERRERCODE," +
" ut.NUMBERPICNAME AS NUMBERPICNAME," +
" cst.VALUE as CERTIFICATIONNAME" +
@ -282,13 +282,13 @@ public class UserTableServiceImpl implements UserTableService {
}
sqlTemp+= " ut.NUMBERPIC AS NUMBERPIC," +
" ut.CERTIFICATION,ut.CREATETIME," +
" ROUND((ut.ENABLEINTEGRATION/100),1) AS ENABLEINTEGRATION,ut.REFERRER,ut.BAK1," +
" ROUND((ut.ENABLEINTEGRATION/100),2) AS ENABLEINTEGRATION,ut.REFERRER,ut.BAK1," +
" ut.BAK2,ut.BAK3,ut.STARLEVEL,ROUND((ut.OILENABLEINTEGRATION/100),1) AS OILENABLEINTEGRATION," +
" ROUND((ut.GASENABLEINTEGRATION/100),1) AS GASENABLEINTEGRATION," +
" ROUND((ut.SPENABLEINTEGRATION / 100),1) AS SPENABLEINTEGRATION," +
" ROUND((ut.CAFENABLEINTEGRATION/100),1) AS CAFENABLEINTEGRATION," +
" ROUND((ut.OGENABLEINTEGRATION/100),1) AS OGENABLEINTEGRATION," +
" ROUND((ut.CPENABLEINTEGRATION/100),1) AS CPENABLEINTEGRATION," +
" ROUND((ut.GASENABLEINTEGRATION/100),2) AS GASENABLEINTEGRATION," +
" ROUND((ut.SPENABLEINTEGRATION / 100),2) AS SPENABLEINTEGRATION," +
" ROUND((ut.CAFENABLEINTEGRATION/100),2) AS CAFENABLEINTEGRATION," +
" ROUND((ut.OGENABLEINTEGRATION/100),2) AS OGENABLEINTEGRATION," +
" ROUND((ut.CPENABLEINTEGRATION/100),2) AS CPENABLEINTEGRATION," +
" ut.REFERRERCODE AS REFERRERCODE," +
" ut.NUMBERPICNAME AS NUMBERPICNAME," +
" (SELECT IPS.BAK1 FROM INTEGRAL_PUBLIC_SET ips WHERE IPS.PARAMCODE='PICURL') AS NUMBERPICURL," +

Loading…
Cancel
Save