Pārlūkot izejas kodu

Merge remote-tracking branch 'origin/dev' into dev

liql 4 gadi atpakaļ
vecāks
revīzija
23b9e8f7a3
27 mainītis faili ar 1084 papildinājumiem un 420 dzēšanām
  1. 118 0
      carbon-back/carbon-back-common/src/main/java/com/hcloud/microserver/system/facade/carbon/entity/ProductTypePrice.java
  2. 27 0
      carbon-back/carbon-back-common/src/main/java/com/hcloud/microserver/system/facade/carbon/entity/ProductTypePriceWithBLOBs.java
  3. 36 0
      carbon-back/carbon-back-common/src/main/java/com/hcloud/microserver/system/facade/carbon/forms/ProductTypePriceForm.java
  4. 80 0
      carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/bank/controller/ProductTypePriceController.java
  5. 26 0
      carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/bank/dao/ProductTypePriceMapper.java
  6. 42 0
      carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/bank/events/ProductTypePriceEvent.java
  7. 25 0
      carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/bank/service/ProductTypePriceService.java
  8. 97 0
      carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/bank/service/impl/ProductTypePriceServiceImpl.java
  9. 239 0
      carbon-back/carbon-back-service/src/main/resources/carbon/ProductTypePriceMapper.xml
  10. 22 125
      carbon-h5/carbon-h5-common/src/main/java/com/hcloud/microserver/h5/facade/carbon/entity/GoodsOrderInfo.java
  11. 5 0
      carbon-h5/carbon-h5-common/src/main/java/com/hcloud/microserver/h5/facade/carbon/entity/from/CreateOrderDetailFrom.java
  12. 5 5
      carbon-h5/carbon-h5-service/src/main/java/com/hcloud/microserver/h5/config/Swagger2Config.java
  13. 4 3
      carbon-h5/carbon-h5-service/src/main/java/com/hcloud/microserver/h5/config/mq/listener/ReceiverMessage.java
  14. 2 2
      carbon-h5/carbon-h5-service/src/main/java/com/hcloud/microserver/h5/controller/web/CustomerController.java
  15. 0 1
      carbon-h5/carbon-h5-service/src/main/java/com/hcloud/microserver/h5/controller/web/FarmerManagerController.java
  16. 3 20
      carbon-h5/carbon-h5-service/src/main/java/com/hcloud/microserver/h5/controller/web/OrderManagerController.java
  17. 274 251
      carbon-h5/carbon-h5-service/src/main/java/com/hcloud/microserver/h5/controller/web/WechatAppController.java
  18. 1 5
      carbon-h5/carbon-h5-service/src/main/java/com/hcloud/microserver/h5/controller/web/WechatAppPayController.java
  19. 0 1
      carbon-h5/carbon-h5-service/src/main/java/com/hcloud/microserver/h5/controller/web/WechatManagerController.java
  20. 1 1
      carbon-h5/carbon-h5-service/src/main/java/com/hcloud/microserver/h5/dao/GoodsOrderInfoMapper.java
  21. 9 1
      carbon-h5/carbon-h5-service/src/main/java/com/hcloud/microserver/h5/entity/LoginRequest.java
  22. 6 1
      carbon-h5/carbon-h5-service/src/main/java/com/hcloud/microserver/h5/entity/WxPayFrom.java
  23. 4 0
      carbon-h5/carbon-h5-service/src/main/java/com/hcloud/microserver/h5/service/CustomerInfoService.java
  24. 7 0
      carbon-h5/carbon-h5-service/src/main/java/com/hcloud/microserver/h5/service/impl/CustomerInfoServiceImpl.java
  25. 11 2
      carbon-h5/carbon-h5-service/src/main/java/com/hcloud/microserver/h5/service/impl/OrderInfoServiceImpl.java
  26. 2 2
      carbon-h5/carbon-h5-service/src/main/resources/com/hcloud/microserver/h5/dao/GoodsOrderInfoMapper.xml
  27. 38 0
      common-core/src/main/java/com/hcloud/microserver/commoncore/base/BaseController.java

+ 118 - 0
carbon-back/carbon-back-common/src/main/java/com/hcloud/microserver/system/facade/carbon/entity/ProductTypePrice.java

@@ -0,0 +1,118 @@
+package com.hcloud.microserver.system.facade.carbon.entity;
+
+import javax.validation.constraints.NotNull;
+import java.math.BigDecimal;
+import java.util.Date;
+
+public class ProductTypePrice {
+    private String guid;
+
+    @NotNull(message = "定价不能为空!")
+    private BigDecimal price;
+
+    private String remark;
+
+    private Integer checkState;
+
+    private Date checkTime;
+
+    private String checkRemark;
+
+    private Integer state;
+
+    private String createUser;
+
+    private Date createTime;
+
+    private String modifiedUser;
+
+    private Date modifiedTime;
+
+    public String getGuid() {
+        return guid;
+    }
+
+    public void setGuid(String guid) {
+        this.guid = guid == null ? null : guid.trim();
+    }
+
+    public BigDecimal getPrice() {
+        return price;
+    }
+
+    public void setPrice(BigDecimal price) {
+        this.price = price;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark == null ? null : remark.trim();
+    }
+
+    public Integer getCheckState() {
+        return checkState;
+    }
+
+    public void setCheckState(Integer checkState) {
+        this.checkState = checkState;
+    }
+
+    public Date getCheckTime() {
+        return checkTime;
+    }
+
+    public void setCheckTime(Date checkTime) {
+        this.checkTime = checkTime;
+    }
+
+    public String getCheckRemark() {
+        return checkRemark;
+    }
+
+    public void setCheckRemark(String checkRemark) {
+        this.checkRemark = checkRemark == null ? null : checkRemark.trim();
+    }
+
+    public Integer getState() {
+        return state;
+    }
+
+    public void setState(Integer state) {
+        this.state = state;
+    }
+
+    public String getCreateUser() {
+        return createUser;
+    }
+
+    public void setCreateUser(String createUser) {
+        this.createUser = createUser == null ? null : createUser.trim();
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public String getModifiedUser() {
+        return modifiedUser;
+    }
+
+    public void setModifiedUser(String modifiedUser) {
+        this.modifiedUser = modifiedUser == null ? null : modifiedUser.trim();
+    }
+
+    public Date getModifiedTime() {
+        return modifiedTime;
+    }
+
+    public void setModifiedTime(Date modifiedTime) {
+        this.modifiedTime = modifiedTime;
+    }
+}

+ 27 - 0
carbon-back/carbon-back-common/src/main/java/com/hcloud/microserver/system/facade/carbon/entity/ProductTypePriceWithBLOBs.java

@@ -0,0 +1,27 @@
+package com.hcloud.microserver.system.facade.carbon.entity;
+
+import javax.validation.constraints.NotEmpty;
+
+public class ProductTypePriceWithBLOBs extends ProductTypePrice {
+    @NotEmpty(message = "类别id不能为空!")
+    private String fkProductType;
+
+    @NotEmpty(message = "类别不能为空!")
+    private String typeName;
+
+    public String getFkProductType() {
+        return fkProductType;
+    }
+
+    public void setFkProductType(String fkProductType) {
+        this.fkProductType = fkProductType == null ? null : fkProductType.trim();
+    }
+
+    public String getTypeName() {
+        return typeName;
+    }
+
+    public void setTypeName(String typeName) {
+        this.typeName = typeName == null ? null : typeName.trim();
+    }
+}

+ 36 - 0
carbon-back/carbon-back-common/src/main/java/com/hcloud/microserver/system/facade/carbon/forms/ProductTypePriceForm.java

@@ -0,0 +1,36 @@
+package com.hcloud.microserver.system.facade.carbon.forms;
+
+import com.hcloud.microserver.commoncore.base.BaseForm;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+@Data
+public class ProductTypePriceForm extends BaseForm {
+    private String guid;
+
+    private BigDecimal price;
+
+    private String remark;
+
+    private Integer checkState;
+
+    private Date checkTime;
+
+    private String checkRemark;
+
+    private Integer state;
+
+    private String createUser;
+
+    private Date createTime;
+
+    private String modifiedUser;
+
+    private Date modifiedTime;
+
+    private String fkProductType;
+
+    private String typeName;
+}

+ 80 - 0
carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/bank/controller/ProductTypePriceController.java

@@ -0,0 +1,80 @@
+package com.hcloud.microserver.system.bank.controller;
+
+import com.github.pagehelper.PageInfo;
+import com.hcloud.microserver.commoncore.base.BaseController;
+import com.hcloud.microserver.commoncore.base.ResponseBase;
+import com.hcloud.microserver.commoncore.enums.ResultEnum;
+import com.hcloud.microserver.commoncore.exception.GlobalException;
+import com.hcloud.microserver.system.bank.service.ProductTypePriceService;
+import com.hcloud.microserver.system.facade.carbon.entity.ProductTypePriceWithBLOBs;
+import com.hcloud.microserver.system.facade.carbon.forms.ProductTypePriceForm;
+import io.swagger.annotations.*;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.validation.Valid;
+
+@RestController
+@RequestMapping("/web/price")
+@Api(description = "定价管理")
+public class ProductTypePriceController extends BaseController {
+
+    @Autowired
+    private ProductTypePriceService productTypePriceService;
+
+    @ApiOperation(value = "类型定价添加")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "productTypePriceWithBLOBs",value = "类型定价信息",dataType = "ProductTypePriceWithBLOBs")
+    })
+    @ApiResponse(code = 0, message = "操作成功")
+    @PostMapping("/save")
+    private ResponseBase save(@RequestBody @Valid ProductTypePriceWithBLOBs productTypePriceWithBLOBs){
+        int i = productTypePriceService.saveSelective(productTypePriceWithBLOBs);
+        if (i < 1){
+            return responseResultFailure();
+        }
+        return responseResultSuccess();
+    }
+
+    @ApiOperation(value = "类型定价列表")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "productTypePriceForm",value = "类型定价信息",dataType = "ProductTypePriceForm")
+    })
+    @ApiResponse(code = 0, message = "操作成功")
+    @PostMapping("/list")
+    private ResponseBase list(@RequestBody ProductTypePriceForm form){
+        PageInfo pageInfo = productTypePriceService.selectList(form);
+        return responseSuccess(pageInfo);
+    }
+
+    @ApiOperation(value = "类型定价删除")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "guid",value = "主键",dataType = "String")
+    })
+    @ApiResponse(code = 0, message = "操作成功")
+    @GetMapping("/delete")
+    private ResponseBase delete(@RequestParam("guid") String guid){
+        int i = productTypePriceService.delByPrimaryKey(guid);
+        if (i < 1){
+            return responseResultFailure();
+        }
+        return responseResultSuccess();
+    }
+
+    @ApiOperation(value = "类型定价审核")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "productTypePriceWithBLOBs",value = "类型定价信息",dataType = "ProductTypePriceWithBLOBs")
+    })
+    @ApiResponse(code = 0, message = "操作成功")
+    @PostMapping("/check")
+    private ResponseBase check(@RequestBody ProductTypePriceWithBLOBs productTypePriceWithBLOBs){
+        if (productTypePriceWithBLOBs.getCheckState() < 1){
+            throw new GlobalException(ResultEnum.FAILURE.getCode(),"审核状态错误!");
+        }
+        int i = productTypePriceService.check(productTypePriceWithBLOBs);
+        if (i < 1){
+            return responseResultFailure();
+        }
+        return responseResultSuccess();
+    }
+}

+ 26 - 0
carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/bank/dao/ProductTypePriceMapper.java

@@ -0,0 +1,26 @@
+package com.hcloud.microserver.system.bank.dao;
+
+import com.hcloud.microserver.commoncore.base.BaseMapper;
+import com.hcloud.microserver.system.facade.carbon.entity.ProductTypePriceWithBLOBs;
+import com.hcloud.microserver.system.facade.carbon.forms.ProductTypePriceForm;
+
+import java.util.List;
+
+public interface ProductTypePriceMapper extends BaseMapper<ProductTypePriceWithBLOBs,String> {
+
+    /**
+     * 查询列表
+     * lym
+     * @param productTypePriceForm
+     * @return
+     */
+    List<ProductTypePriceWithBLOBs> selectList(ProductTypePriceForm productTypePriceForm);
+
+    /**
+     * 根据定价修改商品价格
+     * lym
+     * @param productTypePriceWithBLOBs
+     * @return
+     */
+    int updateGoodsInfoPrice(ProductTypePriceWithBLOBs productTypePriceWithBLOBs);
+}

+ 42 - 0
carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/bank/events/ProductTypePriceEvent.java

@@ -0,0 +1,42 @@
+package com.hcloud.microserver.system.bank.events;
+
+import com.hcloud.microserver.commoncore.util.string.StringUtils;
+import com.hcloud.microserver.system.bank.dao.ProductTypePriceMapper;
+import com.hcloud.microserver.system.facade.carbon.entity.ProductTypePriceWithBLOBs;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.scheduling.annotation.Async;
+import org.springframework.stereotype.Component;
+
+import javax.annotation.Resource;
+
+@Component
+public class ProductTypePriceEvent {
+
+    private Logger log = LoggerFactory.getLogger(ProductTypePriceEvent.class);
+
+    @Resource
+    private ProductTypePriceMapper productTypePriceMapper;
+
+    /**
+     * 根据定价修改商品价格
+     * lym
+     * @param productTypePriceGuid 类型定价ID
+     */
+    @Async
+    public void updateGoodsInfoPrice(String productTypePriceGuid){
+        ProductTypePriceWithBLOBs productTypePrice = productTypePriceMapper.selectByPrimaryKey(productTypePriceGuid);
+        if (productTypePrice.getCheckState() != 1) return; //审核不通过
+
+        //修改类别商品定价
+        String types = productTypePrice.getFkProductType();
+        if (StringUtils.isEmpty(types)){
+            log.info("定价类别为空{}" + types);
+            return;
+        }
+
+        int i = productTypePriceMapper.updateGoodsInfoPrice(productTypePrice);
+        log.info("修改:"+productTypePrice.getTypeName()+"类别,id:{"+productTypePrice.getFkProductType()+"}共"
+                + i +"商品定价为"+productTypePrice.getPrice());
+    }
+}

+ 25 - 0
carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/bank/service/ProductTypePriceService.java

@@ -0,0 +1,25 @@
+package com.hcloud.microserver.system.bank.service;
+
+import com.github.pagehelper.PageInfo;
+import com.hcloud.microserver.commoncore.base.BaseServie;
+import com.hcloud.microserver.system.facade.carbon.entity.ProductTypePriceWithBLOBs;
+import com.hcloud.microserver.system.facade.carbon.forms.ProductTypePriceForm;
+
+public interface ProductTypePriceService extends BaseServie<ProductTypePriceWithBLOBs,String> {
+
+    /**
+     * 查询列表
+     * lym
+     * @param productTypePriceForm
+     * @return
+     */
+    PageInfo selectList(ProductTypePriceForm productTypePriceForm);
+
+    /**
+     * 定价审核
+     * lym
+     * @param productTypePrice
+     * @return
+     */
+    int check(ProductTypePriceWithBLOBs productTypePrice);
+}

+ 97 - 0
carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/bank/service/impl/ProductTypePriceServiceImpl.java

@@ -0,0 +1,97 @@
+package com.hcloud.microserver.system.bank.service.impl;
+
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import com.hcloud.microserver.commoncore.enums.ResultEnum;
+import com.hcloud.microserver.commoncore.exception.GlobalException;
+import com.hcloud.microserver.commoncore.util.GetUUID;
+import com.hcloud.microserver.system.bank.dao.ProductTypePriceMapper;
+import com.hcloud.microserver.system.bank.events.ProductTypePriceEvent;
+import com.hcloud.microserver.system.bank.service.ProductTypePriceService;
+import com.hcloud.microserver.system.facade.carbon.entity.ProductTypePriceWithBLOBs;
+import com.hcloud.microserver.system.facade.carbon.forms.ProductTypePriceForm;
+import com.hcloud.microserver.system.util.CurrUserUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.Date;
+import java.util.List;
+
+@Service
+public class ProductTypePriceServiceImpl implements ProductTypePriceService {
+
+    @Resource
+    private ProductTypePriceMapper productTypePriceMapper;
+    @Autowired
+    private ProductTypePriceEvent productTypePriceEvent;
+
+    @Override
+    public int delByPrimaryKey(String guid) {
+        ProductTypePriceWithBLOBs productTypePrice = productTypePriceMapper.selectByPrimaryKey(guid);
+        if (productTypePrice.getCheckState() == 1){
+            throw new GlobalException(ResultEnum.FAILURE.getCode(),"审核通过的定价不能删除!");
+        }
+        productTypePrice.setGuid(guid);
+        productTypePrice.setState(0);
+        return productTypePriceMapper.updateByPrimaryKeySelective(productTypePrice);
+    }
+
+    @Override
+    public int save(ProductTypePriceWithBLOBs record) {
+        return 0;
+    }
+
+    @Override
+    public int saveSelective(ProductTypePriceWithBLOBs record) {
+        record.setGuid(GetUUID.getUUID());
+        record.setState(1);
+        record.setCreateUser(CurrUserUtil.getUserId());
+        record.setCreateTime(new Date());
+        return productTypePriceMapper.insertSelective(record);
+    }
+
+    @Override
+    public ProductTypePriceWithBLOBs queryByPrimaryKey(String guid) {
+        return null;
+    }
+
+    @Override
+    public int modifyByPrimaryKeySelective(ProductTypePriceWithBLOBs record) {
+        record.setModifiedUser(CurrUserUtil.getUserId());
+        record.setModifiedTime(new Date());
+        return productTypePriceMapper.updateByPrimaryKeySelective(record);
+    }
+
+    @Override
+    public int modifyByPrimaryKeyWithBLOBs(ProductTypePriceWithBLOBs record) {
+        return 0;
+    }
+
+    @Override
+    public int modifyByPrimaryKey(ProductTypePriceWithBLOBs record) {
+        return 0;
+    }
+
+    @Override
+    public PageInfo selectList(ProductTypePriceForm productTypePriceForm) {
+        PageHelper.startPage(productTypePriceForm.getPageNo(),productTypePriceForm.getPageSize());
+        List<ProductTypePriceWithBLOBs> list = productTypePriceMapper.selectList(productTypePriceForm);
+        return new PageInfo(list);
+    }
+
+    @Override
+    public int check(ProductTypePriceWithBLOBs productTypePrice) {
+        productTypePrice.setModifiedUser(CurrUserUtil.getUserId());
+        productTypePrice.setModifiedTime(new Date());
+        if (productTypePrice.getCheckState() == 1){ //审核通过
+            productTypePrice.setCheckTime(new Date());
+        }
+
+        int i = productTypePriceMapper.updateByPrimaryKeySelective(productTypePrice);
+        if (i > 0 && productTypePrice.getCheckState() == 1){ //审核通过,异步修改商品价格
+            productTypePriceEvent.updateGoodsInfoPrice(productTypePrice.getGuid());
+        }
+        return i;
+    }
+}

+ 239 - 0
carbon-back/carbon-back-service/src/main/resources/carbon/ProductTypePriceMapper.xml

@@ -0,0 +1,239 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.hcloud.microserver.system.bank.dao.ProductTypePriceMapper">
+  <resultMap id="BaseResultMap" type="com.hcloud.microserver.system.facade.carbon.entity.ProductTypePrice">
+    <id column="guid" jdbcType="CHAR" property="guid" />
+    <result column="price" jdbcType="DECIMAL" property="price" />
+    <result column="remark" jdbcType="VARCHAR" property="remark" />
+    <result column="check_state" jdbcType="INTEGER" property="checkState" />
+    <result column="check_time" jdbcType="TIMESTAMP" property="checkTime" />
+    <result column="check_remark" jdbcType="VARCHAR" property="checkRemark" />
+    <result column="state" jdbcType="INTEGER" property="state" />
+    <result column="create_user" jdbcType="CHAR" property="createUser" />
+    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+    <result column="modified_user" jdbcType="CHAR" property="modifiedUser" />
+    <result column="modified_time" jdbcType="TIMESTAMP" property="modifiedTime" />
+  </resultMap>
+  <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.hcloud.microserver.system.facade.carbon.entity.ProductTypePriceWithBLOBs">
+    <result column="fk_product_type" jdbcType="LONGVARCHAR" property="fkProductType" />
+    <result column="type_name" jdbcType="LONGVARCHAR" property="typeName" />
+  </resultMap>
+  <sql id="Base_Column_List">
+    guid, price, remark, check_state, check_time, check_remark, state, create_user, create_time, 
+    modified_user, modified_time
+  </sql>
+  <sql id="Blob_Column_List">
+    fk_product_type, type_name
+  </sql>
+  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="ResultMapWithBLOBs">
+    select 
+    <include refid="Base_Column_List" />
+    ,
+    <include refid="Blob_Column_List" />
+    from t_product_type_price
+    where guid = #{guid,jdbcType=CHAR}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
+    delete from t_product_type_price
+    where guid = #{guid,jdbcType=CHAR}
+  </delete>
+  <insert id="insert" parameterType="com.hcloud.microserver.system.facade.carbon.entity.ProductTypePriceWithBLOBs">
+    insert into t_product_type_price (guid, price, remark, 
+      check_state, check_time, check_remark, 
+      state, create_user, create_time, 
+      modified_user, modified_time, fk_product_type, 
+      type_name)
+    values (#{guid,jdbcType=CHAR}, #{price,jdbcType=DECIMAL}, #{remark,jdbcType=VARCHAR}, 
+      #{checkState,jdbcType=INTEGER}, #{checkTime,jdbcType=TIMESTAMP}, #{checkRemark,jdbcType=VARCHAR}, 
+      #{state,jdbcType=INTEGER}, #{createUser,jdbcType=CHAR}, #{createTime,jdbcType=TIMESTAMP}, 
+      #{modifiedUser,jdbcType=CHAR}, #{modifiedTime,jdbcType=TIMESTAMP}, #{fkProductType,jdbcType=LONGVARCHAR}, 
+      #{typeName,jdbcType=LONGVARCHAR})
+  </insert>
+  <insert id="insertSelective" parameterType="com.hcloud.microserver.system.facade.carbon.entity.ProductTypePriceWithBLOBs">
+    insert into t_product_type_price
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="guid != null">
+        guid,
+      </if>
+      <if test="price != null">
+        price,
+      </if>
+      <if test="remark != null">
+        remark,
+      </if>
+      <if test="checkState != null">
+        check_state,
+      </if>
+      <if test="checkTime != null">
+        check_time,
+      </if>
+      <if test="checkRemark != null">
+        check_remark,
+      </if>
+      <if test="state != null">
+        state,
+      </if>
+      <if test="createUser != null">
+        create_user,
+      </if>
+      <if test="createTime != null">
+        create_time,
+      </if>
+      <if test="modifiedUser != null">
+        modified_user,
+      </if>
+      <if test="modifiedTime != null">
+        modified_time,
+      </if>
+      <if test="fkProductType != null">
+        fk_product_type,
+      </if>
+      <if test="typeName != null">
+        type_name,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="guid != null">
+        #{guid,jdbcType=CHAR},
+      </if>
+      <if test="price != null">
+        #{price,jdbcType=DECIMAL},
+      </if>
+      <if test="remark != null">
+        #{remark,jdbcType=VARCHAR},
+      </if>
+      <if test="checkState != null">
+        #{checkState,jdbcType=INTEGER},
+      </if>
+      <if test="checkTime != null">
+        #{checkTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="checkRemark != null">
+        #{checkRemark,jdbcType=VARCHAR},
+      </if>
+      <if test="state != null">
+        #{state,jdbcType=INTEGER},
+      </if>
+      <if test="createUser != null">
+        #{createUser,jdbcType=CHAR},
+      </if>
+      <if test="createTime != null">
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="modifiedUser != null">
+        #{modifiedUser,jdbcType=CHAR},
+      </if>
+      <if test="modifiedTime != null">
+        #{modifiedTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="fkProductType != null">
+        #{fkProductType,jdbcType=LONGVARCHAR},
+      </if>
+      <if test="typeName != null">
+        #{typeName,jdbcType=LONGVARCHAR},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKeySelective" parameterType="com.hcloud.microserver.system.facade.carbon.entity.ProductTypePriceWithBLOBs">
+    update t_product_type_price
+    <set>
+      <if test="price != null">
+        price = #{price,jdbcType=DECIMAL},
+      </if>
+      <if test="remark != null">
+        remark = #{remark,jdbcType=VARCHAR},
+      </if>
+      <if test="checkState != null">
+        check_state = #{checkState,jdbcType=INTEGER},
+      </if>
+      <if test="checkTime != null">
+        check_time = #{checkTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="checkRemark != null">
+        check_remark = #{checkRemark,jdbcType=VARCHAR},
+      </if>
+      <if test="state != null">
+        state = #{state,jdbcType=INTEGER},
+      </if>
+      <if test="createUser != null">
+        create_user = #{createUser,jdbcType=CHAR},
+      </if>
+      <if test="createTime != null">
+        create_time = #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="modifiedUser != null">
+        modified_user = #{modifiedUser,jdbcType=CHAR},
+      </if>
+      <if test="modifiedTime != null">
+        modified_time = #{modifiedTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="fkProductType != null">
+        fk_product_type = #{fkProductType,jdbcType=LONGVARCHAR},
+      </if>
+      <if test="typeName != null">
+        type_name = #{typeName,jdbcType=LONGVARCHAR},
+      </if>
+    </set>
+    where guid = #{guid,jdbcType=CHAR}
+  </update>
+  <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.hcloud.microserver.system.facade.carbon.entity.ProductTypePriceWithBLOBs">
+    update t_product_type_price
+    set price = #{price,jdbcType=DECIMAL},
+      remark = #{remark,jdbcType=VARCHAR},
+      check_state = #{checkState,jdbcType=INTEGER},
+      check_time = #{checkTime,jdbcType=TIMESTAMP},
+      check_remark = #{checkRemark,jdbcType=VARCHAR},
+      state = #{state,jdbcType=INTEGER},
+      create_user = #{createUser,jdbcType=CHAR},
+      create_time = #{createTime,jdbcType=TIMESTAMP},
+      modified_user = #{modifiedUser,jdbcType=CHAR},
+      modified_time = #{modifiedTime,jdbcType=TIMESTAMP},
+      fk_product_type = #{fkProductType,jdbcType=LONGVARCHAR},
+      type_name = #{typeName,jdbcType=LONGVARCHAR}
+    where guid = #{guid,jdbcType=CHAR}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.hcloud.microserver.system.facade.carbon.entity.ProductTypePrice">
+    update t_product_type_price
+    set price = #{price,jdbcType=DECIMAL},
+      remark = #{remark,jdbcType=VARCHAR},
+      check_state = #{checkState,jdbcType=INTEGER},
+      check_time = #{checkTime,jdbcType=TIMESTAMP},
+      check_remark = #{checkRemark,jdbcType=VARCHAR},
+      state = #{state,jdbcType=INTEGER},
+      create_user = #{createUser,jdbcType=CHAR},
+      create_time = #{createTime,jdbcType=TIMESTAMP},
+      modified_user = #{modifiedUser,jdbcType=CHAR},
+      modified_time = #{modifiedTime,jdbcType=TIMESTAMP}
+    where guid = #{guid,jdbcType=CHAR}
+  </update>
+
+  <!-- 查询列表 lym -->
+  <select id="selectList" parameterType="com.hcloud.microserver.system.facade.carbon.forms.ProductTypePriceForm" resultMap="ResultMapWithBLOBs">
+    SELECT <include refid="Base_Column_List"/>,<include refid="Blob_Column_List"/> FROM t_product_type_price
+      WHERE state = 1
+    <if test="typeName != null">
+      AND type_name LIKE CONCAT("%",#{typeName,jdbcType=LONGVARCHAR},"%)"
+    </if>
+    <if test="checkState != null">
+      AND check_state = #{checkState,jdbcType=INTEGER}
+    </if>
+    <if test="checkTime != null">
+      AND check_time = #{checkTime,jdbcType=TIMESTAMP}
+    </if>
+      ORDER BY create_time DESC
+  </select>
+
+  <!-- 根据定价修改商品价格 lym -->
+  <update id="updateGoodsInfoPrice" parameterType="com.hcloud.microserver.system.facade.carbon.entity.ProductTypePriceWithBLOBs">
+    UPDATE t_goods_info
+      SET price = #{price,jdbcType=DECIMAL}
+      WHERE guid IN
+       ( SELECT tmp.guid FROM(SELECT a.guid,a.price,c.fk_product_type FROM t_goods_info a
+        LEFT JOIN t_goods_detail b ON a.guid = b.fk_goods_guid
+        LEFT JOIN t_product_info c ON b.fk_product_guid = c.guid
+        WHERE a.state = 1 AND b.state = 1 AND c.state = 1
+        AND  FIND_IN_SET(c.fk_product_type,#{fkProductType,jdbcType=LONGVARCHAR})
+        ) tmp
+       )
+  </update>
+</mapper>

+ 22 - 125
carbon-h5/carbon-h5-common/src/main/java/com/hcloud/microserver/h5/facade/carbon/entity/GoodsOrderInfo.java

@@ -1,146 +1,43 @@
 package com.hcloud.microserver.h5.facade.carbon.entity;
 
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
 import java.math.BigDecimal;
 import java.util.Date;
 
+@Api("订单详情")
+@Data
 public class GoodsOrderInfo {
+    @ApiModelProperty("序列")
     private String guid;
-
+    @ApiModelProperty("用户id")
     private String fkCustomerGuid;
-
+    @ApiModelProperty("订单编号")
     private String orderNo;
-
+    @ApiModelProperty("客户名称")
     private String customerName;
-
+    @ApiModelProperty("客户类型")
     private String customerType;
-
+    @ApiModelProperty("订单金额")
     private BigDecimal orderAmount;
-
+    @ApiModelProperty("订单购碳量")
     private BigDecimal orderCarbonAmount;
-
+    @ApiModelProperty("订单状态 1.未付款. 2.已完成(线上线下订单都完全完成了)3.未审核,4.后台审核等待打款, 5.已经打款等待再次审核")
     private Integer orderStatus;
-
+    @ApiModelProperty("记录状态 0无效 1有效")
     private Integer state;
-
+    @ApiModelProperty("创建人")
     private String createUser;
-
+    @ApiModelProperty("创建时间")
     private Date createTime;
-
+    @ApiModelProperty("修改人")
     private String modifiedUser;
-
+    @ApiModelProperty("修改时间")
     private Date modifiedTime;
-
+    @ApiModelProperty("支付流水号(成功支付后的回填,初始是空值)")
     private String payNo;
-
-    public String getGuid() {
-        return guid;
-    }
-
-    public void setGuid(String guid) {
-        this.guid = guid == null ? null : guid.trim();
-    }
-
-    public String getFkCustomerGuid() {
-        return fkCustomerGuid;
-    }
-
-    public void setFkCustomerGuid(String fkCustomerGuid) {
-        this.fkCustomerGuid = fkCustomerGuid == null ? null : fkCustomerGuid.trim();
-    }
-
-    public String getOrderNo() {
-        return orderNo;
-    }
-
-    public void setOrderNo(String orderNo) {
-        this.orderNo = orderNo == null ? null : orderNo.trim();
-    }
-
-    public BigDecimal getOrderAmount() {
-        return orderAmount;
-    }
-
-    public void setOrderAmount(BigDecimal orderAmount) {
-        this.orderAmount = orderAmount;
-    }
-
-    public BigDecimal getOrderCarbonAmount() {
-        return orderCarbonAmount;
-    }
-
-    public void setOrderCarbonAmount(BigDecimal orderCarbonAmount) {
-        this.orderCarbonAmount = orderCarbonAmount;
-    }
-
-    public Integer getOrderStatus() {
-        return orderStatus;
-    }
-
-    public void setOrderStatus(Integer orderStatus) {
-        this.orderStatus = orderStatus;
-    }
-
-    public Integer getState() {
-        return state;
-    }
-
-    public void setState(Integer state) {
-        this.state = state;
-    }
-
-    public String getCreateUser() {
-        return createUser;
-    }
-
-    public void setCreateUser(String createUser) {
-        this.createUser = createUser == null ? null : createUser.trim();
-    }
-
-    public Date getCreateTime() {
-        return createTime;
-    }
-
-    public void setCreateTime(Date createTime) {
-        this.createTime = createTime;
-    }
-
-    public String getModifiedUser() {
-        return modifiedUser;
-    }
-
-    public void setModifiedUser(String modifiedUser) {
-        this.modifiedUser = modifiedUser == null ? null : modifiedUser.trim();
-    }
-
-    public Date getModifiedTime() {
-        return modifiedTime;
-    }
-
-    public void setModifiedTime(Date modifiedTime) {
-        this.modifiedTime = modifiedTime;
-    }
-
-    public String getCustomerName() {
-        return customerName;
-    }
-
-    public void setCustomerName(String customerName) {
-        this.customerName = customerName==null?null:customerName.trim();
-    }
-
-    public String getCustomerType() {
-        return customerType;
-    }
-
-    public void setCustomerType(String customerType) {
-        this.customerType = customerType==null?null:customerType.trim();
-    }
-
-    public String getPayNo() {
-        return payNo;
-    }
-
-    public void setPayNo(String payNo) {
-        this.payNo = payNo==null?null:payNo.trim();
-    }
+    @ApiModelProperty("订单类型0:线上订单,1:线上申请后台生成订单,2:后台直接生成订单")
+    private Integer orderType;
 }

+ 5 - 0
carbon-h5/carbon-h5-common/src/main/java/com/hcloud/microserver/h5/facade/carbon/entity/from/CreateOrderDetailFrom.java

@@ -1,17 +1,22 @@
 package com.hcloud.microserver.h5.facade.carbon.entity.from;
 
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 import java.math.BigDecimal;
 
 @Data
+@ApiModel("购买商品模型")
 public class CreateOrderDetailFrom {
     /**
      * 商品id
      */
+    @ApiModelProperty("商品id")
     private String goodsId;
     /**
      * 碳汇量
      */
+    @ApiModelProperty("碳汇量")
     private BigDecimal carbonVal;
 }

+ 5 - 5
carbon-h5/carbon-h5-service/src/main/java/com/hcloud/microserver/h5/config/Swagger2Config.java

@@ -31,7 +31,7 @@ public class Swagger2Config {
         return new Docket(DocumentationType.SWAGGER_2)
                 .apiInfo(apiInfo())
                 .select()
-                .apis(RequestHandlerSelectors.basePackage("com.hwrj.cloud.admin.controller"))
+                .apis(RequestHandlerSelectors.basePackage("com.hcloud.microserver.h5.controller.web"))
                 .paths(PathSelectors.any())
                 .build()
                 .securitySchemes(securitySchemes())
@@ -40,10 +40,10 @@ public class Swagger2Config {
 
     private ApiInfo apiInfo() {
         return new ApiInfoBuilder()
-                .title("mall后台系统")
-                .description("mall后台模块")
-                .contact(new Contact("macro","",""))
-                .version("1.0")
+                .title("微信app后台接口")
+                .description("carbon-h5")
+                .contact(new Contact("carbon","",""))
+                .version("0.0.1")
                 .build();
     }
 

+ 4 - 3
carbon-h5/carbon-h5-service/src/main/java/com/hcloud/microserver/h5/config/mq/listener/ReceiverMessage.java

@@ -26,12 +26,13 @@ public class ReceiverMessage {
         System.out.println("接受时间:" + System.currentTimeMillis());
         System.out.println("接受消息:" + content);
         String[] split = content.split("-");
-        if(split.length>1){
+        if (split.length > 1) {
             String orderId = split[1];
             GoodsOrderInfo goodsOrderInfo = orderInfoService.selectByPrimaryKey(orderId);
-            if(!StringUtils.isEmpty(goodsOrderInfo)){
+            if (!StringUtils.isEmpty(goodsOrderInfo)) {
                 Integer orderStatus = goodsOrderInfo.getOrderStatus();
-                if(orderStatus.intValue() ==1){
+                Integer state = goodsOrderInfo.getState();
+                if (orderStatus.intValue() == 1 && state.intValue() == 1) {
                     orderInfoService.rollbackOrderInfo(orderId);
                     System.out.println("取消订单:" + content);
                 }

+ 2 - 2
carbon-h5/carbon-h5-service/src/main/java/com/hcloud/microserver/h5/controller/web/CustomerController.java

@@ -34,7 +34,7 @@ import java.util.Objects;
  */
 @RestController
 @RequestMapping("/wap/customer")
-@Api(description = "H5端客户服务")
+@Api(tags = "用户服务")
 public class CustomerController extends BaseController {
     @Autowired
     private CustomerService customerService;
@@ -59,7 +59,7 @@ public class CustomerController extends BaseController {
     })
     @ApiResponse(code =0,message = "查询成功")
     @PostMapping("/customerLogin")
-    public ResponseBase login(@RequestBody LoginForm loginForm){
+    public ResponseBase<Map<String, String>> login(@RequestBody LoginForm loginForm){
         String token = customerService.login(loginForm);
         if (token == null) {
              Asserts.fail("用户名或密码错误");

+ 0 - 1
carbon-h5/carbon-h5-service/src/main/java/com/hcloud/microserver/h5/controller/web/FarmerManagerController.java

@@ -24,7 +24,6 @@ import java.util.concurrent.TimeUnit;
  */
 @RestController
 @RequestMapping("/wap/farmer")
-@Api(description = "H5端贫困户服务")
 public class FarmerManagerController extends CarbonBaseController {
 
     /**

+ 3 - 20
carbon-h5/carbon-h5-service/src/main/java/com/hcloud/microserver/h5/controller/web/OrderManagerController.java

@@ -31,7 +31,7 @@ import java.util.Objects;
 @Slf4j
 @RestController
 @RequestMapping("/wap/order")
-@Api(description = "H5订单服务")
+@Api(tags = "订单服务")
 public class OrderManagerController extends CarbonBaseController {
 
     @Autowired
@@ -58,13 +58,9 @@ public class OrderManagerController extends CarbonBaseController {
 
 
     @ApiOperation(value = "生成订单信息", notes = "生成订单信息")
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "orderId", value = "订单Id", dataType = "String")
-    })
-    @ApiResponse(code = 0, message = "操作成功")
     @PostMapping("/createOrder")
     @AuthCarbonValidate
-    public ResponseBase createOrder(@RequestBody CreateOrderFrom createOrderFrom) {
+    public ResponseBase<GoodsOrderInfo> createOrder(@RequestBody CreateOrderFrom createOrderFrom) {
 
         GoodsOrderInfo goodsOrderInfo = orderInfoService.createOrder(createOrderFrom);
 
@@ -77,10 +73,9 @@ public class OrderManagerController extends CarbonBaseController {
     @ApiImplicitParams({
             @ApiImplicitParam(name = "orderType", value = "爱心用户信息", dataType = "Integer", paramType = "query")
     })
-    @ApiResponse(code = 0, message = "操作成功")
     @PostMapping("/searchByPage")
     @AuthCarbonValidate
-    public ResponseBase searchCustomerOrderByClass(@RequestBody OrderQueryForm queryForm) {
+    public ResponseBase<GoodsOrderInfoForm> searchCustomerOrderByClass(@RequestBody OrderQueryForm queryForm) {
         CustomerInfoForm customerInfo = customerService.getCurrentMember();
 
         GoodsOrderInfoForm goodsOrderInfoForm = new GoodsOrderInfoForm();
@@ -93,10 +88,6 @@ public class OrderManagerController extends CarbonBaseController {
     }
 
     @ApiOperation(value = "查询爱心用户订单信息", notes = "分类查询爱心用户订单")
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "orderType", value = "爱心用户信息", dataType = "Integer", paramType = "query")
-    })
-    @ApiResponse(code = 0, message = "操作成功")
     @GetMapping("/info")
     @AuthCarbonValidate
     public ResponseBase info(@RequestParam String orderId) {
@@ -121,10 +112,6 @@ public class OrderManagerController extends CarbonBaseController {
     }
 
     @ApiOperation(value = "查询爱心用户证书信息", notes = "分类查询爱心用户证书")
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "customerInfoForm", value = "爱心用户信息", dataType = "CustomerInfoForm")
-    })
-    @ApiResponse(code = 0, message = "操作成功")
     @PostMapping("/searchCredentialList")
     @AuthCarbonValidate
     public ResponseBase searchCredentialInfo(@RequestBody GoodsCredentialInfoForm goodsCredentialInfoForm) {
@@ -140,10 +127,6 @@ public class OrderManagerController extends CarbonBaseController {
 
 
     @ApiOperation(value = "生成订单信息", notes = "生成订单信息")
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "orderId", value = "订单Id", dataType = "String")
-    })
-    @ApiResponse(code = 0, message = "操作成功")
     @PostMapping("/saveOrderInfo")
     @AuthCarbonValidate
     public ResponseBase saveOrderInfo(@RequestBody GoodsOrderInfoForm goodsOrderInfoForm) {

+ 274 - 251
carbon-h5/carbon-h5-service/src/main/java/com/hcloud/microserver/h5/controller/web/WechatAppController.java

@@ -4,6 +4,8 @@ import cn.binarywang.wx.miniapp.api.WxMaService;
 import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult;
 import cn.binarywang.wx.miniapp.bean.WxMaPhoneNumberInfo;
 import cn.binarywang.wx.miniapp.bean.WxMaUserInfo;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
 import com.github.binarywang.wxpay.bean.notify.WxPayOrderNotifyResult;
 import com.github.binarywang.wxpay.bean.request.WxPayUnifiedOrderRequest;
 import com.github.binarywang.wxpay.constant.WxPayConstants;
@@ -22,6 +24,11 @@ import com.hcloud.microserver.commoncore.util.*;
 import com.hcloud.microserver.h5.facade.carbon.entity.CustomerInfo;
 import com.hcloud.microserver.h5.facade.carbon.forms.CustomerInfoForm;
 import com.hcloud.microserver.h5.facade.carbon.vo.MyWxMpUser;
+import com.hcloud.microserver.h5.service.CustomerService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
 import me.chanjar.weixin.common.error.WxErrorException;
 import org.apache.commons.lang.StringUtils;
@@ -48,6 +55,7 @@ import java.util.concurrent.TimeUnit;
 @Slf4j
 @Controller
 @RequestMapping("/wechat/app")
+@Api(tags = "微信小程序api服务")
 public class WechatAppController extends BaseController {
     private final Logger logger = LoggerFactory.getLogger(this.getClass());
 
@@ -58,12 +66,14 @@ public class WechatAppController extends BaseController {
     @Autowired
     private CustomerInfoService customerInfoService;
 
+
     /**
      * 登陆接口
      */
+    @ApiOperation(value = "微信登录", notes = "微信登录")
     @PostMapping("/login")
     @ResponseBody
-    public ResponseBase login(@RequestBody LoginRequest request) {
+    public ResponseBase<Map<String, String>> login(@RequestBody LoginRequest request) {
         String code = request.getCode();
         if (StringUtils.isBlank(code)) {
             return resultVOError("请输入code错误!");
@@ -76,8 +86,7 @@ public class WechatAppController extends BaseController {
             }
             // 解密用户信息
             WxMaUserInfo wxUserInfo = wxMaService.getUserService().getUserInfo(session.getSessionKey(), request.getEncryptedData(), request.getIv());
-            //解密手机号
-            WxMaPhoneNumberInfo phoneNoInfo = wxMaService.getUserService().getPhoneNoInfo(session.getSessionKey(), request.getEncryptedData(), request.getIv());
+
             if (null == wxUserInfo) {
                 throw new RuntimeException("wxUser not exist");
             }
@@ -88,7 +97,6 @@ public class WechatAppController extends BaseController {
             myWxMpUser.setNickname(wxUserInfo.getNickName());
             myWxMpUser.setHeadImgUrl(wxUserInfo.getAvatarUrl());
             myWxMpUser.setSex(Integer.parseInt(wxUserInfo.getGender()));
-            myWxMpUser.setPhone(phoneNoInfo.getPhoneNumber());
             //后台新增用户成功
             Map<String, String> tokenMap = customerInfoService.wxlogin(myWxMpUser);
             //登录系统获取本地
@@ -99,263 +107,278 @@ public class WechatAppController extends BaseController {
         }
     }
 
+    @Autowired
+    private CustomerService customerService;
+
     /**
      * 登陆接口
      */
-    @PostMapping("/login/test")
+    @ApiOperation(value = "小程序绑定手机号", notes = "小程序绑定手机号")
+    @PostMapping("/login/phone")
     @ResponseBody
-    public ResponseBase login(@RequestBody MyWxMpUser myWxMpUser) {
-        //后台新增用户成功
-        Map<String, String> tokenMap = customerInfoService.wxlogin(myWxMpUser);
+    public ResponseBase loginphone(@RequestBody LoginRequest request) throws WxErrorException {
+        // 获取微信用户session
+        WxMaJscode2SessionResult session = wxMaService.getUserService().getSessionInfo(request.getCode());
+        //解密手机号
+        WxMaPhoneNumberInfo phoneNoInfo = wxMaService.getUserService().getPhoneNoInfo(session.getSessionKey(), request.getEncryptedData(), request.getIv());
+
+        CustomerInfo customerInfo = new CustomerInfo();
+        CustomerInfoForm tokenUser = customerService.getCurrentMember();
+        customerInfo.setGuid(tokenUser.getGuid());
+        customerInfo.setPhone(phoneNoInfo.getPhoneNumber());
+        int i = customerInfoService.updateByPrimaryKeySelective(customerInfo);
+        if (i == 0) {
+            return resultVOError();
+        }
         //登录系统获取本地
-        return resultVOSuccess(tokenMap);
-    }
-
-    private Map<String, Object> getStringObjectMap(String customerId) {
-        CustomerInfoForm customerInfoForm = customerInfoService.queryByPrimaryKey(customerId);
-        CustomerInfo data = BeanCopyUtil.convertBean(customerInfoForm, CustomerInfo.class);
-//        CustomerInfo data = resultVO.getData();
-        String guid = data.getGuid();
-        Map<String, Object> resultMap = new HashMap<>();
-        ValueOperations<String, Object> operations = redisTemplate.opsForValue();
-        Token token = TokenUtil.createJwtToken(guid, GlobleConstant.CURRENT_MEMBER);
-        String accessToken = token.getAccessToken();
-        resultMap.put("accessToken", accessToken);
-        resultMap.put(WECHAT_USER_INFO, data);
-        operations.set(token.getAccessToken(), resultMap, GlobleConstant.TOKEN_EXPIRES_SECOND, TimeUnit.SECONDS);
-        return resultMap;
-    }
-
-    @Autowired
-    private RedisTemplate redisTemplate;
-
-    private static final String WECHAT_USER_INFO = "wechatUserInfo";
-
-    @GetMapping("dologin")
-    @ResponseBody
-    public ResponseBase login(String customerId) {
-        Map<String, Object> resultMap = getStringObjectMap(customerId);
-        return responseSuccess(new ResultVO(ResultEnum.SUCCESS, resultMap));
+        return resultVOSuccess();
     }
 
-
-    private MyWxMpUser getMyWxMpUser(WxMaUserInfo userInfo) {
-        String openId = userInfo.getOpenId();
-        String unionId = userInfo.getUnionId();
-        String nickName = userInfo.getNickName();
-        String gender = userInfo.getGender();
-        String avatarUrl = userInfo.getAvatarUrl();
-        MyWxMpUser myWxMpUser = new MyWxMpUser();
-        myWxMpUser.setOpenId(openId);
-        myWxMpUser.setUnionId(unionId);
-        myWxMpUser.setNickname(nickName);
-        myWxMpUser.setHeadImgUrl(avatarUrl);
-        myWxMpUser.setSex(1);
-        return myWxMpUser;
-    }
-
-
-    @Value("${wx.pay.wxpayAppcallbackurl}")
-    private String wxpayCallbackUrl;
-
-    @Autowired
-    private WxPayService wxPayService;
-
-
-    @PostMapping("/pay")
-    @AuthCarbonValidate
-    @ResponseBody
-    public ResponseBase pay(HttpServletRequest request) {
-//        String orderId = wxPayFrom.getOrderId();
-//        String openid = wxPayFrom.getOpenid();
-//        String tradeType = wxPayFrom.getTradeType();
-//        ResultVO<Order> appget = orderClient.get(orderId);
-//        Order data = appget.getData();
-//        int enable = data.getEnable().intValue();
-//        if(1==enable){
-//            throw new RuntimeException("订单已支付");
+//    private Map<String, Object> getStringObjectMap(String customerId) {
+//        CustomerInfoForm customerInfoForm = customerInfoService.queryByPrimaryKey(customerId);
+//        CustomerInfo data = BeanCopyUtil.convertBean(customerInfoForm, CustomerInfo.class);
+////        CustomerInfo data = resultVO.getData();
+//        String guid = data.getGuid();
+//        Map<String, Object> resultMap = new HashMap<>();
+//        ValueOperations<String, Object> operations = redisTemplate.opsForValue();
+//        Token token = TokenUtil.createJwtToken(guid, GlobleConstant.CURRENT_MEMBER);
+//        String accessToken = token.getAccessToken();
+//        resultMap.put("accessToken", accessToken);
+//        resultMap.put(WECHAT_USER_INFO, data);
+//        operations.set(token.getAccessToken(), resultMap, GlobleConstant.TOKEN_EXPIRES_SECOND, TimeUnit.SECONDS);
+//        return resultMap;
+//    }
+
+//    @Autowired
+//    private RedisTemplate redisTemplate;
+//
+//    private static final String WECHAT_USER_INFO = "wechatUserInfo";
+//
+//    @GetMapping("dologin")
+//    @ResponseBody
+//    public ResponseBase login(String customerId) {
+//        Map<String, Object> resultMap = getStringObjectMap(customerId);
+//        return responseSuccess(new ResultVO(ResultEnum.SUCCESS, resultMap));
+//    }
+//
+//
+//    private MyWxMpUser getMyWxMpUser(WxMaUserInfo userInfo) {
+//        String openId = userInfo.getOpenId();
+//        String unionId = userInfo.getUnionId();
+//        String nickName = userInfo.getNickName();
+//        String gender = userInfo.getGender();
+//        String avatarUrl = userInfo.getAvatarUrl();
+//        MyWxMpUser myWxMpUser = new MyWxMpUser();
+//        myWxMpUser.setOpenId(openId);
+//        myWxMpUser.setUnionId(unionId);
+//        myWxMpUser.setNickname(nickName);
+//        myWxMpUser.setHeadImgUrl(avatarUrl);
+//        myWxMpUser.setSex(1);
+//        return myWxMpUser;
+//    }
+//
+//
+//    @Value("${wx.pay.wxpayAppcallbackurl}")
+//    private String wxpayCallbackUrl;
+//
+//    @Autowired
+//    private WxPayService wxPayService;
+//
+//
+//    @PostMapping("/pay")
+//    @AuthCarbonValidate
+//    @ResponseBody
+//    public ResponseBase pay(HttpServletRequest request) {
+////        String orderId = wxPayFrom.getOrderId();
+////        String openid = wxPayFrom.getOpenid();
+////        String tradeType = wxPayFrom.getTradeType();
+////        ResultVO<Order> appget = orderClient.get(orderId);
+////        Order data = appget.getData();
+////        int enable = data.getEnable().intValue();
+////        if(1==enable){
+////            throw new RuntimeException("订单已支付");
+////        }
+//        WxPayUnifiedOrderRequest orderRequest = new WxPayUnifiedOrderRequest();
+//        //随机字符串
+//        String s = UUIDUtils.randomUUID();
+//
+//        orderRequest.setNonceStr(s);
+//        //商品描述
+//        orderRequest.setBody("碳汇扶贫!");
+//        //商户订单号(支付编号)
+//        GeneratorIdUtils generatorIdUtils = new GeneratorIdUtils();
+//        String orderNum = generatorIdUtils.nextId();
+//        log.info("orderNum:" + orderNum);
+//        //设置商户订单号
+//        orderRequest.setOutTradeNo(orderNum);
+//        //设置支付id
+////        data.setTransId(orderNum);
+//        //设置金额
+////        BigDecimal money = data.getTotalPrice();
+//        //元转成分
+////        money = money.multiply(new BigDecimal(100));
+////        int i = money.intValue();
+////        if ("test".equals(tradeType)) {
+////            //测试环境一分钱
+////            orderRequest.setTotalFee(1);
+////        } else {
+////            orderRequest.setTotalFee(i);
+////        }
+//        //终端ip
+//        String ipAddress = getIpAddress(request);
+//        orderRequest.setSpbillCreateIp(ipAddress);
+//        // 通知地址 支付成功后回调地址
+//        log.info("wxpayCallbackUrl=================>{}", wxpayCallbackUrl);
+//        orderRequest.setNotifyUrl(wxpayCallbackUrl);
+//        //交易类型
+//        orderRequest.setTradeType(WxPayConstants.TradeType.APP);
+//        //用户标识 获取用户openid
+////        orderRequest.setOpenid(openid);
+//        // 这个可能是偏向原生一点的统一下单,返回的参数有很多没用的 或者null值 建议使用 createOrder下单
+//        Object unOrder = null;
+//        try {
+//            unOrder = wxPayService.createOrder(orderRequest);
+//        } catch (WxPayException e) {
+//            //e.printStackTrace();
+//            log.error(e.getMessage());
+//            //签名完成新增支付订单
+//            ResultVO resultVO = new ResultVO();
+//            resultVO.setCode(1);
+//            resultVO.setMsg("微信支付失败!");
+//            return responseError(resultVO);
 //        }
-        WxPayUnifiedOrderRequest orderRequest = new WxPayUnifiedOrderRequest();
-        //随机字符串
-        String s = UUIDUtils.randomUUID();
-
-        orderRequest.setNonceStr(s);
-        //商品描述
-        orderRequest.setBody("碳汇扶贫!");
-        //商户订单号(支付编号)
-        GeneratorIdUtils generatorIdUtils = new GeneratorIdUtils();
-        String orderNum = generatorIdUtils.nextId();
-        log.info("orderNum:" + orderNum);
-        //设置商户订单号
-        orderRequest.setOutTradeNo(orderNum);
-        //设置支付id
-//        data.setTransId(orderNum);
-        //设置金额
-//        BigDecimal money = data.getTotalPrice();
-        //元转成分
-//        money = money.multiply(new BigDecimal(100));
-//        int i = money.intValue();
-//        if ("test".equals(tradeType)) {
-//            //测试环境一分钱
-//            orderRequest.setTotalFee(1);
+//        //更新本地订单支付id
+////        orderClient.update(data);
+//        //签名完成新增支付订单
+//        ResultVO resultVO = new ResultVO();
+//        resultVO.setCode(0);
+//        resultVO.setData(unOrder);
+//        return responseSuccess(resultVO);
+//    }
+//
+//
+//    /**
+//     * wx支付成功回调接口
+//     *
+//     * @param request
+//     * @param response
+//     * @throws IOException
+//     */
+//    @RequestMapping("payResult")
+//    public void payResult(HttpServletRequest request, HttpServletResponse response) throws IOException {
+//        log.info("微信支付返回通知函数开始---------------------");
+//
+//        InputStream inStream = request.getInputStream();
+//        ByteArrayOutputStream outSteam = new ByteArrayOutputStream();
+//        byte[] buffer = new byte[1024];
+//        int len = 0;
+//        while ((len = inStream.read(buffer)) != -1) {
+//            outSteam.write(buffer, 0, len);
+//        }
+//        outSteam.close();
+//        inStream.close();
+//        String result = new String(outSteam.toByteArray(), "utf-8");
+//        boolean isPayOk = false;
+//        WxPayOrderNotifyResult wxPayOrderNotifyResult = null;
+//        // 此处调用订单查询接口验证是否交易成功
+//        try {
+//            wxPayOrderNotifyResult = wxPayService.parseOrderNotifyResult(result);
+//            if ("SUCCESS".equals(wxPayOrderNotifyResult.getResultCode())) {
+//                isPayOk = true;
+//            }
+//            log.info("解析数据:" + wxPayOrderNotifyResult.toString());
+//        } catch (WxPayException e) {
+//            e.printStackTrace();
+//        }
+//        String noticeStr = "";
+//        // 支付成功,商户处理后同步返回给微信参数
+//        PrintWriter writer = response.getWriter();
+//        if (isPayOk) {
+//            //建议在这里处理付款完成的业务(虽然前端也可以处理后续业务,但是前端处理并不安全,例如:客户突然关闭浏览器了等情况,付款成功后续的业务将中断)
+//            //支付订单支付编号
+//            System.out.println("===============付款成功,业务开始处理==============");
+//            String orderNum = wxPayOrderNotifyResult.getOutTradeNo();
+//            log.info("orderNum:" + orderNum);
+//
+////            Order order=new Order();
+////            order.setTransId(orderNum);
+////            //将订单更新为支付
+////            orderClient.payment(order);
+//            /**
+//             * 自己的业务
+//             */
+//            System.out.println("===============付款成功,业务处理完毕==============");
+//            // 通知微信已经收到消息,不要再给我发消息了,否则微信会8连击调用本接口
+//            noticeStr = setXML("SUCCESS", "OK");
+//            log.info("收到通知返回给微信api信息:-----------" + noticeStr);
+//            writer.write(noticeStr);
+//            writer.flush();
 //        } else {
-//            orderRequest.setTotalFee(i);
+//            // 支付失败, 记录流水失败
+//            noticeStr = setXML("FAIL", "");
+//            writer.write(noticeStr);
+//            writer.flush();
+//            System.out.println("===============支付失败==============");
 //        }
-        //终端ip
-        String ipAddress = getIpAddress(request);
-        orderRequest.setSpbillCreateIp(ipAddress);
-        // 通知地址 支付成功后回调地址
-        log.info("wxpayCallbackUrl=================>{}", wxpayCallbackUrl);
-        orderRequest.setNotifyUrl(wxpayCallbackUrl);
-        //交易类型
-        orderRequest.setTradeType(WxPayConstants.TradeType.APP);
-        //用户标识 获取用户openid
-//        orderRequest.setOpenid(openid);
-        // 这个可能是偏向原生一点的统一下单,返回的参数有很多没用的 或者null值 建议使用 createOrder下单
-        Object unOrder = null;
-        try {
-            unOrder = wxPayService.createOrder(orderRequest);
-        } catch (WxPayException e) {
-            //e.printStackTrace();
-            log.error(e.getMessage());
-            //签名完成新增支付订单
-            ResultVO resultVO = new ResultVO();
-            resultVO.setCode(1);
-            resultVO.setMsg("微信支付失败!");
-            return responseError(resultVO);
-        }
-        //更新本地订单支付id
-//        orderClient.update(data);
-        //签名完成新增支付订单
-        ResultVO resultVO = new ResultVO();
-        resultVO.setCode(0);
-        resultVO.setData(unOrder);
-        return responseSuccess(resultVO);
-    }
-
-
-    /**
-     * wx支付成功回调接口
-     *
-     * @param request
-     * @param response
-     * @throws IOException
-     */
-    @RequestMapping("payResult")
-    public void payResult(HttpServletRequest request, HttpServletResponse response) throws IOException {
-        log.info("微信支付返回通知函数开始---------------------");
-
-        InputStream inStream = request.getInputStream();
-        ByteArrayOutputStream outSteam = new ByteArrayOutputStream();
-        byte[] buffer = new byte[1024];
-        int len = 0;
-        while ((len = inStream.read(buffer)) != -1) {
-            outSteam.write(buffer, 0, len);
-        }
-        outSteam.close();
-        inStream.close();
-        String result = new String(outSteam.toByteArray(), "utf-8");
-        boolean isPayOk = false;
-        WxPayOrderNotifyResult wxPayOrderNotifyResult = null;
-        // 此处调用订单查询接口验证是否交易成功
-        try {
-            wxPayOrderNotifyResult = wxPayService.parseOrderNotifyResult(result);
-            if ("SUCCESS".equals(wxPayOrderNotifyResult.getResultCode())) {
-                isPayOk = true;
-            }
-            log.info("解析数据:" + wxPayOrderNotifyResult.toString());
-        } catch (WxPayException e) {
-            e.printStackTrace();
-        }
-        String noticeStr = "";
-        // 支付成功,商户处理后同步返回给微信参数
-        PrintWriter writer = response.getWriter();
-        if (isPayOk) {
-            //建议在这里处理付款完成的业务(虽然前端也可以处理后续业务,但是前端处理并不安全,例如:客户突然关闭浏览器了等情况,付款成功后续的业务将中断)
-            //支付订单支付编号
-            System.out.println("===============付款成功,业务开始处理==============");
-            String orderNum = wxPayOrderNotifyResult.getOutTradeNo();
-            log.info("orderNum:" + orderNum);
-
-//            Order order=new Order();
-//            order.setTransId(orderNum);
-//            //将订单更新为支付
-//            orderClient.payment(order);
-            /**
-             * 自己的业务
-             */
-            System.out.println("===============付款成功,业务处理完毕==============");
-            // 通知微信已经收到消息,不要再给我发消息了,否则微信会8连击调用本接口
-            noticeStr = setXML("SUCCESS", "OK");
-            log.info("收到通知返回给微信api信息:-----------" + noticeStr);
-            writer.write(noticeStr);
-            writer.flush();
-        } else {
-            // 支付失败, 记录流水失败
-            noticeStr = setXML("FAIL", "");
-            writer.write(noticeStr);
-            writer.flush();
-            System.out.println("===============支付失败==============");
-        }
-    }
-
-
-    /**
-     * //签名成功生成支付订单
-     *
-     * @return
-     * @throws GeneralSecurityException
-     */
-    private void insertPayOrder(Object object) {
-
-
-    }
-
-    public static String setXML(String return_code, String return_msg) {
-        return "<xml><return_code><![CDATA[" + return_code + "]]></return_code><return_msg><![CDATA[" + return_msg + "]]></return_msg></xml>";
-    }
-
-    public static String getIpAddress(HttpServletRequest request) {
-        String ip = request.getHeader("x-forwarded-for");
-        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
-            ip = request.getHeader("Proxy-Client-IP");
-        }
-        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
-            ip = request.getHeader("WL-Proxy-Client-IP");
-        }
-        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
-            ip = request.getHeader("HTTP_CLIENT_IP");
-        }
-        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
-            ip = request.getHeader("HTTP_X_FORWARDED_FOR");
-        }
-        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
-            ip = request.getRemoteAddr();
-        }
-        String[] split = ip.split(",");
-        ip = split[0];
-        return ip;
-    }
-
-    /**
-     * <pre>
-     * 获取用户绑定手机号信息
-     * </pre>
-     */
-    @GetMapping("/phone")
-    public String phone(String sessionKey, String signature,
-                        String rawData, String encryptedData, String iv) {
-
-        // 用户信息校验
-        if (!wxMaService.getUserService().checkUserInfo(sessionKey, rawData, signature)) {
-            return "user check failed";
-        }
-
-        // 解密
-        WxMaPhoneNumberInfo phoneNoInfo = wxMaService.getUserService().getPhoneNoInfo(sessionKey, encryptedData, iv);
-
-        return JsonUtils.toJson(phoneNoInfo);
-    }
+//    }
+//
+//
+//    /**
+//     * //签名成功生成支付订单
+//     *
+//     * @return
+//     * @throws GeneralSecurityException
+//     */
+//    private void insertPayOrder(Object object) {
+//
+//
+//    }
+//
+//    public static String setXML(String return_code, String return_msg) {
+//        return "<xml><return_code><![CDATA[" + return_code + "]]></return_code><return_msg><![CDATA[" + return_msg + "]]></return_msg></xml>";
+//    }
+//
+//    public static String getIpAddress(HttpServletRequest request) {
+//        String ip = request.getHeader("x-forwarded-for");
+//        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
+//            ip = request.getHeader("Proxy-Client-IP");
+//        }
+//        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
+//            ip = request.getHeader("WL-Proxy-Client-IP");
+//        }
+//        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
+//            ip = request.getHeader("HTTP_CLIENT_IP");
+//        }
+//        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
+//            ip = request.getHeader("HTTP_X_FORWARDED_FOR");
+//        }
+//        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
+//            ip = request.getRemoteAddr();
+//        }
+//        String[] split = ip.split(",");
+//        ip = split[0];
+//        return ip;
+//    }
+//
+//    /**
+//     * <pre>
+//     * 获取用户绑定手机号信息
+//     * </pre>
+//     */
+//    @GetMapping("/phone")
+//    public String phone(String sessionKey, String signature,
+//                        String rawData, String encryptedData, String iv) {
+//
+//        // 用户信息校验
+//        if (!wxMaService.getUserService().checkUserInfo(sessionKey, rawData, signature)) {
+//            return "user check failed";
+//        }
+//
+//        // 解密
+//        WxMaPhoneNumberInfo phoneNoInfo = wxMaService.getUserService().getPhoneNoInfo(sessionKey, encryptedData, iv);
+//
+//        return JsonUtils.toJson(phoneNoInfo);
+//    }
 
 
 }

+ 1 - 5
carbon-h5/carbon-h5-service/src/main/java/com/hcloud/microserver/h5/controller/web/WechatAppPayController.java

@@ -34,6 +34,7 @@ import java.math.BigDecimal;
 @Slf4j
 @Controller
 @RequestMapping("/wechat/pay")
+@Api(tags = "微信小程序支付服务")
 public class WechatAppPayController extends BaseController {
 
 
@@ -51,10 +52,6 @@ public class WechatAppPayController extends BaseController {
     private String wxpayCallbackUrl;
 
     @ApiOperation(value = "微信支付接口(二次支付)", notes = "微信支付接口请勿随意调用(二次支付)")
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "orderId", value = "订单编号", dataType = "String", paramType = "query"),
-            @ApiImplicitParam(name = "tradeType", value = "交易方式(NATIVE,APP,JSAPI,MWEB)", dataType = "String", paramType = "query")
-    })
     @ApiResponse(code = 500, message = "请求的配置参数有问题")
     @AuthCarbonValidate
     @PostMapping("/pay")
@@ -122,7 +119,6 @@ public class WechatAppPayController extends BaseController {
 
 
     @ApiOperation(value = "微信支付结果回调", notes = "微信支付结果回调请勿直接调用")
-    @ApiResponse(code = 500, message = "请求的配置参数有问题")
     @AuthCarbonValidate
     @PostMapping("/payResultNotified")
     public void payOrderResultNotify(HttpServletRequest request, HttpServletResponse response) throws IOException {

+ 0 - 1
carbon-h5/carbon-h5-service/src/main/java/com/hcloud/microserver/h5/controller/web/WechatManagerController.java

@@ -51,7 +51,6 @@ import java.util.concurrent.TimeUnit;
 @Slf4j
 @RestController
 @RequestMapping("/wap/weChat")
-@Api(description = "H5微信api服务")
 public class WechatManagerController extends CarbonBaseController {
 
     private static final String WECHAT_AUTH_SCOPE = "snsapi_userinfo";

+ 1 - 1
carbon-h5/carbon-h5-service/src/main/java/com/hcloud/microserver/h5/dao/GoodsOrderInfoMapper.java

@@ -28,7 +28,7 @@ public interface GoodsOrderInfoMapper extends BaseMapper<GoodsOrderInfo,String>
      * @param orderStatus
      * @return
      */
-    List<OrderInfoBO> searchOrderInfoByCustomerId(@Param("custId") String customerId,@Param("orderStatus") Integer orderStatus);
+    List<OrderInfoBO> searchOrderInfoByCustomerId(@Param("customerId") String customerId,@Param("orderStatus") Integer orderStatus);
 
     /**
      * 通过订单编号查询订单信息

+ 9 - 1
carbon-h5/carbon-h5-service/src/main/java/com/hcloud/microserver/h5/entity/LoginRequest.java

@@ -1,21 +1,29 @@
 package com.hcloud.microserver.h5.entity;
 
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 @Data
+@ApiModel("小程序提交参数")
 public class LoginRequest {
     //用户登录凭证
+    @ApiModelProperty("用户登录凭证")
     String code;
 
     //原始数据字符串
+    @ApiModelProperty("原始数据字符串")
     String signature;
 
     //加密用户数据
+    @ApiModelProperty("加密用户数据")
     String encryptedData;
 
     //加密算法的初始向量
+    @ApiModelProperty("加密算法的初始向量")
     String iv;
 
     //校验用户信息字符串
-    Object rawData;
+    String rawData;
+
 }

+ 6 - 1
carbon-h5/carbon-h5-service/src/main/java/com/hcloud/microserver/h5/entity/WxPayFrom.java

@@ -1,14 +1,19 @@
 package com.hcloud.microserver.h5.entity;
 
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 @Data
+@ApiModel("微信支付参数")
 public class WxPayFrom {
-
+    @ApiModelProperty("订单id")
     private String orderId;
 
+    @ApiModelProperty("微信openid")
     private String openid;
 
+    @ApiModelProperty("是否开启测试一分钱 test一分钱 空 原价支付")
     private String tradeType;
 
 }

+ 4 - 0
carbon-h5/carbon-h5-service/src/main/java/com/hcloud/microserver/h5/service/CustomerInfoService.java

@@ -2,6 +2,7 @@ package com.hcloud.microserver.h5.service;
 
 import com.github.pagehelper.PageInfo;
 import com.hcloud.microserver.commoncore.base.BaseServie;
+import com.hcloud.microserver.h5.facade.carbon.entity.CustomerInfo;
 import com.hcloud.microserver.h5.facade.carbon.forms.CustomerInfoForm;
 import com.hcloud.microserver.h5.facade.carbon.vo.MyWxMpUser;
 
@@ -88,4 +89,7 @@ public interface CustomerInfoService extends BaseServie<CustomerInfoForm,String>
 
 
     Map<String, String> wxlogin(MyWxMpUser wxMpUser);
+
+
+    int updateByPrimaryKeySelective(CustomerInfo customerInfo);
 }

+ 7 - 0
carbon-h5/carbon-h5-service/src/main/java/com/hcloud/microserver/h5/service/impl/CustomerInfoServiceImpl.java

@@ -440,5 +440,12 @@ public class CustomerInfoServiceImpl implements CustomerInfoService {
         return customerInfoMapper.updateByPrimaryKey(customerInfo);
     }
 
+    @Override
+    public int updateByPrimaryKeySelective(CustomerInfo customerInfo) {
+       return customerInfoMapper.updateByPrimaryKeySelective(customerInfo);
+    }
+
+
+
 
 }

+ 11 - 2
carbon-h5/carbon-h5-service/src/main/java/com/hcloud/microserver/h5/service/impl/OrderInfoServiceImpl.java

@@ -344,7 +344,14 @@ public class OrderInfoServiceImpl implements OrderInfoService {
     @Override
     public int rollbackOrderInfo(String orderId) {
         GoodsOrderInfo goodsOrderInfo = goodsOrderInfoMapper.selectByPrimaryKey(orderId);
-        goodsOrderInfo.setOrderStatus(4);
+        Integer orderStatus = goodsOrderInfo.getOrderStatus();
+        if(orderStatus.intValue() !=1){
+            throw new RuntimeException("该订单已支付款订单无法取消!");
+        }
+        Integer state = goodsOrderInfo.getState();
+        if(state.intValue() ==0){
+            throw new RuntimeException("该订单为无效订单!");
+        }
         goodsOrderInfo.setState(0);
         goodsOrderInfo.setModifiedTime(new Date());
         int i = goodsOrderInfoMapper.updateByPrimaryKeySelective(goodsOrderInfo);
@@ -526,7 +533,7 @@ public class OrderInfoServiceImpl implements OrderInfoService {
             throw new RuntimeException("获取登陆信息失败");
         }
         if(customerInfo.getCustomerType() != 1){
-            throw new RuntimeException("无法购买商品不是自然人");
+            throw new RuntimeException("不是自然人无法购买商品!");
         }
         String customerId = customerInfo.getGuid();
 
@@ -597,6 +604,8 @@ public class OrderInfoServiceImpl implements OrderInfoService {
         goodsOrderInfo.setCreateUser(customerId);
         goodsOrderInfo.setCreateTime(new Date());
         goodsOrderInfo.setOrderStatus(1);
+        //有效订单
+        goodsOrderInfo.setState(1);
         //碳汇总价
         goodsOrderInfo.setOrderAmount(sumTotal);
         //碳汇总数量

+ 2 - 2
carbon-h5/carbon-h5-service/src/main/resources/com/hcloud/microserver/h5/dao/GoodsOrderInfoMapper.xml

@@ -109,8 +109,8 @@
         FROM
             t_goods_order_info aa
         WHERE
-            aa.state = 1
-        AND aa.fk_customer_guid = #{custId}
+            1 = 1
+        AND aa.fk_customer_guid = #{customerId}
         <if test="orderStatus!=null and orderStatus!=-1">
         AND aa.order_status=#{orderStatus}
         </if>

+ 38 - 0
common-core/src/main/java/com/hcloud/microserver/commoncore/base/BaseController.java

@@ -147,6 +147,44 @@ public class BaseController {
         return responseBase;
     }
 
+    /**
+     * 操作成功后,返回结果(前后端分离)
+     *
+     * @param
+     * @return
+     */
+    protected ResponseBase resultVOError() {
+        ResultVO resultVO=new ResultVO();
+        resultVO.setCode(1);
+        resultVO.setMsg("操作失败!");
+        ResponseBase responseBase = new ResponseBase(resultVO.getData());
+        RetHead retHead = new RetHead();
+        retHead.setErrCode(resultVO.getCode().shortValue());
+        retHead.setErrMsg(resultVO.getMsg());
+        retHead.setTotal(resultVO.getCount());
+        responseBase.setRetHead(retHead);
+        return responseBase;
+    }
+
+    /**
+     * 操作成功后,返回结果(前后端分离)
+     *
+     * @param
+     * @return
+     */
+    protected ResponseBase resultVOError(String msg) {
+        ResultVO resultVO=new ResultVO();
+        resultVO.setCode(1);
+        resultVO.setMsg(msg);
+        ResponseBase responseBase = new ResponseBase(resultVO.getData());
+        RetHead retHead = new RetHead();
+        retHead.setErrCode(resultVO.getCode().shortValue());
+        retHead.setErrMsg(resultVO.getMsg());
+        retHead.setTotal(resultVO.getCount());
+        responseBase.setRetHead(retHead);
+        return responseBase;
+    }
+
     /**
      * 操作成功后,返回结果(前后端分离)
      *