diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighOilCardContactRecordController.java b/hai-bweb/src/main/java/com/bweb/controller/HighOilCardContactRecordController.java new file mode 100644 index 00000000..e914a6eb --- /dev/null +++ b/hai-bweb/src/main/java/com/bweb/controller/HighOilCardContactRecordController.java @@ -0,0 +1,59 @@ +package com.bweb.controller; + +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.hai.common.utils.ResponseMsgUtil; +import com.hai.model.ResponseData; +import com.hai.service.HighOilCardContactRecordService; +import com.hai.service.HighOilCardRecordService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; + +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@Controller +@RequestMapping(value = "/oilCardContactRecord") +@Api(value = "油卡变更记录") +public class HighOilCardContactRecordController { + + private static Logger log = LoggerFactory.getLogger(HighOilCardContactRecordController.class); + + @Resource + private HighOilCardContactRecordService oilCardContactRecordService; + + @RequestMapping(value = "/getOilCardContactRecordList", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询油卡记录列表") + public ResponseData getOilCardContactRecordList( + @RequestParam(name = "cardNo", required = true) String cardNo, + @RequestParam(name = "createTimeS", required = false) Long createTimeS, + @RequestParam(name = "createTimeE", required = false) Long createTimeE, + @RequestParam(name = "pageNum", required = true) Integer pageNum, + @RequestParam(name = "pageSize", required = true) Integer pageSize) { + try { + + Map param = new HashMap<>(); + param.put("cardNo", cardNo); + param.put("createTimeS", createTimeS); + param.put("createTimeE", createTimeE); + + PageHelper.startPage(pageNum, pageSize); + return ResponseMsgUtil.success(new PageInfo<>(oilCardContactRecordService.getRecordList(param))); + + } catch (Exception e) { + log.error("HighOilCardRecordController --> getOilCardContactRecordList() error!", e); + return ResponseMsgUtil.exception(e); + } + } +} diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighOilCardController.java b/hai-bweb/src/main/java/com/bweb/controller/HighOilCardController.java index 22e4c0c5..8fd855ac 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighOilCardController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighOilCardController.java @@ -1,6 +1,8 @@ package com.bweb.controller; +import com.alibaba.excel.EasyExcel; import com.alibaba.fastjson.JSONObject; +import com.bweb.config.SysConst; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.hai.common.exception.ErrorCode; @@ -10,7 +12,11 @@ import com.hai.common.security.AESEncodeUtil; import com.hai.common.security.UserCenter; import com.hai.common.utils.ResponseMsgUtil; import com.hai.entity.HighCompanyTwoPwd; +import com.hai.entity.HighOilCard; +import com.hai.enum_type.OilCardStatusEnum; +import com.hai.enum_type.UserObjectTypeEnum; import com.hai.model.ResponseData; +import com.hai.model.TyOrderModel; import com.hai.model.UserInfoModel; import com.hai.service.HighCompanyTwoPwdService; import com.hai.service.HighOilCardService; @@ -23,7 +29,10 @@ import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; +import java.io.File; +import java.util.ArrayList; import java.util.HashMap; +import java.util.List; import java.util.Map; @Controller @@ -208,4 +217,110 @@ public class HighOilCardController { return ResponseMsgUtil.exception(e); } } + + @RequestMapping(value = "/exportCard", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "导出油卡") + public ResponseData exportCard(@RequestParam(name = "orgId", required = false) Long orgId, + @RequestParam(name = "cardNo", required = false) String cardNo, + @RequestParam(name = "contactName", required = false) String contactName, + @RequestParam(name = "contactPhone", required = false) String contactPhone, + @RequestParam(name = "createTimeS", required = false) Long createTimeS, + @RequestParam(name = "createTimeE", required = false) Long createTimeE, + @RequestParam(name = "bindTimeS", required = false) Long bindTimeS, + @RequestParam(name = "bindTimeE", required = false) Long bindTimeE, + @RequestParam(name = "isConfigContact", required = false) Boolean isConfigContact, + @RequestParam(name = "status", required = false) Integer status, + @RequestParam(name = "bindStatus", required = false) Integer bindStatus) { + try { + + UserInfoModel userModel = userCenter.getSessionModel(UserInfoModel.class); + + Map param = new HashMap<>(); + param.put("companyId", userModel.getBsCompany().getId()); + + if (userModel.getSecUser().getAdminFlag() != 1) { + param.put("orgId", userModel.getBsOrganization().getId()); + } + param.put("cardNo", cardNo); + param.put("contactName", contactName); + param.put("contactPhone", contactPhone); + param.put("createTimeS", createTimeS); + param.put("createTimeE", createTimeE); + param.put("bindTimeS", bindTimeS); + param.put("bindTimeE", bindTimeE); + param.put("isConfigContact", isConfigContact); + param.put("status", status); + param.put("bindStatus", bindStatus); + List cardList = oilCardService.getOilCardList(param); + + + List headList = new ArrayList<>(); + headList.add("卡号"); + headList.add("余额"); + headList.add("消费金额"); + headList.add("联系人"); + headList.add("联系电话"); + headList.add("状态"); + + List> dataList = new ArrayList<>(); + List data; + + for (HighOilCard card: cardList) { + data = new ArrayList<>(); + data.add(card.getCardNo()); + data.add(card.getAmount()); + data.add(card.getAmountConsume()); + + if (StringUtils.isNotBlank(card.getContactName())) { + data.add(card.getContactName()); + } else { + data.add("未设置"); + } + + if (StringUtils.isNotBlank(card.getContactPhone())) { + data.add(card.getContactName()); + } else { + data.add("未设置"); + } + + if (card.getStatus().equals(OilCardStatusEnum.status1.getStatus())) { + data.add("正常"); + } else if (card.getStatus().equals(OilCardStatusEnum.status2.getStatus())) { + data.add("禁用"); + } + dataList.add(data); + } + + String fileUrl = SysConst.getSysConfig().getFileUrl() + "/temporary/"; + String pathName = System.currentTimeMillis()+".xlsx"; + File file = new File(fileUrl); + if (!file.exists()) { + file.mkdirs(); + } + EasyExcel.write(fileUrl+pathName).head(generationHead(headList)).sheet("油卡").doWrite(dataList); + + return ResponseMsgUtil.success(pathName); + + } catch (Exception e) { + log.error("HighOilCardController --> exportCard() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + /** + * 生成头部 + * @param headList + * @return + */ + private static List> generationHead(List headList) { + List> list = new ArrayList<>(); + List head; + for (String headStr : headList) { + head = new ArrayList<>(); + head.add(headStr); + list.add(head); + } + return list; + } } diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighOilCardRecordController.java b/hai-bweb/src/main/java/com/bweb/controller/HighOilCardRecordController.java new file mode 100644 index 00000000..325573f5 --- /dev/null +++ b/hai-bweb/src/main/java/com/bweb/controller/HighOilCardRecordController.java @@ -0,0 +1,57 @@ +package com.bweb.controller; + +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.hai.common.utils.ResponseMsgUtil; +import com.hai.model.ResponseData; +import com.hai.service.HighOilCardRecordService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.HashMap; +import java.util.Map; + +@Controller +@RequestMapping(value = "/oilCardRecord") +@Api(value = "油卡记录") +public class HighOilCardRecordController { + + private static Logger log = LoggerFactory.getLogger(HighOilCardRecordController.class); + + @Resource + private HighOilCardRecordService oilCardRecordService; + + @RequestMapping(value = "/getOilCardRecordList", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询油卡记录列表") + public ResponseData getOilCardRecordList(@RequestParam(name = "cardNo", required = true) String cardNo, + @RequestParam(name = "type", required = false) Integer type, + @RequestParam(name = "sourceType", required = false) String sourceType, + @RequestParam(name = "createTimeS", required = false) Long createTimeS, + @RequestParam(name = "createTimeE", required = false) Long createTimeE, + @RequestParam(name = "pageNum", required = true) Integer pageNum, + @RequestParam(name = "pageSize", required = true) Integer pageSize) { + try { + + Map param = new HashMap<>(); + param.put("cardNo", cardNo); + param.put("type", type); + param.put("sourceType", sourceType); + param.put("createTimeS", createTimeS); + param.put("createTimeE", createTimeE); + + PageHelper.startPage(pageNum, pageSize); + return ResponseMsgUtil.success(new PageInfo<>(oilCardRecordService.getRecordList(param))); + + } catch (Exception e) { + log.error("HighOilCardRecordController --> getOilCardRecordList() error!", e); + return ResponseMsgUtil.exception(e); + } + } + +} diff --git a/hai-service/src/main/java/com/hai/dao/HighOilCardContactRecordMapper.java b/hai-service/src/main/java/com/hai/dao/HighOilCardContactRecordMapper.java index b2232b8b..220ddbb3 100644 --- a/hai-service/src/main/java/com/hai/dao/HighOilCardContactRecordMapper.java +++ b/hai-service/src/main/java/com/hai/dao/HighOilCardContactRecordMapper.java @@ -39,14 +39,16 @@ public interface HighOilCardContactRecordMapper extends HighOilCardContactRecord int deleteByPrimaryKey(Long id); @Insert({ - "insert into high_oil_card_contact_record (oil_card_id, content, ", - "`status`, create_time, ", - "op_user_id, op_user_name, ", - "ext_1, ext_2, ext_3)", - "values (#{oilCardId,jdbcType=BIGINT}, #{content,jdbcType=VARCHAR}, ", - "#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ", - "#{opUserId,jdbcType=BIGINT}, #{opUserName,jdbcType=VARCHAR}, ", - "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" + "insert into high_oil_card_contact_record (oil_card_id, card_no, ", + "content, `status`, ", + "create_time, op_user_id, ", + "op_user_name, ext_1, ", + "ext_2, ext_3)", + "values (#{oilCardId,jdbcType=BIGINT}, #{cardNo,jdbcType=VARCHAR}, ", + "#{content,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ", + "#{createTime,jdbcType=TIMESTAMP}, #{opUserId,jdbcType=BIGINT}, ", + "#{opUserName,jdbcType=VARCHAR}, #{ext1,jdbcType=VARCHAR}, ", + "#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" }) @Options(useGeneratedKeys=true,keyProperty="id") int insert(HighOilCardContactRecord record); @@ -59,6 +61,7 @@ public interface HighOilCardContactRecordMapper extends HighOilCardContactRecord @Results({ @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), @Result(column="oil_card_id", property="oilCardId", jdbcType=JdbcType.BIGINT), + @Result(column="card_no", property="cardNo", jdbcType=JdbcType.VARCHAR), @Result(column="content", property="content", jdbcType=JdbcType.VARCHAR), @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), @@ -72,14 +75,15 @@ public interface HighOilCardContactRecordMapper extends HighOilCardContactRecord @Select({ "select", - "id, oil_card_id, content, `status`, create_time, op_user_id, op_user_name, ext_1, ", - "ext_2, ext_3", + "id, oil_card_id, card_no, content, `status`, create_time, op_user_id, op_user_name, ", + "ext_1, ext_2, ext_3", "from high_oil_card_contact_record", "where id = #{id,jdbcType=BIGINT}" }) @Results({ @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), @Result(column="oil_card_id", property="oilCardId", jdbcType=JdbcType.BIGINT), + @Result(column="card_no", property="cardNo", jdbcType=JdbcType.VARCHAR), @Result(column="content", property="content", jdbcType=JdbcType.VARCHAR), @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), @@ -103,6 +107,7 @@ public interface HighOilCardContactRecordMapper extends HighOilCardContactRecord @Update({ "update high_oil_card_contact_record", "set oil_card_id = #{oilCardId,jdbcType=BIGINT},", + "card_no = #{cardNo,jdbcType=VARCHAR},", "content = #{content,jdbcType=VARCHAR},", "`status` = #{status,jdbcType=INTEGER},", "create_time = #{createTime,jdbcType=TIMESTAMP},", diff --git a/hai-service/src/main/java/com/hai/dao/HighOilCardContactRecordSqlProvider.java b/hai-service/src/main/java/com/hai/dao/HighOilCardContactRecordSqlProvider.java index d956ce7f..5fa3d698 100644 --- a/hai-service/src/main/java/com/hai/dao/HighOilCardContactRecordSqlProvider.java +++ b/hai-service/src/main/java/com/hai/dao/HighOilCardContactRecordSqlProvider.java @@ -32,6 +32,10 @@ public class HighOilCardContactRecordSqlProvider { sql.VALUES("oil_card_id", "#{oilCardId,jdbcType=BIGINT}"); } + if (record.getCardNo() != null) { + sql.VALUES("card_no", "#{cardNo,jdbcType=VARCHAR}"); + } + if (record.getContent() != null) { sql.VALUES("content", "#{content,jdbcType=VARCHAR}"); } @@ -75,6 +79,7 @@ public class HighOilCardContactRecordSqlProvider { sql.SELECT("id"); } sql.SELECT("oil_card_id"); + sql.SELECT("card_no"); sql.SELECT("content"); sql.SELECT("`status`"); sql.SELECT("create_time"); @@ -108,6 +113,10 @@ public class HighOilCardContactRecordSqlProvider { sql.SET("oil_card_id = #{record.oilCardId,jdbcType=BIGINT}"); } + if (record.getCardNo() != null) { + sql.SET("card_no = #{record.cardNo,jdbcType=VARCHAR}"); + } + if (record.getContent() != null) { sql.SET("content = #{record.content,jdbcType=VARCHAR}"); } @@ -150,6 +159,7 @@ public class HighOilCardContactRecordSqlProvider { sql.SET("id = #{record.id,jdbcType=BIGINT}"); sql.SET("oil_card_id = #{record.oilCardId,jdbcType=BIGINT}"); + sql.SET("card_no = #{record.cardNo,jdbcType=VARCHAR}"); sql.SET("content = #{record.content,jdbcType=VARCHAR}"); sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); @@ -172,6 +182,10 @@ public class HighOilCardContactRecordSqlProvider { sql.SET("oil_card_id = #{oilCardId,jdbcType=BIGINT}"); } + if (record.getCardNo() != null) { + sql.SET("card_no = #{cardNo,jdbcType=VARCHAR}"); + } + if (record.getContent() != null) { sql.SET("content = #{content,jdbcType=VARCHAR}"); } diff --git a/hai-service/src/main/java/com/hai/dao/HighOilCardMapper.java b/hai-service/src/main/java/com/hai/dao/HighOilCardMapper.java index 8de4b54e..e2a563ca 100644 --- a/hai-service/src/main/java/com/hai/dao/HighOilCardMapper.java +++ b/hai-service/src/main/java/com/hai/dao/HighOilCardMapper.java @@ -41,20 +41,22 @@ public interface HighOilCardMapper extends HighOilCardMapperExt { @Insert({ "insert into high_oil_card (company_id, company_name, ", "org_id, org_name, card_no, ", - "amount, contact_name, ", - "contact_phone, `status`, ", - "bind_status, bind_time, ", - "create_time, update_time, ", - "op_user_id, op_user_name, ", - "ext_1, ext_2, ext_3)", + "amount, amount_consume, ", + "contact_name, contact_phone, ", + "`status`, bind_status, ", + "bind_time, create_time, ", + "update_time, op_user_id, ", + "op_user_name, ext_1, ", + "ext_2, ext_3)", "values (#{companyId,jdbcType=BIGINT}, #{companyName,jdbcType=VARCHAR}, ", "#{orgId,jdbcType=BIGINT}, #{orgName,jdbcType=VARCHAR}, #{cardNo,jdbcType=VARCHAR}, ", - "#{amount,jdbcType=DECIMAL}, #{contactName,jdbcType=VARCHAR}, ", - "#{contactPhone,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ", - "#{bindStatus,jdbcType=INTEGER}, #{bindTime,jdbcType=TIMESTAMP}, ", - "#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ", - "#{opUserId,jdbcType=BIGINT}, #{opUserName,jdbcType=VARCHAR}, ", - "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" + "#{amount,jdbcType=DECIMAL}, #{amountConsume,jdbcType=DECIMAL}, ", + "#{contactName,jdbcType=VARCHAR}, #{contactPhone,jdbcType=VARCHAR}, ", + "#{status,jdbcType=INTEGER}, #{bindStatus,jdbcType=INTEGER}, ", + "#{bindTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP}, ", + "#{updateTime,jdbcType=TIMESTAMP}, #{opUserId,jdbcType=BIGINT}, ", + "#{opUserName,jdbcType=VARCHAR}, #{ext1,jdbcType=VARCHAR}, ", + "#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" }) @Options(useGeneratedKeys=true,keyProperty="id") int insert(HighOilCard record); @@ -72,6 +74,7 @@ public interface HighOilCardMapper extends HighOilCardMapperExt { @Result(column="org_name", property="orgName", jdbcType=JdbcType.VARCHAR), @Result(column="card_no", property="cardNo", jdbcType=JdbcType.VARCHAR), @Result(column="amount", property="amount", jdbcType=JdbcType.DECIMAL), + @Result(column="amount_consume", property="amountConsume", jdbcType=JdbcType.DECIMAL), @Result(column="contact_name", property="contactName", jdbcType=JdbcType.VARCHAR), @Result(column="contact_phone", property="contactPhone", jdbcType=JdbcType.VARCHAR), @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), @@ -89,9 +92,9 @@ public interface HighOilCardMapper extends HighOilCardMapperExt { @Select({ "select", - "id, company_id, company_name, org_id, org_name, card_no, amount, contact_name, ", - "contact_phone, `status`, bind_status, bind_time, create_time, update_time, op_user_id, ", - "op_user_name, ext_1, ext_2, ext_3", + "id, company_id, company_name, org_id, org_name, card_no, amount, amount_consume, ", + "contact_name, contact_phone, `status`, bind_status, bind_time, create_time, ", + "update_time, op_user_id, op_user_name, ext_1, ext_2, ext_3", "from high_oil_card", "where id = #{id,jdbcType=BIGINT}" }) @@ -103,6 +106,7 @@ public interface HighOilCardMapper extends HighOilCardMapperExt { @Result(column="org_name", property="orgName", jdbcType=JdbcType.VARCHAR), @Result(column="card_no", property="cardNo", jdbcType=JdbcType.VARCHAR), @Result(column="amount", property="amount", jdbcType=JdbcType.DECIMAL), + @Result(column="amount_consume", property="amountConsume", jdbcType=JdbcType.DECIMAL), @Result(column="contact_name", property="contactName", jdbcType=JdbcType.VARCHAR), @Result(column="contact_phone", property="contactPhone", jdbcType=JdbcType.VARCHAR), @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), @@ -135,6 +139,7 @@ public interface HighOilCardMapper extends HighOilCardMapperExt { "org_name = #{orgName,jdbcType=VARCHAR},", "card_no = #{cardNo,jdbcType=VARCHAR},", "amount = #{amount,jdbcType=DECIMAL},", + "amount_consume = #{amountConsume,jdbcType=DECIMAL},", "contact_name = #{contactName,jdbcType=VARCHAR},", "contact_phone = #{contactPhone,jdbcType=VARCHAR},", "`status` = #{status,jdbcType=INTEGER},", diff --git a/hai-service/src/main/java/com/hai/dao/HighOilCardMapperExt.java b/hai-service/src/main/java/com/hai/dao/HighOilCardMapperExt.java index 4ce0aa9c..c5c3767b 100644 --- a/hai-service/src/main/java/com/hai/dao/HighOilCardMapperExt.java +++ b/hai-service/src/main/java/com/hai/dao/HighOilCardMapperExt.java @@ -20,6 +20,7 @@ public interface HighOilCardMapperExt { "org_name, " + "card_no, " + "amount," + + "amount_consume," + "contact_name, " + "contact_phone," + "status," + @@ -39,6 +40,7 @@ public interface HighOilCardMapperExt { " #{item.orgName,jdbcType=VARCHAR}," + " #{item.cardNo,jdbcType=VARCHAR}," + " #{item.amount,jdbcType=DECIMAL}, " + + " #{item.amountConsume,jdbcType=DECIMAL}, " + " #{item.contactName,jdbcType=VARCHAR}," + " #{item.contactPhone,jdbcType=VARCHAR}, " + " #{item.status,jdbcType=INTEGER}," + diff --git a/hai-service/src/main/java/com/hai/dao/HighOilCardRecordMapper.java b/hai-service/src/main/java/com/hai/dao/HighOilCardRecordMapper.java index 2f1565c9..4e60776f 100644 --- a/hai-service/src/main/java/com/hai/dao/HighOilCardRecordMapper.java +++ b/hai-service/src/main/java/com/hai/dao/HighOilCardRecordMapper.java @@ -39,15 +39,15 @@ public interface HighOilCardRecordMapper extends HighOilCardRecordMapperExt { int deleteByPrimaryKey(Long id); @Insert({ - "insert into high_oil_card_record (oil_card_id, `type`, ", - "amount, before_amount, ", + "insert into high_oil_card_record (oil_card_id, card_no, ", + "`type`, amount, before_amount, ", "after_amount, source_type, ", "source_id, source_content, ", "`status`, create_time, ", "op_user_id, op_user_name, ", "ext_1, ext_2, ext_3)", - "values (#{oilCardId,jdbcType=BIGINT}, #{type,jdbcType=INTEGER}, ", - "#{amount,jdbcType=DECIMAL}, #{beforeAmount,jdbcType=DECIMAL}, ", + "values (#{oilCardId,jdbcType=BIGINT}, #{cardNo,jdbcType=VARCHAR}, ", + "#{type,jdbcType=INTEGER}, #{amount,jdbcType=DECIMAL}, #{beforeAmount,jdbcType=DECIMAL}, ", "#{afterAmount,jdbcType=DECIMAL}, #{sourceType,jdbcType=INTEGER}, ", "#{sourceId,jdbcType=BIGINT}, #{sourceContent,jdbcType=VARCHAR}, ", "#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ", @@ -65,6 +65,7 @@ public interface HighOilCardRecordMapper extends HighOilCardRecordMapperExt { @Results({ @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), @Result(column="oil_card_id", property="oilCardId", jdbcType=JdbcType.BIGINT), + @Result(column="card_no", property="cardNo", jdbcType=JdbcType.VARCHAR), @Result(column="type", property="type", jdbcType=JdbcType.INTEGER), @Result(column="amount", property="amount", jdbcType=JdbcType.DECIMAL), @Result(column="before_amount", property="beforeAmount", jdbcType=JdbcType.DECIMAL), @@ -84,15 +85,16 @@ public interface HighOilCardRecordMapper extends HighOilCardRecordMapperExt { @Select({ "select", - "id, oil_card_id, `type`, amount, before_amount, after_amount, source_type, source_id, ", - "source_content, `status`, create_time, op_user_id, op_user_name, ext_1, ext_2, ", - "ext_3", + "id, oil_card_id, card_no, `type`, amount, before_amount, after_amount, source_type, ", + "source_id, source_content, `status`, create_time, op_user_id, op_user_name, ", + "ext_1, ext_2, ext_3", "from high_oil_card_record", "where id = #{id,jdbcType=BIGINT}" }) @Results({ @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), @Result(column="oil_card_id", property="oilCardId", jdbcType=JdbcType.BIGINT), + @Result(column="card_no", property="cardNo", jdbcType=JdbcType.VARCHAR), @Result(column="type", property="type", jdbcType=JdbcType.INTEGER), @Result(column="amount", property="amount", jdbcType=JdbcType.DECIMAL), @Result(column="before_amount", property="beforeAmount", jdbcType=JdbcType.DECIMAL), @@ -122,6 +124,7 @@ public interface HighOilCardRecordMapper extends HighOilCardRecordMapperExt { @Update({ "update high_oil_card_record", "set oil_card_id = #{oilCardId,jdbcType=BIGINT},", + "card_no = #{cardNo,jdbcType=VARCHAR},", "`type` = #{type,jdbcType=INTEGER},", "amount = #{amount,jdbcType=DECIMAL},", "before_amount = #{beforeAmount,jdbcType=DECIMAL},", diff --git a/hai-service/src/main/java/com/hai/dao/HighOilCardRecordSqlProvider.java b/hai-service/src/main/java/com/hai/dao/HighOilCardRecordSqlProvider.java index 96116428..70e5ce48 100644 --- a/hai-service/src/main/java/com/hai/dao/HighOilCardRecordSqlProvider.java +++ b/hai-service/src/main/java/com/hai/dao/HighOilCardRecordSqlProvider.java @@ -32,6 +32,10 @@ public class HighOilCardRecordSqlProvider { sql.VALUES("oil_card_id", "#{oilCardId,jdbcType=BIGINT}"); } + if (record.getCardNo() != null) { + sql.VALUES("card_no", "#{cardNo,jdbcType=VARCHAR}"); + } + if (record.getType() != null) { sql.VALUES("`type`", "#{type,jdbcType=INTEGER}"); } @@ -99,6 +103,7 @@ public class HighOilCardRecordSqlProvider { sql.SELECT("id"); } sql.SELECT("oil_card_id"); + sql.SELECT("card_no"); sql.SELECT("`type`"); sql.SELECT("amount"); sql.SELECT("before_amount"); @@ -138,6 +143,10 @@ public class HighOilCardRecordSqlProvider { sql.SET("oil_card_id = #{record.oilCardId,jdbcType=BIGINT}"); } + if (record.getCardNo() != null) { + sql.SET("card_no = #{record.cardNo,jdbcType=VARCHAR}"); + } + if (record.getType() != null) { sql.SET("`type` = #{record.type,jdbcType=INTEGER}"); } @@ -204,6 +213,7 @@ public class HighOilCardRecordSqlProvider { sql.SET("id = #{record.id,jdbcType=BIGINT}"); sql.SET("oil_card_id = #{record.oilCardId,jdbcType=BIGINT}"); + sql.SET("card_no = #{record.cardNo,jdbcType=VARCHAR}"); sql.SET("`type` = #{record.type,jdbcType=INTEGER}"); sql.SET("amount = #{record.amount,jdbcType=DECIMAL}"); sql.SET("before_amount = #{record.beforeAmount,jdbcType=DECIMAL}"); @@ -232,6 +242,10 @@ public class HighOilCardRecordSqlProvider { sql.SET("oil_card_id = #{oilCardId,jdbcType=BIGINT}"); } + if (record.getCardNo() != null) { + sql.SET("card_no = #{cardNo,jdbcType=VARCHAR}"); + } + if (record.getType() != null) { sql.SET("`type` = #{type,jdbcType=INTEGER}"); } diff --git a/hai-service/src/main/java/com/hai/dao/HighOilCardSqlProvider.java b/hai-service/src/main/java/com/hai/dao/HighOilCardSqlProvider.java index a2398f3b..18184a00 100644 --- a/hai-service/src/main/java/com/hai/dao/HighOilCardSqlProvider.java +++ b/hai-service/src/main/java/com/hai/dao/HighOilCardSqlProvider.java @@ -52,6 +52,10 @@ public class HighOilCardSqlProvider { sql.VALUES("amount", "#{amount,jdbcType=DECIMAL}"); } + if (record.getAmountConsume() != null) { + sql.VALUES("amount_consume", "#{amountConsume,jdbcType=DECIMAL}"); + } + if (record.getContactName() != null) { sql.VALUES("contact_name", "#{contactName,jdbcType=VARCHAR}"); } @@ -116,6 +120,7 @@ public class HighOilCardSqlProvider { sql.SELECT("org_name"); sql.SELECT("card_no"); sql.SELECT("amount"); + sql.SELECT("amount_consume"); sql.SELECT("contact_name"); sql.SELECT("contact_phone"); sql.SELECT("`status`"); @@ -173,6 +178,10 @@ public class HighOilCardSqlProvider { sql.SET("amount = #{record.amount,jdbcType=DECIMAL}"); } + if (record.getAmountConsume() != null) { + sql.SET("amount_consume = #{record.amountConsume,jdbcType=DECIMAL}"); + } + if (record.getContactName() != null) { sql.SET("contact_name = #{record.contactName,jdbcType=VARCHAR}"); } @@ -236,6 +245,7 @@ public class HighOilCardSqlProvider { sql.SET("org_name = #{record.orgName,jdbcType=VARCHAR}"); sql.SET("card_no = #{record.cardNo,jdbcType=VARCHAR}"); sql.SET("amount = #{record.amount,jdbcType=DECIMAL}"); + sql.SET("amount_consume = #{record.amountConsume,jdbcType=DECIMAL}"); sql.SET("contact_name = #{record.contactName,jdbcType=VARCHAR}"); sql.SET("contact_phone = #{record.contactPhone,jdbcType=VARCHAR}"); sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); @@ -282,6 +292,10 @@ public class HighOilCardSqlProvider { sql.SET("amount = #{amount,jdbcType=DECIMAL}"); } + if (record.getAmountConsume() != null) { + sql.SET("amount_consume = #{amountConsume,jdbcType=DECIMAL}"); + } + if (record.getContactName() != null) { sql.SET("contact_name = #{contactName,jdbcType=VARCHAR}"); } diff --git a/hai-service/src/main/java/com/hai/entity/HighOilCard.java b/hai-service/src/main/java/com/hai/entity/HighOilCard.java index 877adb6e..4d667f71 100644 --- a/hai-service/src/main/java/com/hai/entity/HighOilCard.java +++ b/hai-service/src/main/java/com/hai/entity/HighOilCard.java @@ -46,6 +46,11 @@ public class HighOilCard implements Serializable { */ private BigDecimal amount; + /** + * 消费金额 + */ + private BigDecimal amountConsume; + /** * 联系人姓名 */ @@ -155,6 +160,14 @@ public class HighOilCard implements Serializable { this.amount = amount; } + public BigDecimal getAmountConsume() { + return amountConsume; + } + + public void setAmountConsume(BigDecimal amountConsume) { + this.amountConsume = amountConsume; + } + public String getContactName() { return contactName; } @@ -270,6 +283,7 @@ public class HighOilCard implements Serializable { && (this.getOrgName() == null ? other.getOrgName() == null : this.getOrgName().equals(other.getOrgName())) && (this.getCardNo() == null ? other.getCardNo() == null : this.getCardNo().equals(other.getCardNo())) && (this.getAmount() == null ? other.getAmount() == null : this.getAmount().equals(other.getAmount())) + && (this.getAmountConsume() == null ? other.getAmountConsume() == null : this.getAmountConsume().equals(other.getAmountConsume())) && (this.getContactName() == null ? other.getContactName() == null : this.getContactName().equals(other.getContactName())) && (this.getContactPhone() == null ? other.getContactPhone() == null : this.getContactPhone().equals(other.getContactPhone())) && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) @@ -295,6 +309,7 @@ public class HighOilCard implements Serializable { result = prime * result + ((getOrgName() == null) ? 0 : getOrgName().hashCode()); result = prime * result + ((getCardNo() == null) ? 0 : getCardNo().hashCode()); result = prime * result + ((getAmount() == null) ? 0 : getAmount().hashCode()); + result = prime * result + ((getAmountConsume() == null) ? 0 : getAmountConsume().hashCode()); result = prime * result + ((getContactName() == null) ? 0 : getContactName().hashCode()); result = prime * result + ((getContactPhone() == null) ? 0 : getContactPhone().hashCode()); result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); @@ -323,6 +338,7 @@ public class HighOilCard implements Serializable { sb.append(", orgName=").append(orgName); sb.append(", cardNo=").append(cardNo); sb.append(", amount=").append(amount); + sb.append(", amountConsume=").append(amountConsume); sb.append(", contactName=").append(contactName); sb.append(", contactPhone=").append(contactPhone); sb.append(", status=").append(status); diff --git a/hai-service/src/main/java/com/hai/entity/HighOilCardContactRecord.java b/hai-service/src/main/java/com/hai/entity/HighOilCardContactRecord.java index 5a61cd58..0a36e397 100644 --- a/hai-service/src/main/java/com/hai/entity/HighOilCardContactRecord.java +++ b/hai-service/src/main/java/com/hai/entity/HighOilCardContactRecord.java @@ -20,6 +20,11 @@ public class HighOilCardContactRecord implements Serializable { */ private Long oilCardId; + /** + * 油卡卡号 + */ + private String cardNo; + /** * 内容 */ @@ -69,6 +74,14 @@ public class HighOilCardContactRecord implements Serializable { this.oilCardId = oilCardId; } + public String getCardNo() { + return cardNo; + } + + public void setCardNo(String cardNo) { + this.cardNo = cardNo; + } + public String getContent() { return content; } @@ -147,6 +160,7 @@ public class HighOilCardContactRecord implements Serializable { HighOilCardContactRecord other = (HighOilCardContactRecord) that; return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) && (this.getOilCardId() == null ? other.getOilCardId() == null : this.getOilCardId().equals(other.getOilCardId())) + && (this.getCardNo() == null ? other.getCardNo() == null : this.getCardNo().equals(other.getCardNo())) && (this.getContent() == null ? other.getContent() == null : this.getContent().equals(other.getContent())) && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) @@ -163,6 +177,7 @@ public class HighOilCardContactRecord implements Serializable { int result = 1; result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); result = prime * result + ((getOilCardId() == null) ? 0 : getOilCardId().hashCode()); + result = prime * result + ((getCardNo() == null) ? 0 : getCardNo().hashCode()); result = prime * result + ((getContent() == null) ? 0 : getContent().hashCode()); result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); @@ -182,6 +197,7 @@ public class HighOilCardContactRecord implements Serializable { sb.append("Hash = ").append(hashCode()); sb.append(", id=").append(id); sb.append(", oilCardId=").append(oilCardId); + sb.append(", cardNo=").append(cardNo); sb.append(", content=").append(content); sb.append(", status=").append(status); sb.append(", createTime=").append(createTime); diff --git a/hai-service/src/main/java/com/hai/entity/HighOilCardContactRecordExample.java b/hai-service/src/main/java/com/hai/entity/HighOilCardContactRecordExample.java index 4d7bd978..52618726 100644 --- a/hai-service/src/main/java/com/hai/entity/HighOilCardContactRecordExample.java +++ b/hai-service/src/main/java/com/hai/entity/HighOilCardContactRecordExample.java @@ -245,6 +245,76 @@ public class HighOilCardContactRecordExample { return (Criteria) this; } + public Criteria andCardNoIsNull() { + addCriterion("card_no is null"); + return (Criteria) this; + } + + public Criteria andCardNoIsNotNull() { + addCriterion("card_no is not null"); + return (Criteria) this; + } + + public Criteria andCardNoEqualTo(String value) { + addCriterion("card_no =", value, "cardNo"); + return (Criteria) this; + } + + public Criteria andCardNoNotEqualTo(String value) { + addCriterion("card_no <>", value, "cardNo"); + return (Criteria) this; + } + + public Criteria andCardNoGreaterThan(String value) { + addCriterion("card_no >", value, "cardNo"); + return (Criteria) this; + } + + public Criteria andCardNoGreaterThanOrEqualTo(String value) { + addCriterion("card_no >=", value, "cardNo"); + return (Criteria) this; + } + + public Criteria andCardNoLessThan(String value) { + addCriterion("card_no <", value, "cardNo"); + return (Criteria) this; + } + + public Criteria andCardNoLessThanOrEqualTo(String value) { + addCriterion("card_no <=", value, "cardNo"); + return (Criteria) this; + } + + public Criteria andCardNoLike(String value) { + addCriterion("card_no like", value, "cardNo"); + return (Criteria) this; + } + + public Criteria andCardNoNotLike(String value) { + addCriterion("card_no not like", value, "cardNo"); + return (Criteria) this; + } + + public Criteria andCardNoIn(List values) { + addCriterion("card_no in", values, "cardNo"); + return (Criteria) this; + } + + public Criteria andCardNoNotIn(List values) { + addCriterion("card_no not in", values, "cardNo"); + return (Criteria) this; + } + + public Criteria andCardNoBetween(String value1, String value2) { + addCriterion("card_no between", value1, value2, "cardNo"); + return (Criteria) this; + } + + public Criteria andCardNoNotBetween(String value1, String value2) { + addCriterion("card_no not between", value1, value2, "cardNo"); + return (Criteria) this; + } + public Criteria andContentIsNull() { addCriterion("content is null"); return (Criteria) this; diff --git a/hai-service/src/main/java/com/hai/entity/HighOilCardExample.java b/hai-service/src/main/java/com/hai/entity/HighOilCardExample.java index b526a37b..82478253 100644 --- a/hai-service/src/main/java/com/hai/entity/HighOilCardExample.java +++ b/hai-service/src/main/java/com/hai/entity/HighOilCardExample.java @@ -576,6 +576,66 @@ public class HighOilCardExample { return (Criteria) this; } + public Criteria andAmountConsumeIsNull() { + addCriterion("amount_consume is null"); + return (Criteria) this; + } + + public Criteria andAmountConsumeIsNotNull() { + addCriterion("amount_consume is not null"); + return (Criteria) this; + } + + public Criteria andAmountConsumeEqualTo(BigDecimal value) { + addCriterion("amount_consume =", value, "amountConsume"); + return (Criteria) this; + } + + public Criteria andAmountConsumeNotEqualTo(BigDecimal value) { + addCriterion("amount_consume <>", value, "amountConsume"); + return (Criteria) this; + } + + public Criteria andAmountConsumeGreaterThan(BigDecimal value) { + addCriterion("amount_consume >", value, "amountConsume"); + return (Criteria) this; + } + + public Criteria andAmountConsumeGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("amount_consume >=", value, "amountConsume"); + return (Criteria) this; + } + + public Criteria andAmountConsumeLessThan(BigDecimal value) { + addCriterion("amount_consume <", value, "amountConsume"); + return (Criteria) this; + } + + public Criteria andAmountConsumeLessThanOrEqualTo(BigDecimal value) { + addCriterion("amount_consume <=", value, "amountConsume"); + return (Criteria) this; + } + + public Criteria andAmountConsumeIn(List values) { + addCriterion("amount_consume in", values, "amountConsume"); + return (Criteria) this; + } + + public Criteria andAmountConsumeNotIn(List values) { + addCriterion("amount_consume not in", values, "amountConsume"); + return (Criteria) this; + } + + public Criteria andAmountConsumeBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("amount_consume between", value1, value2, "amountConsume"); + return (Criteria) this; + } + + public Criteria andAmountConsumeNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("amount_consume not between", value1, value2, "amountConsume"); + return (Criteria) this; + } + public Criteria andContactNameIsNull() { addCriterion("contact_name is null"); return (Criteria) this; diff --git a/hai-service/src/main/java/com/hai/entity/HighOilCardRecord.java b/hai-service/src/main/java/com/hai/entity/HighOilCardRecord.java index 922018ed..15934382 100644 --- a/hai-service/src/main/java/com/hai/entity/HighOilCardRecord.java +++ b/hai-service/src/main/java/com/hai/entity/HighOilCardRecord.java @@ -21,6 +21,11 @@ public class HighOilCardRecord implements Serializable { */ private Long oilCardId; + /** + * 油卡卡号 + */ + private String cardNo; + /** * 类型 1:进账 2:出账 */ @@ -42,7 +47,7 @@ public class HighOilCardRecord implements Serializable { private BigDecimal afterAmount; /** - * 来源类型 1. 金额充值 2. 消费订单 + * 来源类型 1. 充值金额 2. 订单消费 */ private Integer sourceType; @@ -100,6 +105,14 @@ public class HighOilCardRecord implements Serializable { this.oilCardId = oilCardId; } + public String getCardNo() { + return cardNo; + } + + public void setCardNo(String cardNo) { + this.cardNo = cardNo; + } + public Integer getType() { return type; } @@ -226,6 +239,7 @@ public class HighOilCardRecord implements Serializable { HighOilCardRecord other = (HighOilCardRecord) that; return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) && (this.getOilCardId() == null ? other.getOilCardId() == null : this.getOilCardId().equals(other.getOilCardId())) + && (this.getCardNo() == null ? other.getCardNo() == null : this.getCardNo().equals(other.getCardNo())) && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType())) && (this.getAmount() == null ? other.getAmount() == null : this.getAmount().equals(other.getAmount())) && (this.getBeforeAmount() == null ? other.getBeforeAmount() == null : this.getBeforeAmount().equals(other.getBeforeAmount())) @@ -248,6 +262,7 @@ public class HighOilCardRecord implements Serializable { int result = 1; result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); result = prime * result + ((getOilCardId() == null) ? 0 : getOilCardId().hashCode()); + result = prime * result + ((getCardNo() == null) ? 0 : getCardNo().hashCode()); result = prime * result + ((getType() == null) ? 0 : getType().hashCode()); result = prime * result + ((getAmount() == null) ? 0 : getAmount().hashCode()); result = prime * result + ((getBeforeAmount() == null) ? 0 : getBeforeAmount().hashCode()); @@ -273,6 +288,7 @@ public class HighOilCardRecord implements Serializable { sb.append("Hash = ").append(hashCode()); sb.append(", id=").append(id); sb.append(", oilCardId=").append(oilCardId); + sb.append(", cardNo=").append(cardNo); sb.append(", type=").append(type); sb.append(", amount=").append(amount); sb.append(", beforeAmount=").append(beforeAmount); diff --git a/hai-service/src/main/java/com/hai/entity/HighOilCardRecordExample.java b/hai-service/src/main/java/com/hai/entity/HighOilCardRecordExample.java index 4ed177c7..8ce4c561 100644 --- a/hai-service/src/main/java/com/hai/entity/HighOilCardRecordExample.java +++ b/hai-service/src/main/java/com/hai/entity/HighOilCardRecordExample.java @@ -246,6 +246,76 @@ public class HighOilCardRecordExample { return (Criteria) this; } + public Criteria andCardNoIsNull() { + addCriterion("card_no is null"); + return (Criteria) this; + } + + public Criteria andCardNoIsNotNull() { + addCriterion("card_no is not null"); + return (Criteria) this; + } + + public Criteria andCardNoEqualTo(String value) { + addCriterion("card_no =", value, "cardNo"); + return (Criteria) this; + } + + public Criteria andCardNoNotEqualTo(String value) { + addCriterion("card_no <>", value, "cardNo"); + return (Criteria) this; + } + + public Criteria andCardNoGreaterThan(String value) { + addCriterion("card_no >", value, "cardNo"); + return (Criteria) this; + } + + public Criteria andCardNoGreaterThanOrEqualTo(String value) { + addCriterion("card_no >=", value, "cardNo"); + return (Criteria) this; + } + + public Criteria andCardNoLessThan(String value) { + addCriterion("card_no <", value, "cardNo"); + return (Criteria) this; + } + + public Criteria andCardNoLessThanOrEqualTo(String value) { + addCriterion("card_no <=", value, "cardNo"); + return (Criteria) this; + } + + public Criteria andCardNoLike(String value) { + addCriterion("card_no like", value, "cardNo"); + return (Criteria) this; + } + + public Criteria andCardNoNotLike(String value) { + addCriterion("card_no not like", value, "cardNo"); + return (Criteria) this; + } + + public Criteria andCardNoIn(List values) { + addCriterion("card_no in", values, "cardNo"); + return (Criteria) this; + } + + public Criteria andCardNoNotIn(List values) { + addCriterion("card_no not in", values, "cardNo"); + return (Criteria) this; + } + + public Criteria andCardNoBetween(String value1, String value2) { + addCriterion("card_no between", value1, value2, "cardNo"); + return (Criteria) this; + } + + public Criteria andCardNoNotBetween(String value1, String value2) { + addCriterion("card_no not between", value1, value2, "cardNo"); + return (Criteria) this; + } + public Criteria andTypeIsNull() { addCriterion("`type` is null"); return (Criteria) this; diff --git a/hai-service/src/main/java/com/hai/service/HighOilCardContactRecordService.java b/hai-service/src/main/java/com/hai/service/HighOilCardContactRecordService.java index aefb7e0c..048c5278 100644 --- a/hai-service/src/main/java/com/hai/service/HighOilCardContactRecordService.java +++ b/hai-service/src/main/java/com/hai/service/HighOilCardContactRecordService.java @@ -16,7 +16,7 @@ public interface HighOilCardContactRecordService { * @param oilCardId * @param content */ - void insert(Long oilCardId,String content); + void insert(Long oilCardId,String oilCardNo, String content); /** * 查询记录列表 diff --git a/hai-service/src/main/java/com/hai/service/impl/HighOilCardContactRecordServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighOilCardContactRecordServiceImpl.java index 341c6c66..98665225 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighOilCardContactRecordServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighOilCardContactRecordServiceImpl.java @@ -7,6 +7,7 @@ import com.hai.entity.HighOilCardContactRecordExample; import com.hai.model.UserInfoModel; import com.hai.service.HighOilCardContactRecordService; import org.apache.commons.collections4.MapUtils; +import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import javax.annotation.Resource; @@ -24,11 +25,12 @@ public class HighOilCardContactRecordServiceImpl implements HighOilCardContactRe private UserCenter userCenter; @Override - public void insert(Long oilCardId, String content) { + public void insert(Long oilCardId, String oilCardNo , String content) { UserInfoModel userInfoModel = userCenter.getSessionModel(UserInfoModel.class); HighOilCardContactRecord record = new HighOilCardContactRecord(); record.setOilCardId(oilCardId); + record.setCardNo(oilCardNo); record.setContent(content); record.setCreateTime(new Date()); record.setStatus(1); @@ -46,6 +48,18 @@ public class HighOilCardContactRecordServiceImpl implements HighOilCardContactRe criteria.andOilCardIdEqualTo(MapUtils.getLong(param, "oilCardId")); } + if (StringUtils.isNotBlank(MapUtils.getString(param, "cardNo"))) { + criteria.andCardNoEqualTo(MapUtils.getString(param, "cardNo")); + } + + if (MapUtils.getLong(param, "createTimeS") != null) { + criteria.andCreateTimeGreaterThanOrEqualTo(new Date(MapUtils.getLong(param, "createTimeS"))); + } + + if (MapUtils.getLong(param, "createTimeE") != null) { + criteria.andCreateTimeLessThanOrEqualTo(new Date(MapUtils.getLong(param, "createTimeE"))); + } + example.setOrderByClause("create_time desc"); return oilCardContactRecordMapper.selectByExample(example); } diff --git a/hai-service/src/main/java/com/hai/service/impl/HighOilCardRecordServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighOilCardRecordServiceImpl.java index 5118c5cb..0d3cf669 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighOilCardRecordServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighOilCardRecordServiceImpl.java @@ -7,6 +7,7 @@ import com.hai.entity.HighOilCardRecordExample; import com.hai.model.UserInfoModel; import com.hai.service.HighOilCardRecordService; import org.apache.commons.collections4.MapUtils; +import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import javax.annotation.Resource; @@ -39,18 +40,30 @@ public class HighOilCardRecordServiceImpl implements HighOilCardRecordService { HighOilCardRecordExample example = new HighOilCardRecordExample(); HighOilCardRecordExample.Criteria criteria = example.createCriteria().andStatusEqualTo(1); - if (MapUtils.getLong(map, "oilCardId") == null) { + if (MapUtils.getLong(map, "oilCardId") != null) { criteria.andOilCardIdEqualTo(MapUtils.getLong(map, "oilCardId")); } - if (MapUtils.getInteger(map, "type") == null) { + if (StringUtils.isNotBlank(MapUtils.getString(map, "cardNo"))) { + criteria.andCardNoEqualTo(MapUtils.getString(map, "cardNo")); + } + + if (MapUtils.getInteger(map, "type") != null) { criteria.andTypeEqualTo(MapUtils.getInteger(map, "type")); } - if (MapUtils.getInteger(map, "sourceType") == null) { + if (MapUtils.getInteger(map, "sourceType") != null) { criteria.andSourceTypeEqualTo(MapUtils.getInteger(map, "sourceType")); } + if (MapUtils.getLong(map, "createTimeS") != null) { + criteria.andCreateTimeGreaterThanOrEqualTo(new Date(MapUtils.getLong(map, "createTimeS"))); + } + + if (MapUtils.getLong(map, "createTimeE") != null) { + criteria.andCreateTimeLessThanOrEqualTo(new Date(MapUtils.getLong(map, "createTimeE"))); + } + example.setOrderByClause("create_time desc"); return oilCardRecordMapper.selectByExample(example); } diff --git a/hai-service/src/main/java/com/hai/service/impl/HighOilCardServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighOilCardServiceImpl.java index 7aa8d20a..f32d3557 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighOilCardServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighOilCardServiceImpl.java @@ -89,6 +89,7 @@ public class HighOilCardServiceImpl implements HighOilCardService { HighOilCardRecord record = new HighOilCardRecord(); record.setOilCardId(oilCard.getId()); + record.setCardNo(oilCard.getCardNo()); record.setType(OilCardRecordTypeEnum.type1.getType()); record.setAmount(price); record.setBeforeAmount(beforeAmount); @@ -118,6 +119,7 @@ public class HighOilCardServiceImpl implements HighOilCardService { oilCard.setOrgId(organization.getId()); oilCard.setOrgName(organization.getName()); oilCard.setAmount(new BigDecimal("0")); + oilCard.setAmountConsume(new BigDecimal("0")); oilCard.setCardNo(BankNumberUtil.getBrankNumber("8")); oilCard.setOpUserId(userInfoModel.getSecUser().getId()); oilCard.setOpUserName(userInfoModel.getSecUser().getUserName()); @@ -149,9 +151,9 @@ public class HighOilCardServiceImpl implements HighOilCardService { // 绑定状态 0:未绑定 1:已绑定 if (oilCard.getBindStatus() == 1) { - oilCardContactRecordService.insert(oilCard.getId(), "新设置:联系人【"+oilCard.getContactName()+"】,联系电话【"+oilCard.getContactPhone()+"】"); + oilCardContactRecordService.insert(oilCard.getId(), oilCard.getCardNo(), "新设置:联系人【"+oilCard.getContactName()+"】,联系电话【"+oilCard.getContactPhone()+"】"); } else { - oilCardContactRecordService.insert(oilCard.getId(), "联系信息变更:原来联系人【"+oilCard.getContactName()+"】,联系电话【"+oilCard.getContactPhone()+"】。" + + oilCardContactRecordService.insert(oilCard.getId(), oilCard.getCardNo(), "联系信息变更:原联系人【"+oilCard.getContactName()+"】,联系电话【"+oilCard.getContactPhone()+"】。" + "变跟后联系人【"+oilCard.getContactName()+ "】,联系电话【"+oilCard.getContactPhone()+"】"); } } @@ -169,7 +171,7 @@ public class HighOilCardServiceImpl implements HighOilCardService { oilCard.setStatus(OilCardStatusEnum.status2.getStatus()); editData(oilCard); - oilCardContactRecordService.insert(oilCard.getId(), "禁用油卡"); + oilCardContactRecordService.insert(oilCard.getId(), oilCard.getCardNo(), "禁用油卡"); } @Override @@ -185,7 +187,7 @@ public class HighOilCardServiceImpl implements HighOilCardService { oilCard.setStatus(OilCardStatusEnum.status1.getStatus()); editData(oilCard); - oilCardContactRecordService.insert(oilCard.getId(), "启用油卡"); + oilCardContactRecordService.insert(oilCard.getId(), oilCard.getCardNo(), "启用油卡"); } @Override