| @@ -72,23 +72,24 @@ public class PosOrderController extends BaseController { | |||||
| @ApiOperation("根据id更新接口") | @ApiOperation("根据id更新接口") | ||||
| @PostMapping("update") | @PostMapping("update") | ||||
| public ResultData update(@RequestBody PosOrder posOrder) { | public ResultData update(@RequestBody PosOrder posOrder) { | ||||
| posOrder.updateTenantInfo(getTenantInfo()); | |||||
| posOrderService.saveOrUpdate(posOrder); | posOrderService.saveOrUpdate(posOrder); | ||||
| return new ResultData(); | return new ResultData(); | ||||
| } | } | ||||
| @ApiOperation("根据id删除接口") | |||||
| @GetMapping("/del") | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| public ResultData delete(Long id) { | |||||
| posOrderService.deleteById(id); | |||||
| return new ResultData(Result.SUCCESS, "删除成功", null); | |||||
| } | |||||
| // @ApiOperation("根据id删除接口") | |||||
| // @GetMapping("/del") | |||||
| // @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| // public ResultData delete(Long id) { | |||||
| // posOrderService.deleteById(id); | |||||
| // return new ResultData(Result.SUCCESS, "删除成功", null); | |||||
| // } | |||||
| @ApiOperation("根据id查询接口") | @ApiOperation("根据id查询接口") | ||||
| @GetMapping("/findById") | @GetMapping("/findById") | ||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | ||||
| public ResultData findById(Long id) { | public ResultData findById(Long id) { | ||||
| return new ResultData(Result.SUCCESS, "查询成功", posOrderService.getById(id)); | |||||
| return new ResultData(Result.SUCCESS, "查询成功", posOrderService.getById(id,getTenantInfo().getTenantId())); | |||||
| } | } | ||||
| @@ -357,6 +357,7 @@ public class PosBrunService { | |||||
| updateOrder.setId(posOrderId); | updateOrder.setId(posOrderId); | ||||
| updateOrder.setRemainAmount(remainAmount); | updateOrder.setRemainAmount(remainAmount); | ||||
| updateOrder.setUpdateDate(new Date()); | updateOrder.setUpdateDate(new Date()); | ||||
| updateOrder.updateTenantInfo(user); | |||||
| if (remainAmount.equals(0)) { | if (remainAmount.equals(0)) { | ||||
| updateOrder.setOrderStatus(EnumPosOrderStatus.PAYMENT_SUCCESS.getCode()); | updateOrder.setOrderStatus(EnumPosOrderStatus.PAYMENT_SUCCESS.getCode()); | ||||
| retObj.put(WxPayConstant.ORDER_STATUS, EnumPosOrderStatus.PAYMENT_SUCCESS.getCode()); | retObj.put(WxPayConstant.ORDER_STATUS, EnumPosOrderStatus.PAYMENT_SUCCESS.getCode()); | ||||
| @@ -542,7 +543,7 @@ public class PosBrunService { | |||||
| } | } | ||||
| // 5. 同步给fm pos进程 | // 5. 同步给fm pos进程 | ||||
| // 5.1 posOrder信息 | // 5.1 posOrder信息 | ||||
| PosOrder syncOrder = posOrderService.getById(posOrder.getId()); | |||||
| PosOrder syncOrder = posOrderService.getById(posOrder.getId(),user.getTenantId()); | |||||
| if (syncOrder != null) { | if (syncOrder != null) { | ||||
| // 5.2 posPayOrder信息 | // 5.2 posPayOrder信息 | ||||
| PosPayOrder q = new PosPayOrder(); | PosPayOrder q = new PosPayOrder(); | ||||
| @@ -7,6 +7,7 @@ import com.iformall.domain.po.PosOrder; | |||||
| public interface PosOrderMapper extends CommonMapper<PosOrder, Long> { | public interface PosOrderMapper extends CommonMapper<PosOrder, Long> { | ||||
| PosOrder selectById(@Param("id")Long id,@Param("tenantId")String tenantId); | |||||
| List<PosOrder> findList(PosOrder posOrder); | List<PosOrder> findList(PosOrder posOrder); | ||||
| @@ -22,7 +22,7 @@ public interface PosOrderService { | |||||
| * @param id | * @param id | ||||
| * @return | * @return | ||||
| */ | */ | ||||
| PosOrder getById(Long id); | |||||
| PosOrder getById(Long id,String tenantId); | |||||
| /** | /** | ||||
| * 保存或更新实体 | * 保存或更新实体 | ||||
| @@ -36,7 +36,7 @@ public interface PosOrderService { | |||||
| * | * | ||||
| * @param id | * @param id | ||||
| */ | */ | ||||
| void deleteById(Long id); | |||||
| //void deleteById(Long id); | |||||
| @@ -22,8 +22,8 @@ public class PosOrderServiceImpl implements PosOrderService { | |||||
| } | } | ||||
| @Override | @Override | ||||
| public PosOrder getById(Long id) { | |||||
| return posOrderMapper.selectById(id); | |||||
| public PosOrder getById(Long id,String tenantId) { | |||||
| return posOrderMapper.selectById(id,tenantId); | |||||
| } | } | ||||
| @Override | @Override | ||||
| @@ -41,16 +41,9 @@ public class PosOrderServiceImpl implements PosOrderService { | |||||
| } | } | ||||
| } | } | ||||
| @Override | |||||
| public void deleteById(Long id) { | |||||
| posOrderMapper.deleteById(id); | |||||
| } | |||||
| // @Override | |||||
| // public void deleteById(Long id) { | |||||
| // posOrderMapper.deleteById(id); | |||||
| // } | |||||
| } | } | ||||
| @@ -62,6 +62,10 @@ | |||||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | <if test=" null != sortColumns"> order by ${sortColumns} </if> | ||||
| </sql> | </sql> | ||||
| <select id="selectById" parameterType="java.util.HashMap" resultMap="BaseResultMap"> | |||||
| select <include refid="allColumns" /> from pos_order where id =#{id} and tenant_id = #{tenantId} | |||||
| </select> | |||||
| <select id="findList" parameterType="com.iformall.domain.po.PosOrder" resultMap="BaseResultMap"> | <select id="findList" parameterType="com.iformall.domain.po.PosOrder" resultMap="BaseResultMap"> | ||||
| select <include refid="allColumns" /> from pos_order | select <include refid="allColumns" /> from pos_order | ||||
| <include refid="dynamicWhereConditions" /> | <include refid="dynamicWhereConditions" /> | ||||