Commit 1101833a authored by ysongq's avatar ysongq

db-1 功能完成

parent 6581f63c
......@@ -18,4 +18,8 @@
alter table t_data_goods_category add `category_location` varchar(128) DEFAULT NULL COMMENT '图片位置';
alter table t_data_goods_category add category_desc varchar(40) DEFAULT NULL COMMENT '分类描述';
alter table t_banner add sort Bigint(20) DEFAULT NULL COMMENT '排序';
alter table t_banner add banner_url varchar(128) DEFAULT NULL COMMENT '广告链接';
\ No newline at end of file
alter table t_banner add banner_url varchar(128) DEFAULT NULL COMMENT '广告链接';
alter table t_mall_customer add customer_source char(2) DEFAULT NULL COMMENT '账号来源:01DB,02VSS';
alter table t_department add department_source char(2) DEFAULT NULL COMMENT '企业来源:01DB,02VSS';
alter table t_mall_customer add vendor_id varchar(128) DEFAULT NULL COMMENT '供应商编码';
alter table t_order add department_id bigint(20) DEFAULT NULL COMMENT '企业id';
\ No newline at end of file
......@@ -4,6 +4,7 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
......@@ -28,6 +29,11 @@ public class MallCustomerApiDto implements Serializable {
*/
@ApiModelProperty(value = "企业id")
private Long departmentId;
@ApiModelProperty(value = "企业名称")
private String departmentName;
@ApiModelProperty(value = "供应商编号")
private String vendorId;
/**
* 密码
*/
......
package com.jz.common.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import lombok.Data;
......@@ -21,120 +24,152 @@ public class Department implements Serializable {
/**
* 企业id
*/
@TableId(value = "department_id",type = IdType.AUTO)
private Long departmentId;
/**
* 企业名称
*/
@TableField(value = "department_name")
private String departmentName;
/**
* 法人代表
*/
@TableField(value = "legal_representative")
private String legalRepresentative;
/**
* 省份
*/
@TableField(value = "province")
private String province;
/**
* 城市
*/
@TableField(value = "city")
private String city;
@TableField(value = "linkman")
private String linkman;
/**
* 行业
*/
@TableField(value = "industry")
private String industry;
/**
* 联系电话
*/
@TableField(value = "telephone")
private String telephone;
/**
* 注册地址
*/
@TableField(value = "registered_address")
private String registeredAddress;
/**
* 区域编码
*/
@TableField(value = "zone_code")
private Object zoneCode;
/**
* 企业照片
*/
@TableField(value = "depart_picture")
private String departPicture;
/**
* 营业执照
*/
@TableField(value = "business_license")
private String businessLicense;
/**
* 税务登记
*/
@TableField(value = "tax_registration")
private String taxRegistration;
/**
* 企业照片(代码)到期时间
*/
@TableField(value = "depart_picture_time")
private Date departPictureTime;
/**
* 营业执照到期时间
*/
@TableField(value = "business_license_time")
private Date businessLicenseTime;
/**
* 税务登记到期时间
*/
@TableField(value = "tax_registration_time")
private Date taxRegistrationTime;
@TableField(value = "department_source")
private String departmentSource;
/**
* 统一社会信用代码
*/
@TableField(value = "unified_credit_code")
private String unifiedCreditCode;
/**
* 开户行名称
*/
@TableField(value = "bank_name")
private String bankName;
/**
* 银行卡号
*/
@TableField(value = "bank_card_number")
private String bankCardNumber;
/**
* 开户行地址
*/
@TableField(value = "bank_address")
private String bankAddress;
/**
* 开户行号
*/
@TableField(value = "bank_no")
private String bankNo;
/**
* 审核状态:01待审核,02已审核,03未通过
*/
@TableField(value = "audit_status")
private String auditStatus;
/**
* 驳回原因
*/
@TableField(value = "reject_reason")
private String rejectReason;
/**
* 审核人
*/
@TableField(value = "audit_person")
private String auditPerson;
/**
* 审核时间
*/
@TableField(value = "audit_time")
private Date auditTime;
/**
* 创建时间
*/
@TableField(value = "cre_time")
private Date creTime;
/**
* 创建人
*/
@TableField(value = "cre_person")
private String crePerson;
/**
* 更新时间
*/
@TableField(value = "upt_time")
private Date uptTime;
/**
* 更新人
*/
@TableField(value = "upt_person")
private String uptPerson;
/**
* 删除标识
*/
@TableField(value = "del_flag")
private String delFlag;
......
......@@ -18,16 +18,16 @@ import javax.annotation.Resource;
@Slf4j
@Component
public class CurrentUserUtil {
@Resource
private static RedisTemplate redisTemplate;
public static SysUserDto userDto() {
SysUserDto userDto = (SysUserDto) redisTemplate.opsForValue().get("USER_" + RedisMessageConstant.SENDTYPE_LOGIN_SYS);
return userDto;
}
//
// @Resource
// private static RedisTemplate redisTemplate;
//
//
//
// public static SysUserDto userDto() {
// SysUserDto userDto = (SysUserDto) redisTemplate.opsForValue().get("USER_" + RedisMessageConstant.SENDTYPE_LOGIN_SYS);
// return userDto;
// }
}
package com.jz.dm.mall.moduls.controller;
import com.jz.common.utils.Result;
import com.jz.dm.mall.moduls.controller.customer.bean.req.LoginByVSSReq;
import com.jz.dm.mall.moduls.service.MallCustomerService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import com.jz.dm.mall.moduls.service.TestService;
import org.springframework.web.servlet.ModelAndView;
@RestController
import javax.servlet.http.HttpServletResponse;
@Controller
@RequestMapping("/test")
public class TestController {
@Autowired
private TestService testService;
@Autowired
private MallCustomerService service;
public static void main(String[] args) {
System.out.println("s");
}
......@@ -51,10 +65,11 @@ public class TestController {
// wk.close();
// }
@RequestMapping("/hello")
public void test() throws Exception {
@RequestMapping(value = "/hello",method = RequestMethod.POST)
@ApiOperation("hello")
public String test() throws Exception {
//Result result = service.loginByVss(req);
return "redirect:http://www.baidu.com";
}
}
......@@ -2,6 +2,7 @@ package com.jz.dm.mall.moduls.controller.company;
import com.jz.common.utils.Result;
import com.jz.dm.mall.moduls.controller.company.bean.req.CompanyAddReq;
import com.jz.dm.mall.moduls.controller.company.bean.req.CompanyEditReq;
import com.jz.dm.mall.moduls.controller.company.bean.req.CompanyUpdateReq;
import com.jz.dm.mall.moduls.service.CompanyAuthService;
import io.swagger.annotations.Api;
......@@ -12,6 +13,7 @@ import org.springframework.web.bind.annotation.*;
import reactor.core.publisher.Mono;
import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;
/**
* @author ZC
......@@ -74,12 +76,29 @@ public class CompanyAuthController {
return Mono.fromSupplier(() ->companyAuthService.checkCompanyInfo(request));
}
@PostMapping("editCompany")
@ApiOperation(value = "重新认证企业")
public Result editCompany(@RequestBody @Valid CompanyEditReq req) {
return companyAuthService.editCompany(req);
}
/**
* 获取省份
* @return
*/
@GetMapping("/getProvince")
@ApiOperation(value = "获取所有省份")
public Result getProvince() {
return companyAuthService.getProvince();
}
/**
* 获取城市
* @param provinceCode
* @param cityCode
* @return
*/
@PostMapping("/getCity")
@ApiOperation(value = "获取当前省份下的城市")
public Result getCity(@RequestParam(name = "provinceCode") String provinceCode,
......
......@@ -64,6 +64,6 @@ public class CompanyAddReq implements Serializable {
@ApiModelProperty(value = "登录用户名称",hidden = true)
private String loginName;
@ApiModelProperty(value = "用户角色 2:卖方,3:买方")
@ApiModelProperty(value = "用户角色 2:卖方,3:买方", hidden = true)
private Long roleId;
}
package com.jz.dm.mall.moduls.controller.company.bean.req;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/2/18
* @Version:
*/
@ApiModel("重新认证企业校验请求参数")
@Data
public class CompanyEditReq implements Serializable {
@ApiModelProperty(value = "统一社会编码",required = true)
@NotNull(message = "统一社会编码不能为空")
private String unifiedCreditCode;
}
package com.jz.dm.mall.moduls.controller.customer;
import com.jz.common.constant.RedisMessageConstant;
import com.jz.common.constant.ResultMsg;
import com.jz.common.utils.Result;
import com.jz.common.utils.StatusCode;
import com.jz.dm.mall.moduls.controller.customer.bean.dto.CustomerDto;
import com.jz.dm.mall.moduls.controller.customer.bean.req.LoginByVSSReq;
import com.jz.dm.mall.moduls.controller.customer.bean.req.LoginRequest;
import com.jz.dm.mall.moduls.entity.MallCustomer;
import com.jz.dm.mall.moduls.service.MallCustomerService;
......@@ -11,9 +13,18 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.catalina.servlet4preview.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
/**
* @ClassName:
......@@ -21,7 +32,7 @@ import org.springframework.web.bind.annotation.*;
* @Date: 2020/12/2
* @Version:
*/
@RestController
@Controller
@RequestMapping("/customer")
@Api(tags = "商城登陆--controller")
public class LoginController {
......@@ -41,11 +52,31 @@ public class LoginController {
* @return
*/
@PostMapping(value = "/login")
@ResponseBody
@ApiOperation(value = "登陆功能")
public Result result(@RequestBody LoginRequest customer) {
public Result login(@RequestBody LoginRequest customer) {
return mallCustomerService.loginByUser(customer);
}
@PostMapping(value = "/loginByVSS")
@ApiOperation(value = "登陆功能--Vss")
public String loginByVss(@RequestBody LoginByVSSReq req) {
try {
Result result = mallCustomerService.loginByVss(req);
return "redirect:http://www.baidu.com";
}catch (Exception e) {
e.printStackTrace();
}
return null;
}
@GetMapping(value = "/getUserMessage")
@ApiOperation(value = "vss--获取用户信息")
@ResponseBody
public Result getUserMessage() {
return mallCustomerService.getUserMessage();
}
/**
* 手机获取验证码
*
......@@ -53,6 +84,7 @@ public class LoginController {
* @return
*/
@PostMapping(value = "/getCode")
@ResponseBody
@ApiOperation("通过手机号码获取验证码")
public Result loginCheck(@RequestParam(value = "telephone") String telephone,
@RequestParam(value = "validateCode")String validateCode) throws Exception{
......@@ -79,6 +111,7 @@ public class LoginController {
* @return
*/
@GetMapping(value = "/phoneCheck")
@ResponseBody
@ApiOperation(value = "手机号码校验接口", notes = "手机号码是否已注册")
public Result phoneCheck(@RequestParam("telephone") String telephone) throws Exception{
if (telephone == null) {
......@@ -101,6 +134,7 @@ public class LoginController {
* @return
*/
@GetMapping(value = "/phoneUserCheck")
@ResponseBody
@ApiOperation(value = "手机号用户名重复校验接口", notes = "手机号用户名是否重复")
public Result phoneCheck(@RequestParam(value = "username") String username ,
@RequestParam(value = "password") String telephone, HttpServletRequest request) throws Exception{
......
package com.jz.dm.mall.moduls.controller.customer.bean.req;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/2/24
* @Version:
*/
@ApiModel(value = "vss登陆账号请求参数")
@Data
public class LoginByVSSReq implements Serializable {
@ApiModelProperty(value = "用户账号")
@NotNull(message = "用户账号不能为空")
private String customerAccount;
@ApiModelProperty(value = "企业名称")
@NotNull(message = "企业名称不能为空")
private String departmentName;
@ApiModelProperty(value = "统一社会信用代码")
@NotNull(message = "统一社会信用代码不能为空")
private String unifiedCreditCode;
@ApiModelProperty(value = "供应商编码")
@NotNull(message = "供应商编码不能为空")
private String vendorId;
}
......@@ -4,15 +4,14 @@ package com.jz.dm.mall.moduls.controller.goods;
import com.jz.common.base.BaseController;
import com.jz.common.utils.Result;
import com.jz.dm.mall.moduls.controller.goods.bean.dto.DataGoodsApiDto;
import com.jz.dm.mall.moduls.controller.goods.bean.request.DataApiDetailsReq;
import com.jz.dm.mall.moduls.service.DataGoodsApiService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.List;
/**
......@@ -23,7 +22,7 @@ import java.util.List;
*/
@RestController
@RequestMapping("dataGoodsApi")
@Api(tags = "数据api-controller")
@Api(tags = "商城--数据目录--controller")
public class DataGoodsApiController extends BaseController {
/**
* 服务对象
......@@ -33,15 +32,12 @@ public class DataGoodsApiController extends BaseController {
/**
* 根据主键查询商品详情-api
* @param id
* @param
* @return
*/
@GetMapping("/getGoodsDetails/{id}")
@ApiOperation(value = "点击商品查看商品详情", notes = "api商品")
public Result<List<DataGoodsApiDto>> findById(@PathVariable(value = "id") Long id) {
if (id != null) {
return tDataGoodsApiService.selectById(id);
}
return Result.of_error("查询失败!");
@PostMapping("/findByDetails")
@ApiOperation(value = "数据预览--商品详情", notes = "api商品")
public Result findByDetails(@RequestBody @Valid DataApiDetailsReq req) {
return tDataGoodsApiService.findByDetails(req);
}
}
\ No newline at end of file
......@@ -20,21 +20,31 @@ import org.springframework.web.bind.annotation.RestController;
*/
@RestController
@RequestMapping("dataGoodsCategory")
@Api(tags = "数据商品分类行业")
@Api(tags = "商城--数据银行首页--controller")
public class DataGoodsCategoryController extends BaseController {
/**
* 服务对象
*/
@Autowired
private DataGoodsCategoryService categoryService;
/**
* 查询数据商品分类
* @return
*/
@GetMapping(value = "/findCategory")
@ApiOperation(value = "查询数据商品分类", notes = "查询所有的商品分类")
@ApiOperation(value = "首页--展示一级数据分类")
public Result findCategory() {
Result result = categoryService.findCategory();
if (StringUtils.isEmpty(result)) {
return Result.of_error("查询失败!");
}
return result;
return categoryService.findCategory();
}
/**
* 查询场景分类
* @return
*/
@GetMapping(value = "/findScene")
@ApiOperation(value = "首页--展示场景分类")
public Result findScene() {
return categoryService.findScene();
}
}
\ No newline at end of file
package com.jz.dm.mall.moduls.controller.goods;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jz.common.base.BaseController;
import com.jz.common.bean.BaseBeanResponse;
import com.jz.common.bean.BaseResponse;
import com.jz.common.bean.PageInfoResponse;
import com.jz.common.constant.Constants;
import com.jz.common.constant.ResultMsg;
import com.jz.common.utils.Result;
import com.jz.dm.mall.moduls.controller.goods.bean.dto.DataGoodsApiDto;
import com.jz.dm.mall.moduls.controller.goods.bean.dto.DataGoodsDto;
import com.jz.dm.mall.moduls.controller.goods.bean.dto.DataGoodsListDto;
import com.jz.dm.mall.moduls.controller.goods.bean.request.DataApiUpReq;
......@@ -29,7 +32,7 @@ import javax.servlet.http.HttpServletRequest;
*/
@RestController
@RequestMapping("dataGoods")
@Api(tags = "数据商品管理--controller")
@Api(tags = "商城--数据目录--controller")
public class DataGoodsController extends BaseController {
/**
* 服务对象
......@@ -94,25 +97,28 @@ public class DataGoodsController extends BaseController {
/**
* 列表查询商品数据
* @param dataGoodsListRequest
* @param req
* @param httpRequest
* @return
*/
@PostMapping(value = "/findList")
@ApiOperation(value = "分页展示商品列表", notes = "首页点击分类展示商品列表")
public PageInfoResponse<DataGoodsListDto> findByCategory(@RequestBody DataGoodsListRequest dataGoodsListRequest, HttpServletRequest httpRequest) {
PageInfoResponse<DataGoodsListDto> pageInfo = new PageInfoResponse<DataGoodsListDto>();
@ApiOperation(value = "数据目录--分页展示商品列表", notes = "首页点击分类展示商品列表")
public PageInfoResponse<DataGoodsListDto> findByCategory(@RequestBody DataGoodsListRequest req, HttpServletRequest httpRequest) {
PageInfoResponse<DataGoodsListDto> baseBeanResponse = new PageInfoResponse<DataGoodsListDto>();
try {
pageInfo = dataGoodsService.findList(dataGoodsListRequest, httpRequest);
baseBeanResponse = dataGoodsService.findList(req, httpRequest);
} catch (Exception e) {
pageInfo.setMessage("查询失败");
pageInfo.setCode(Constants.FAILURE_CODE);
baseBeanResponse.setMessage("查询失败");
baseBeanResponse.setCode(Constants.FAILURE_CODE);
e.printStackTrace();
}
return pageInfo;
return baseBeanResponse;
}
/**新增数据商品
* @param
* @return
......
package com.jz.dm.mall.moduls.controller.goods.bean.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/2/20
* @Version:
*/
@ApiModel("api详情返回参数")
@Data
public class DataApiDetailsDto implements Serializable {
@ApiModelProperty(value = "apiId")
private Long id;
@ApiModelProperty(value = "apiKey")
private String apiKey;
@ApiModelProperty(value = "api名称")
private String apiName;
@ApiModelProperty(value = "返回类型")
private String outputType;
@ApiModelProperty(value = "目标地址")
private String targetUrl;
@ApiModelProperty(value = "加密方式 0:无 1:MD5,2:RES")
private String signType;
@ApiModelProperty(value = "传输方式 0,http,1.https")
private String apiProtocl;
@ApiModelProperty(value = "超时时间")
private Integer timeout;
@ApiModelProperty(value = "请求方式")
private String reqType;
@ApiModelProperty(value = "最大行数")
private Integer maxRow;
@ApiModelProperty(value = "每页返回数")
private Integer pageRow;
@ApiModelProperty(value = "调用限制")
private Long reqFrequency;
@ApiModelProperty(value = "api描述")
private String apiFunction;
@ApiModelProperty(value = "最大数据量")
private Integer maxData;
@ApiModelProperty(value = "请求参数")
private String requestParam;
@ApiModelProperty(value = "返回参数")
private String responseParam;
@ApiModelProperty(value = "api类型")
private String apiType;
}
package com.jz.dm.mall.moduls.controller.goods.bean.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/2/23
* @Version:
*/
@ApiModel("返回参数")
@Data
public class DataApiDetailsParamsDto implements Serializable {
@ApiModelProperty(value = "参数名称")
private String paramsName;
@ApiModelProperty(value = "参数类型")
private String paramsType;
@ApiModelProperty(value = "参数描述")
private String paramsDesc;
@ApiModelProperty(value = "是否必填")
private String ifRequird;
}
package com.jz.dm.mall.moduls.controller.goods.bean.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.jz.common.entity.DataGoodsApiParams;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* @ClassName: 商品详情参数封装
......@@ -22,163 +22,91 @@ import java.util.List;
public class DataGoodsApiDto implements Serializable {
/**
* api商品id
* 商品详情
*/
@ApiModelProperty(value = "api商品id")
private Long goodsApi;
/**
* 数据id
*/
@ApiModelProperty(value = "数据id")
private Long dataGoodsId;
@ApiModelProperty(value = "分类名称")
private String categoryName;
/**
* api参数id
*/
@ApiModelProperty(value = "api参数id")
private Long apiParamsId;
/**
* api服务名称
*/
@ApiModelProperty(value = "数据名称")
@ApiModelProperty(value = "商品名称")
private String dataName;
/**
* 请求类型(方式)
*/
@ApiModelProperty(value = "请求类型(方式)")
private String requestType;
/**
* api接口地址
*/
@ApiModelProperty(value = "api接口地址")
private String apiUrl;
/**
* api接口方法
*/
@ApiModelProperty(value = "api接口方法")
private String apiMethod;
@ApiModelProperty(value = "api描述")
private String apiFunction;
/**
* api请求协议
*/
@ApiModelProperty(value = "api请求协议")
private String apiProtocl;
@ApiModelProperty(value = "服务商",hidden = true)
private String userId;
/**
* 返回类型
*/
@ApiModelProperty(value = "返回类型")
private String returnType;
@ApiModelProperty(value = "apiKey")
private String apiKey;
/**
* 更新时间
*/
@ApiModelProperty(value = "更新时间")
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date uptTime;
/**
* 价格类型
*/
@ApiModelProperty(value = "价格类型")
private String priceType;
@ApiModelProperty(value = "所属商品分类")
private String categoryName;
@ApiModelProperty(value = "商品价格")
private BigDecimal dataPrice;
@ApiModelProperty(value = "")
private String yearType;
/**
* 供应商名称
*/
@ApiModelProperty(value = "供应商名称")
private String supplierName;
@ApiModelProperty(value = "季")
private String seasonType;
/**
* 参数分类
*/
@ApiModelProperty(value = "参数分类:01公共参数,02请求参数,03响应参数,04请求头参数,05状态码参数")
private String paramsDiff;
@ApiModelProperty(value = "月")
private String monthType;
@ApiModelProperty(value = "年(元)")
private BigDecimal yearType;
@ApiModelProperty(value = "")
private String secondType;
@ApiModelProperty(value = "季(元)")
private BigDecimal seasonType;
@ApiModelProperty(value = "商品有限期")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date goodsLimited;
@ApiModelProperty(value = "月(元)")
private BigDecimal monthType;
@ApiModelProperty(value = "数据大小")
private String dataBag;
@ApiModelProperty(value = "次(元)")
private BigDecimal secondType;
@ApiModelProperty(value = "商品描述")
private String dataDesc;
/**
* 参数名称
*/
@ApiModelProperty(value = "参数名称")
private String paramsName;
@ApiModelProperty(value = "商品图片")
private String dataPicture;
/**
* 参数类型
*/
@ApiModelProperty(value = "参数类型")
private String paramsTYpe;
@ApiModelProperty(value = "价格类型 01免费 02收费")
private String priceType;
/**
* 参数描述
*/
@ApiModelProperty(value = "参数描述")
private String paramsDesc;
@ApiModelProperty(value = "调用次数上限")
private Long reqFrequency;
/**
* 默认值
* api详情
*/
@ApiModelProperty(value = "默认值")
private String defaultValue;
@ApiModelProperty(value = "接口地址")
private String targetUrl;
/**
* 是否必选
*/
@ApiModelProperty(value = "是否必选:Y是,N否")
private String ifRequird;
@ApiModelProperty(value = "加密方式 0:无,1:MD5, 2:RSA")
private String signType;
/**
* 数据类型
*/
@ApiModelProperty(value = "数据类型")
private String dataType;
@ApiModelProperty(value = "传输方式")
private String apiProtocl;
/**
* api返回数据样例
*/
@ApiModelProperty(value = "api返回数据样例")
private String returnDataExample;
@ApiModelProperty(value = "请求方式")
private String reqType;
/**
* api请求样例
*/
@ApiModelProperty(value = "api请求样例")
private String requestExample;
@ApiModelProperty(value = "超时时间")
private Integer timeout;
@ApiModelProperty(value = "参数分类数字")
private String paramsDiffNum;
@ApiModelProperty(value = "返回类型")
private String outputType;
@ApiModelProperty(value = "数据最大量")
private Integer maxData;
@ApiModelProperty(value = "数据商品图片")
private String dataPicture;
@ApiModelProperty(value = "最大页数")
private Integer maxRow;
@ApiModelProperty(value = "数据描述")
private String dataDesc;
@ApiModelProperty(value = "每页数据量")
private String pageRow;
@ApiModelProperty(value = "请求参数")
private List<Map<String, String>> requestParam;
@ApiModelProperty(value = "返回参数")
private List<Map<String, String>> responseParam;
@ApiModelProperty(value = "创建时间")
private Date creTime;
}
......@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
/**
......@@ -23,79 +24,30 @@ public class DataGoodsListDto {
@ApiModelProperty(value = "数据商品id")
private Long dataGoodsId;
/**
* 商品分类id
*/
@ApiModelProperty(value = "商品分类id")
private Long categoryId;
/**
* 数据商品名称
*/
@ApiModelProperty(value = "数据商品名称")
private String dataName;
/**
* 分类名称
*/
@ApiModelProperty(value = "分类名称")
private String categoryName;
/**
* 数据类型
*/
@ApiModelProperty(value = "数据类型:01api,02数据包")
private String dataType;
/**
* 数据商品标签
*/
@ApiModelProperty(value = "数据商品标签")
private String dataLabel;
/**
* 数据商品图片
*/
@ApiModelProperty(value = "数据商品图片")
private String dataPicture;
/**
* 数据商品价格
*/
@ApiModelProperty(value = "数据商品价格")
private BigDecimal dataPrice;
/**
* 价格类型
*/
@ApiModelProperty(value = "价格类型")
private String priceType;
/**
* 年(元)
*/
@ApiModelProperty(value = "年(元)")
private BigDecimal yearType;
@ApiModelProperty(value = "数据描述")
private String dataDesc;
/**
* 季(元)
*/
@ApiModelProperty(value = "季(元)")
private BigDecimal seasonType;
/**
* 月(元)
*/
@ApiModelProperty(value = "月(元)")
private BigDecimal monthType;
@ApiModelProperty("更新时间")
private Date uptTime;
/**
* 次(元)
*/
@ApiModelProperty(value = "次(元)")
private BigDecimal secondType;
@ApiModelProperty("对接客户数")
private String userNumbers;
@ApiModelProperty("apiKey")
private String apiKey;
@ApiModelProperty("授权")
private String goodsToken;
@ApiModelProperty("商品分类id")
private Long categoryId;
@ApiModelProperty("场景分类id")
private Long sceneId;
}
package com.jz.dm.mall.moduls.controller.goods.bean.request;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/2/22
* @Version:
*/
@ApiModel(value = "数据预览--商品详情请求参数")
@Data
public class DataApiDetailsReq implements Serializable {
@ApiModelProperty(value = "商品id")
@NotNull(message = "商品id不能为空")
private Long dataGoodsId;
@ApiModelProperty(value = "apiKey")
@NotNull(message = "apiKey不能为空")
private String apiKey;
@ApiModelProperty(value = "是否授权")
private String goodsToken;
}
......@@ -3,6 +3,7 @@ package com.jz.dm.mall.moduls.controller.goods.bean.request;
import com.jz.common.bean.BasePageBean;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
......@@ -12,7 +13,8 @@ import java.util.Date;
* @Date: 2020/12/9
* @Version:
*/
@ApiModel(value = "数据集市--数据商品列表参数对象", description = "数据商品列表参数对象")
@ApiModel(value = "数据目录--数据商品列表参数对象", description = "数据商品列表参数对象")
@Data
public class DataGoodsListRequest extends BasePageBean {
/**
......@@ -21,35 +23,8 @@ public class DataGoodsListRequest extends BasePageBean {
@ApiModelProperty(value = "商品分类id")
private Long categoryId;
/**
* 价格类型
*/
@ApiModelProperty(value = "价格类型")
private String priceType;
/**
* 综合排序
*/
@ApiModelProperty(value = "综合排序")
private String synthesizeRank;
/**
* 更新时间
*/
@ApiModelProperty(value = "更新时间")
private Date uptTime;
/**
* 数据商品名称
*/
@ApiModelProperty(value = "数据商品名称")
private String dataName;
/**
* 使用人数
*/
@ApiModelProperty(value = "使用人数")
private Long usePerson;
@ApiModelProperty(value = "场景分类id")
private Long sceneId;
/**
* 数据类型
......@@ -57,59 +32,7 @@ public class DataGoodsListRequest extends BasePageBean {
@ApiModelProperty(value = "数据类型:01api,02数据包")
private String dataType;
public Long getUsePerson() {
return usePerson;
}
public void setUsePerson(Long usePerson) {
this.usePerson = usePerson;
}
public Long getCategoryId() {
return categoryId;
}
public void setCategoryId(Long categoryId) {
this.categoryId = categoryId;
}
public String getPriceType() {
return priceType;
}
public void setPriceType(String priceType) {
this.priceType = priceType;
}
public String getSynthesizeRank() {
return synthesizeRank;
}
public void setSynthesizeRank(String synthesizeRank) {
this.synthesizeRank = synthesizeRank;
}
public Date getUptTime() {
return uptTime;
}
public void setUptTime(Date uptTime) {
this.uptTime = uptTime;
}
public String getDataName() {
return dataName;
}
public void setDataName(String dataName) {
this.dataName = dataName;
}
public String getDataType() {
return dataType;
}
@ApiModelProperty(value = "数据搜索商品名称")
private String dataName;
public void setDataType(String dataType) {
this.dataType = dataType;
}
}
......@@ -144,12 +144,6 @@ public class OrderController {
@PostMapping(value = "/resetSalt")
@ApiOperation(value = "订单详情---重置盐值", notes = "重置盐值")
public Result resetSalt(@RequestBody @Valid SaltResetReq req) {
Result result = new Result();
if (StringUtils.isNotEmpty(req.getGoodsToken()) && req.getId() != null) {
result = orderService.updateSalt(req);
}else {
result.setMessage("参数不能为空!");
}
return result;
return orderService.updateSalt(req);
}
}
\ No newline at end of file
package com.jz.dm.mall.moduls.controller.order.bean.dto;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/2/24
* @Version:
*/
@ApiModel(value = "api日志返回参数")
@Data
public class ApiReqLogDto implements Serializable {
/**
* 主健ID
*/
@ApiModelProperty("主健ID")
private Long id;
/**
* 请求ip
*/
@ApiModelProperty("请求ip")
private String requestIp;
/**
* apikey
*/
@ApiModelProperty("api_key")
private String apiKey;
/**
* 请求参数
*/
@ApiModelProperty("request_params")
private String requestParams;
/**
* 返回参数
*/
@ApiModelProperty("response_params")
private String responseParams;
/**
* 请求路径
*/
@ApiModelProperty("request_url")
private String requestUrl;
/**
* 请求方法
*/
@ApiModelProperty("request_method")
private String requestMethod;
/**
* 客户请求token
*/
@ApiModelProperty("request_token")
private String requestToken;
/**
* 处理状态 默认为0 未处理
*/
@ApiModelProperty("处理状态 默认为0 未处理")
private String handlerStatus;
/**
* 请求总耗时
*/
@ApiModelProperty("请求总耗时")
private String requestConsuming;
/**
* 请求开始时间
*/
@ApiModelProperty("请求开始时间")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date requestStartTime;
/**
* 请求结束时间
*/
@ApiModelProperty("请求结束时间")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date requestEndTime;
/**
* 请求状态: SUCCEED 成功 ,FAIL 失败
*/
@ApiModelProperty("请求状态: SUCCEED 成功 ,FAIL 失败")
private String status;
/**
* 备注
*/
@TableField("remark")
@JsonIgnore
private String remark;
@ApiModelProperty(value = "调用数")
@TableField(exist = false)
private String callNumber;
@ApiModelProperty(value = "错误率")
@TableField(exist = false)
private String errorRate;
@ApiModelProperty(value = "成功数")
@TableField(exist = false)
private String scSuccess;
@ApiModelProperty(value = "错误数")
@TableField(exist = false)
private String wrongNumber;
}
......@@ -16,6 +16,11 @@ import java.io.Serializable;
@Data
public class OrderByPurchaserDto implements Serializable {
@ApiModelProperty(value = "订单id")
private Long orderId;
@ApiModelProperty(value = "商品id")
private Long dataGoodsId;
@ApiModelProperty(value = "商品名称")
private String dataName;
......@@ -29,7 +34,7 @@ public class OrderByPurchaserDto implements Serializable {
@ApiModelProperty(value = "价格")
private String orderMoney;
@ApiModelProperty(value = "价格类型")
@ApiModelProperty(value = "价格类型 01免费,02收费")
private String priceType;
@ApiModelProperty(value = "盐值")
......@@ -40,4 +45,8 @@ public class OrderByPurchaserDto implements Serializable {
@ApiModelProperty(value = "apiKey")
private String apiKey;
@ApiModelProperty(value = "订单状态 01有效,02失效")
private String goodsStatus;
}
......@@ -31,6 +31,9 @@ public class LogInfoListReq implements Serializable {
private String requestToken;
@ApiModelProperty(value = "创建时间")
private String createDate;
@ApiModelProperty(value = "历史查询-数据银行")
@ApiModelProperty(value = "历史查询-数据银行: 输入01")
private String historyQuery;
@ApiModelProperty(value = "订单id")
private Long orderId;
}
......@@ -48,5 +48,6 @@ public class OrderRequest extends BasePageBean {
@ApiModelProperty(value = "搜索")
private String search;
@ApiModelProperty(value = "订单状态 01有效,02失效")
private String goodsStatus;
}
\ No newline at end of file
package com.jz.dm.mall.moduls.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import lombok.Data;
......@@ -18,11 +21,13 @@ import java.io.Serializable;
public class City implements Serializable {
private static final long serialVersionUID = -3596309983779919750L;
private Long id;
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@TableField(value = "name")
private String name;
private String city_code;
private String province_code;
@TableField(value = "city_code")
private String cityCode;
@TableField(value = "province_code")
private String provinceCode;
}
package com.jz.dm.mall.moduls.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
......@@ -22,32 +26,61 @@ public class DataGoodsCategory implements Serializable {
/**
* 商品分类id
*/
@TableId(value = "category_id", type = IdType.AUTO)
@ApiModelProperty(value = "商品分类id")
private Long categoryId;
/**
* 分类名称
*/
@TableField("category_name")
@ApiModelProperty(value = "分类名称")
private String categoryName;
/**
* 父级分类id
*/
@TableField("parent_id")
@ApiModelProperty(value = "父级分类id")
private Long parentId;
/**
* 是否为子节点:Y是,N否
*/
@TableField("if_child")
@ApiModelProperty(value = "是否为子节点")
private String ifChild;
/**
* 创建时间
*/
@TableField("cre_time")
@ApiModelProperty(value = "创建时间")
private Date creTime;
@TableField("cre_person")
@ApiModelProperty(value = "创建人")
private String crePerson;
/**
* 更新时间
*/
@TableField("upt_time")
@ApiModelProperty(value = "更新时间")
private Date uptTime;
private String delFlag;
@TableField("upt_person")
@ApiModelProperty(value = "更新人")
private String uptPerson;
@ApiModelProperty(value = "分类描述")
@TableField("category_desc")
private String categoryDesc;
private List<DataGoodsCategory> children;
@ApiModelProperty("分类图片")
@TableField("category_picture")
private String categoryPicture;
@ApiModelProperty("分类位置")
@TableField("category_location")
private String categoryLocation;
@TableField("del_flag")
@ApiModelProperty(value = "是否删除")
private String delFlag;
}
\ No newline at end of file
package com.jz.dm.mall.moduls.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
......@@ -16,6 +18,7 @@ import java.util.Date;
*/
@TableName("t_mall_customer")
@ApiModel
@Data
public class MallCustomer implements Serializable {
private static final long serialVersionUID = 844124479008859411L;
/**
......@@ -26,191 +29,91 @@ public class MallCustomer implements Serializable {
/**
* 企业id
*/
@TableField(value = "department_id")
private Long departmentId;
/**
* 密码
*/
@TableField(value = "password")
private String password;
/**
* 账户
*/
@TableField(value = "customer_account")
private String customerAccount;
/**
* 用户真实姓名
*/
@TableField(value = "customer_name")
private String customerName;
/**
* 联系电话
*/
@TableField(value = "customer_phone")
private String customerPhone;
/**
* 邮箱
*/
@TableField(value = "customer_email")
private String customerEmail;
/**
* 地址
*/
@TableField(value = "customer_address")
private String customerAddress;
/**
* 供应商编码
*/
@TableField(value = "vendor_id")
private String vendorId;
/**
* 账号来源
*/
@TableField(value = "customer_source")
private String customerSource;
/**
* 用户积分
*/
@TableField(value = "customer_point")
private Long customerPoint;
/**
* 注册时间
*/
@TableField(value = "register_time")
private Date registerTime;
/**
* 会员等级
*/
@TableField(value = "customer_level")
private String customerLevel;
/**
* 证件号
*/
@TableField(value = "identity_card")
private String identityCard;
/**
* 创建时间
*/
@TableField(value = "cre_time")
private Date creTime;
@TableField(value = "cre_person")
private String crePerson;
/**
* 更新时间
*/
@TableField(value = "upt_time")
private Date uptTime;
/**
* 更新人
*/
@TableField(value = "upt_person")
private String uptPerson;
/**
* 删除标识:Y是,N否
*/
@TableField(value = "del_flag")
private String delFlag;
public String getUptPerson() {
return uptPerson;
}
public void setUptPerson(String uptPerson) {
this.uptPerson = uptPerson;
}
public Long getCustomerId() {
return customerId;
}
public void setCustomerId(Long customerId) {
this.customerId = customerId;
}
public Long getDepartmentId() {
return departmentId;
}
public void setDepartmentId(Long departmentId) {
this.departmentId = departmentId;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getCustomerAccount() {
return customerAccount;
}
public void setCustomerAccount(String customerAccount) {
this.customerAccount = customerAccount;
}
public String getCustomerName() {
return customerName;
}
public void setCustomerName(String customerName) {
this.customerName = customerName;
}
public String getCustomerPhone() {
return customerPhone;
}
public void setCustomerPhone(String customerPhone) {
this.customerPhone = customerPhone;
}
public String getCustomerEmail() {
return customerEmail;
}
public void setCustomerEmail(String customerEmail) {
this.customerEmail = customerEmail;
}
public String getCustomerAddress() {
return customerAddress;
}
public void setCustomerAddress(String customerAddress) {
this.customerAddress = customerAddress;
}
public Long getCustomerPoint() {
return customerPoint;
}
public void setCustomerPoint(Long customerPoint) {
this.customerPoint = customerPoint;
}
public Date getRegisterTime() {
return registerTime;
}
public void setRegisterTime(Date registerTime) {
this.registerTime = registerTime;
}
public String getCustomerLevel() {
return customerLevel;
}
public void setCustomerLevel(String customerLevel) {
this.customerLevel = customerLevel;
}
public String getIdentityCard() {
return identityCard;
}
public void setIdentityCard(String identityCard) {
this.identityCard = identityCard;
}
public Date getCreTime() {
return creTime;
}
public void setCreTime(Date creTime) {
this.creTime = creTime;
}
public Date getUptTime() {
return uptTime;
}
public void setUptTime(Date uptTime) {
this.uptTime = uptTime;
}
public String getDelFlag() {
return delFlag;
}
public void setDelFlag(String delFlag) {
this.delFlag = delFlag;
}
}
\ No newline at end of file
package com.jz.dm.mall.moduls.entity;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/2/3
* @Version:
*/
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* @ClassName: 场景分类表
* @Author: Carl
* @Date: 2021/2/3
* @Version:
*/
@TableName("t_scene_category")
@ApiModel
@Data
public class SceneCategory implements Serializable {
private static final long serialVersionUID = -6098559795341556267L;
/**
* 场景分类id
*/
@TableId(value = "scene_id", type = IdType.AUTO)
@ApiModelProperty(value = "场景分类id")
private Long sceneId;
/**
* 分类名称
*/
@TableField("scene_name")
@ApiModelProperty(value = "分类名称")
private String sceneName;
/**
* 父级分类id
*/
@TableField("parent_id")
@ApiModelProperty(value = "父级分类id")
private Long parentId;
/**
* 是否为子节点:Y是,N否
*/
@TableField("if_child")
@ApiModelProperty(value = "是否为子节点")
private String ifChild;
/**
* 创建时间
*/
@TableField("cre_time")
@ApiModelProperty(value = "创建时间")
private Date creTime;
@TableField("cre_person")
@ApiModelProperty(value = "创建人")
private String crePerson;
/**
* 更新时间
*/
@TableField("upt_time")
@ApiModelProperty(value = "更新时间")
private Date uptTime;
@TableField("del_flag")
@ApiModelProperty(value = "是否删除")
private String delFlag;
}
package com.jz.dm.mall.moduls.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import java.io.Serializable;
/**
* @ClassName: 商品-场景分类关系表
* @Author: Carl
* @Date: 2021/2/3
* @Version:
*/
@TableName("t_scene_goods_category")
@Data
@ApiModel
public class SceneGoodsCategory implements Serializable {
private static final long serialVersionUID = 7794764423295187797L;
@TableId(value = "scene_category_id", type = IdType.AUTO)
private Long sceneCategoryId;
@TableField("scene_id")
private Long sceneId;
@TableField("category_id")
private Long categoryId;
@TableField("del_flag")
private String delFlag;
}
......@@ -3,11 +3,15 @@ package com.jz.dm.mall.moduls.mapper;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jz.common.base.BaseMapper;
import com.jz.dm.mall.moduls.controller.goods.bean.dto.DataGoodsApiDto;
import com.jz.dm.mall.moduls.controller.goods.bean.dto.DataGoodsDto;
import com.jz.dm.mall.moduls.controller.goods.bean.dto.DataGoodsListDto;
import com.jz.dm.mall.moduls.entity.DataGoods;
import org.apache.ibatis.annotations.Param;
/**
......@@ -73,4 +77,10 @@ public interface DataGoodsDao extends BaseMapper<DataGoods> {
*/
public void insertBatch(List<DataGoods> dataGoodses)throws Exception;
/**
* 获取商品详情
* @param dataGoodsId
* @return
*/
DataGoodsApiDto selectByDetails(@Param("dataGoodsId") Long dataGoodsId);
}
\ No newline at end of file
......@@ -3,6 +3,7 @@ package com.jz.dm.mall.moduls.mapper;
import com.jz.common.base.BaseMapper;
import com.jz.common.bean.MallCustomerApiDto;
import com.jz.dm.mall.moduls.controller.customer.bean.dto.CustomerDto;
import com.jz.dm.mall.moduls.controller.customer.bean.req.LoginByVSSReq;
import com.jz.dm.mall.moduls.entity.MallCustomer;
import com.jz.dm.mall.moduls.entity.MallMenu;
import com.jz.dm.mall.moduls.entity.MallUserRole;
......@@ -89,4 +90,11 @@ public interface MallCustomerDao extends BaseMapper<MallCustomer> {
* @return
*/
MallCustomerApiDto selectByUser(Map map);
/**
* 查询vss用户
* @param req
* @return
*/
MallCustomerApiDto selectByVSS(LoginByVSSReq req);
}
\ No newline at end of file
......@@ -36,18 +36,14 @@ public interface OrderDao extends BaseMapper<Order> {
*/
void updateTokenAndSalt(Order order);
/**
* 重置盐值
* @param order
*/
void updateSalt(Order order);
IPage<OrderBySellerDto> queryPageListBySeller(IPage<OrderBySellerDto> page, @Param("ew") QueryWrapper<OrderBySellerDto> query);
PurchaserUserCenterDto getMoneyAndOrderTotalDto(Map map);
List<Map<String, String>> getApiKey(@Param(value = "customerId") Long customerId);
List<Map<String, String>> getApiKey(@Param(value = "departmentId") Long departmentId);
List<OrderByPurchaserDto> queryPageListByPurchaser(Map<String, Object> param);
}
\ No newline at end of file
package com.jz.dm.mall.moduls.mapper;
import com.jz.common.base.BaseMapper;
import com.jz.dm.mall.moduls.entity.SceneCategory;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/2/3
* @Version:
*/
public interface SceneCategoryDao extends BaseMapper<SceneCategory> {
}
package com.jz.dm.mall.moduls.mapper;
import com.jz.common.base.BaseMapper;
import com.jz.dm.mall.moduls.entity.SceneGoodsCategory;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/2/3
* @Version:
*/
public interface SceneGoodsCategoryDao extends BaseMapper<SceneGoodsCategory> {
}
......@@ -2,6 +2,7 @@ package com.jz.dm.mall.moduls.service;
import com.jz.common.utils.Result;
import com.jz.dm.mall.moduls.controller.company.bean.req.CompanyAddReq;
import com.jz.dm.mall.moduls.controller.company.bean.req.CompanyEditReq;
import com.jz.dm.mall.moduls.controller.company.bean.req.CompanyUpdateReq;
import javax.servlet.http.HttpServletRequest;
......@@ -52,4 +53,11 @@ public interface CompanyAuthService {
Result getProvince();
Result getCity(String provinceCode,String cityCode);
/**
* 重新认证企业
* @param req
* @return
*/
Result editCompany(CompanyEditReq req);
}
package com.jz.dm.mall.moduls.service;
import com.jz.common.utils.Result;
import com.jz.dm.mall.moduls.controller.goods.bean.request.DataApiDetailsReq;
/**
......@@ -14,8 +14,8 @@ public interface DataGoodsApiService {
/**
* 根据主键查询商品api详情
* @param id
* @param req
* @return
*/
Result selectById(Long id);
Result findByDetails(DataApiDetailsReq req);
}
\ No newline at end of file
......@@ -11,6 +11,16 @@ import com.jz.common.utils.Result;
public interface DataGoodsCategoryService {
/**
* 查询所有的一级分类
* @return
*/
Result findCategory();
/**
* 查询所有的场景
* @return
*/
Result findScene();
}
\ No newline at end of file
package com.jz.dm.mall.moduls.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jz.common.bean.BaseBeanResponse;
import com.jz.common.bean.BaseResponse;
import com.jz.common.bean.PageInfoResponse;
import com.jz.common.utils.Result;
import com.jz.dm.mall.moduls.controller.goods.bean.dto.DataGoodsDto;
......
package com.jz.dm.mall.moduls.service;
import com.jz.common.exception.ResponseException;
import com.jz.common.utils.Result;
import com.jz.dm.mall.moduls.controller.customer.bean.dto.CustomerDto;
import com.jz.dm.mall.moduls.controller.customer.bean.req.CustomerRequest;
import com.jz.dm.mall.moduls.controller.customer.bean.req.LoginByVSSReq;
import com.jz.dm.mall.moduls.controller.customer.bean.req.LoginRequest;
import com.jz.dm.mall.moduls.entity.MallCustomer;
......@@ -72,6 +74,20 @@ public interface MallCustomerService {
*/
Result loginByUser(LoginRequest customer);
/**
* vss系统登陆
* @param req
* @return
*/
Result loginByVss(LoginByVSSReq req) throws ResponseException;
/**
* 获取登陆信息
* @return
*/
Result getUserMessage();
// /**
// * 忘记密码
// * @param customer
......
......@@ -46,12 +46,6 @@ public interface OrderService {
*/
Map getApiInterfaceDetail(Map params) throws Exception;
/**
* 重置盐值
* @param req
* @return
*/
Result updateSalt(SaltResetReq req);
/**
* 订单管理列表(分页查询)--卖方
......@@ -83,4 +77,11 @@ public interface OrderService {
* @return
*/
Result getLogDetails(LogInfoListReq req);
/**
* 重置盐值
* @param req
* @return
*/
Result updateSalt(SaltResetReq req);
}
\ No newline at end of file
package com.jz.dm.mall.moduls.service;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/2/3
* @Version:
*/
public interface SceneCategoryService {
}
package com.jz.dm.mall.moduls.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.jz.common.bean.MallCustomerApiDto;
import com.jz.common.constant.RedisMessageConstant;
import com.jz.common.constant.ResultMsg;
import com.jz.common.entity.Department;
import com.jz.common.enums.AuditStatusEnum;
import com.jz.common.enums.DelFlagEnum;
import com.jz.common.exception.ResponseException;
import com.jz.common.utils.DateUtils;
import com.jz.dm.mall.moduls.controller.company.bean.dto.CityAndAreaDto;
import com.jz.dm.mall.moduls.controller.company.bean.req.CompanyEditReq;
import com.jz.dm.mall.moduls.controller.company.bean.req.CompanyUpdateReq;
import com.jz.dm.mall.moduls.controller.company.bean.dto.CompanyInfoDto;
import com.jz.dm.mall.moduls.entity.*;
......@@ -222,6 +226,29 @@ public class CompanyAuthServiceImpl implements CompanyAuthService {
return Result.of_success(listProviceName);
}
/**
* 重新认证企业
*
* @param req
* @return
*/
@Override
public Result editCompany(CompanyEditReq req) {
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.eq("unified_credit_code",req.getUnifiedCreditCode());
queryWrapper.eq("del_flag", DelFlagEnum.NO.getValue());
queryWrapper.eq("audit_status", AuditStatusEnum.WTG.getValue());
Department department = departmentDao.selectOne(queryWrapper);
if (department != null) {
department.setAuditStatus(AuditStatusEnum.DSH.getValue());
if(departmentDao.updateById(department) != 1) {
return Result.of_error(ResultMsg.UPDATE_FAIL);
}
return Result.of_success(ResultMsg.UPDATE_SUCCESS);
}
return Result.of_error(ResultMsg.DATA_NOT_FOUND);
}
/**
* 保存企业信息
*
......
package com.jz.dm.mall.moduls.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.jz.common.constant.ResultMsg;
import com.jz.common.utils.HttpsUtilsTest;
import com.jz.common.utils.Result;
import com.jz.common.utils.StatusCode;
import com.jz.dm.mall.moduls.controller.goods.bean.dto.DataDetailsDto;
import com.jz.dm.mall.moduls.controller.goods.bean.dto.DataApiDetailsDto;
import com.jz.dm.mall.moduls.controller.goods.bean.dto.DataGoodsApiDto;
import com.jz.dm.mall.moduls.controller.goods.bean.request.DataApiDetailsReq;
import com.jz.dm.mall.moduls.mapper.DataGoodsApiDao;
import com.jz.dm.mall.moduls.mapper.DataGoodsDao;
import com.jz.dm.mall.moduls.service.DataGoodsApiService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
......@@ -31,7 +33,11 @@ public class DataGoodsApiServiceImpl implements DataGoodsApiService {
@Autowired
private DataGoodsApiDao tDataGoodsApiDao;
@Autowired
private DataGoodsDao dataGoodsDao;
@Value("${gateway.getApiDetail}")
private String getApiDetail;
/**
* 根据主键查询商品api详情
......@@ -39,54 +45,120 @@ public class DataGoodsApiServiceImpl implements DataGoodsApiService {
* @param id
* @return
*/
// @Override
// public Result selectById(Long id) {
//
// List<DataGoodsApiDto> dataGoodsApiDto = tDataGoodsApiDao.selectById(id);
// if (dataGoodsApiDto.size() == 0) {
// return Result.error(StatusCode.ERROR, "查询异常!");
// }
// List<DataGoodsApiDto> list1 = new ArrayList<>();
// List<DataGoodsApiDto> list2 = new ArrayList<>();
// List<DataGoodsApiDto> list3 = new ArrayList<>();
// Map<String, Object> map = new HashMap<>();
//
// for (DataGoodsApiDto goodsApiDto : dataGoodsApiDto) {
// if (goodsApiDto.getParamsDiffNum()!= null && goodsApiDto.getParamsDiffNum().equals("01")) {
// list1.add(goodsApiDto);
// }
// if (goodsApiDto.getParamsDiffNum()!= null && goodsApiDto.getParamsDiffNum().equals("02")) {
// list2.add(goodsApiDto);
// }
// if (goodsApiDto.getParamsDiffNum()!= null && goodsApiDto.getParamsDiffNum().equals("03")) {
// list3.add(goodsApiDto);
// }
// if (!StringUtils.isEmpty(goodsApiDto.getRequestExample())) {
// map.put("requestExample", goodsApiDto.getRequestExample()); // 请求示例
// }
// if (!StringUtils.isEmpty(goodsApiDto.getReturnDataExample())) {
// map.put("returnDataExample", goodsApiDto.getReturnDataExample()); // 响应示例
// }
// }
// // 商品详情
// DataGoodsApiDto goods = dataGoodsApiDto.get(0);
// DataDetailsDto data = new DataDetailsDto();
// DecimalFormat df = new DecimalFormat("#0.00");
// String str = df.format(goods.getDataPrice());
// BigDecimal bd = new BigDecimal(str).setScale(2, RoundingMode.HALF_UP);
// data.setDataPrice(bd);
// BeanUtils.copyProperties(goods, data);
// map.put("dataInfo", data);
//
// // 商品参数
// map.put("pubParam", list1); // 公共参数
// map.put("reqParam", list2); // 请求参数
// map.put("resParam", list3); // 响应参数
//
// Result result = new Result();
// result.setData(map);
// return Result.of_success(ResultMsg.SUCCESS, result);
// }
/**
* 根据主键查询商品api详情
*
* @param req
* @return
*/
@Override
public Result selectById(Long id) {
public Result findByDetails(DataApiDetailsReq req) {
List<DataGoodsApiDto> dataGoodsApiDto = tDataGoodsApiDao.selectById(id);
if (dataGoodsApiDto.size() == 0) {
return Result.error(StatusCode.ERROR, "查询异常!");
DataGoodsApiDto dataGoodsApiDto = dataGoodsDao.selectByDetails(req.getDataGoodsId());
if (dataGoodsApiDto == null) {
return Result.of_error(ResultMsg.DATA_NOT_FOUND);
}
List<DataGoodsApiDto> list1 = new ArrayList<>();
List<DataGoodsApiDto> list2 = new ArrayList<>();
List<DataGoodsApiDto> list3 = new ArrayList<>();
Map<String, Object> map = new HashMap<>();
for (DataGoodsApiDto goodsApiDto : dataGoodsApiDto) {
if (goodsApiDto.getParamsDiffNum()!= null && goodsApiDto.getParamsDiffNum().equals("01")) {
list1.add(goodsApiDto);
}
if (goodsApiDto.getParamsDiffNum()!= null && goodsApiDto.getParamsDiffNum().equals("02")) {
list2.add(goodsApiDto);
}
if (goodsApiDto.getParamsDiffNum()!= null && goodsApiDto.getParamsDiffNum().equals("03")) {
list3.add(goodsApiDto);
}
if (!StringUtils.isEmpty(goodsApiDto.getRequestExample())) {
map.put("requestExample", goodsApiDto.getRequestExample()); // 请求示例
}
if (!StringUtils.isEmpty(goodsApiDto.getReturnDataExample())) {
map.put("returnDataExample", goodsApiDto.getReturnDataExample()); // 响应示例
}
// 获取api详情
String s = HttpsUtilsTest.submitPost(getApiDetail, JSON.toJSONString(req));
JSONObject params = JSONObject.parseObject(s);
if (!params.get("code").equals(200) || org.springframework.util.StringUtils.isEmpty(params.get("data"))) {
return Result.of_error("获取api详情失败!");
}
DataApiDetailsDto dataDetailsDto = JSONObject.parseObject(params.getString("data"), DataApiDetailsDto.class);
// 获取请求参数
List<Map<String, String>> requestParam = getRequestParam(dataDetailsDto.getRequestParam());
if (requestParam != null) {
dataGoodsApiDto.setRequestParam(requestParam);
}
List<Map<String, String>> responseParam = getRequestParam(dataDetailsDto.getResponseParam());
if (responseParam != null) {
dataGoodsApiDto.setResponseParam(responseParam);
}
// 商品详情
DataGoodsApiDto goods = dataGoodsApiDto.get(0);
DataDetailsDto data = new DataDetailsDto();
DecimalFormat df = new DecimalFormat("#0.00");
String str = df.format(goods.getDataPrice());
BigDecimal bd = new BigDecimal(str).setScale(2, RoundingMode.HALF_UP);
data.setDataPrice(bd);
BeanUtils.copyProperties(goods, data);
map.put("dataInfo", data);
// 赋值商品详情参数
BeanUtils.copyProperties(dataDetailsDto, dataGoodsApiDto);
return Result.ok(dataGoodsApiDto);
}
// 商品参数
map.put("pubParam", list1); // 公共参数
map.put("reqParam", list2); // 请求参数
map.put("resParam", list3); // 响应参数
Result result = new Result();
result.setData(map);
return Result.of_success(ResultMsg.SUCCESS, result);
}
/**
* 获取请求参数
* @param result
* @return
*/
private List<Map<String, String>> getRequestParam(String result) {
List<Map<String, String>> param = (List<Map<String, String>>) JSONArray.parse(result);
List<Map<String, String>> resultParam = new ArrayList<>();
for (Map<String, String> reqMap : param) {
Map<String, String> map = new HashMap();
for (Map.Entry entry : reqMap.entrySet()) {
if (entry.getKey().equals("name")) {
map.put("paramsName", entry.getKey().toString());
}
if (entry.getKey().equals("type")) {
map.put("paramsType", entry.getKey().toString());
}
if (entry.getKey().equals("requird")) {
map.put("ifRequird",entry.getKey().toString());
}
if (entry.getKey().equals("desc")) {
map.put("paramsDesc", entry.getKey().toString());
}
}
resultParam.add(map);
}
return resultParam;
}
}
\ No newline at end of file
package com.jz.dm.mall.moduls.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.jz.common.constant.ResultMsg;
import com.jz.common.enums.DelFlagEnum;
import com.jz.common.enums.YNEnum;
import com.jz.common.utils.Result;
import com.jz.dm.mall.moduls.entity.DataGoodsCategory;
import com.jz.dm.mall.moduls.entity.SceneCategory;
import com.jz.dm.mall.moduls.mapper.DataGoodsCategoryDao;
import com.jz.dm.mall.moduls.mapper.SceneCategoryDao;
import com.jz.dm.mall.moduls.service.DataGoodsCategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -23,6 +28,10 @@ public class DataGoodsCategoryServiceImpl implements DataGoodsCategoryService {
@Autowired
private DataGoodsCategoryDao categoryDao;
@Autowired
private SceneCategoryDao sceneCategoryDao;
/**
* 查询所有的商品分类
*
......@@ -30,30 +39,30 @@ public class DataGoodsCategoryServiceImpl implements DataGoodsCategoryService {
*/
@Override
public Result findCategory() {
//1、查出所有分类
List<DataGoodsCategory> entities = categoryDao.selectByList();
// 找到所有的一级分类
List<DataGoodsCategory> level1Menus = entities.stream().filter(categoryEntity -> categoryEntity.getParentId() == 0 && categoryEntity.getIfChild().equals("N")
// categoryEntity ->
// categoryEntity.getParentId() == 0 && categoryEntity.getIfChild().equals("N")
).map((menu)->{
menu.setChildren(getChildrens(menu,entities));
return menu;
}).collect(Collectors.toList());
return Result.of_success(ResultMsg.SUCCESS, level1Menus);
QueryWrapper<DataGoodsCategory> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("parent_id", "0");
queryWrapper.eq("if_child", YNEnum.NO.getValue());
queryWrapper.eq("del_flag", DelFlagEnum.NO.getValue());
List<DataGoodsCategory> dataGoodsCategories = categoryDao.selectList(queryWrapper);
if (dataGoodsCategories != null) {
return Result.ok(dataGoodsCategories);
}
return Result.of_error(ResultMsg.DATA_NOT_FOUND);
}
private List<DataGoodsCategory> getChildrens(DataGoodsCategory root,List<DataGoodsCategory> all) {
List<DataGoodsCategory> children = all.stream().filter(categoryEntity -> {
return categoryEntity.getParentId() == root.getCategoryId() && categoryEntity.getIfChild().equals("Y");
}).map(categoryEntity -> {
//1、找到子菜单,同时递归调用
categoryEntity.setChildren(getChildrens(categoryEntity, all));
return categoryEntity;
}).collect(Collectors.toList());
return children;
/**
* 查询所有的场景
*
* @return
*/
@Override
public Result findScene() {
QueryWrapper<SceneCategory> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("del_flag", DelFlagEnum.NO.getValue());
List<SceneCategory> sceneCategories = sceneCategoryDao.selectList(queryWrapper);
if (sceneCategories != null) {
return Result.ok(sceneCategories);
}
return Result.of_error(ResultMsg.DATA_NOT_FOUND);
}
}
\ No newline at end of file
......@@ -2,6 +2,9 @@ package com.jz.dm.mall.moduls.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.jz.common.bean.BaseBeanResponse;
......@@ -11,6 +14,8 @@ import com.jz.common.bean.PageInfoResponse;
import com.jz.common.constant.Constants;
import com.jz.common.constant.RedisMessageConstant;
import com.jz.common.constant.ResultMsg;
import com.jz.common.enums.DataGoodsByRoleEnum;
import com.jz.common.enums.DelFlagEnum;
import com.jz.common.exception.ResponseException;
import com.jz.common.utils.DateUtils;
import com.jz.common.utils.HttpsUtilsTest;
......@@ -69,61 +74,49 @@ public class DataGoodsServiceImpl implements DataGoodsService {
private DataGoodsApiDao tDataGoodsApiDao;
@Value("${domain.apigateway}")
@Value("${gateway.apigateway}")
private String apiGateway;
@Value("${token.dataBank}")
private String dataBank;
/**条件查询所有数据商品
* @param dataGoodsListRequest
* @param req
* @param httpRequest
* @return
* @throws Exception
*/
@Override
public PageInfoResponse<DataGoodsListDto> findList(DataGoodsListRequest dataGoodsListRequest, HttpServletRequest httpRequest)
public PageInfoResponse findList(DataGoodsListRequest req, HttpServletRequest httpRequest)
throws Exception {
PageInfoResponse<DataGoodsListDto> pageInfoResponse = new PageInfoResponse<>();
Map<String, Object> param = new HashMap<>();
//商品分类id(行业)
if (dataGoodsListRequest.getCategoryId() != null) {
param.put("categoryId", dataGoodsListRequest.getCategoryId());
Map<String, Object> map = new HashMap<>();
if (StringUtils.isNotBlank(req.getDataName())) {
map.put("dataName", req.getDataName());
}
//数据商品名称
if (StringUtils.isNotEmpty(dataGoodsListRequest.getDataName())) {
param.put("dataName", dataGoodsListRequest.getDataName());
if (req.getCategoryId() != null) {
map.put("categoryId", req.getCategoryId());
}
//数据类型:01api,02数据包
if (StringUtils.isNotEmpty(dataGoodsListRequest.getDataType())) {
param.put("dataType", dataGoodsListRequest.getDataType());
if (req.getSceneId() != null) {
map.put("sceneId", req.getSceneId());
}
//价格类型:01免费,02收费
if (StringUtils.isNotEmpty(dataGoodsListRequest.getPriceType())) {
param.put("priceType", dataGoodsListRequest.getPriceType());
}
//更新时间排序
if (dataGoodsListRequest.getUptTime() != null) {
param.put("uptTime", dataGoodsListRequest.getUptTime());
}
// 使用人数
if (dataGoodsListRequest.getUsePerson() != null) {
param.put("usePerson", dataGoodsListRequest.getUsePerson());
// if (getCustomer() != null) {
// map.put("customerId", getCustomer().getCustomerId());
// }
if (getCustomer() != null) {
map.put("departmentId", getCustomer().getDepartmentId());
}
// 综合排序
if (StringUtils.isNotEmpty(dataGoodsListRequest.getSynthesizeRank())) {
param.put("synthesizeRank", dataGoodsListRequest.getSynthesizeRank());
}
PageHelper.startPage(dataGoodsListRequest.getPageNum(), dataGoodsListRequest.getPageSize());
List<DataGoodsListDto> list = dataGoodsDao.findList(param);
for (DataGoodsListDto dataGoodsListDto : list) {
dataGoodsListDto.getDataPrice().setScale(3);
if (getCustomer() == null) {
map.put("roleId", DataGoodsByRoleEnum.logOutUser.getValue());
}else if (getCustomer().getCustomerId() != null) {
map.put("roleId", DataGoodsByRoleEnum.unverifiedUser.getValue());
}else if (getCustomer().getDepartmentId() != null) {
map.put("roleId", DataGoodsByRoleEnum.authenticatedUser.getValue());
}
PageHelper.startPage(req.getPageNum(), req.getPageSize());
List<DataGoodsListDto> list = dataGoodsDao.findList(map);
PageInfo<DataGoodsListDto> pageInfo = new PageInfo<>(list);
pageInfoResponse.setCode(Constants.SUCCESS_CODE);
pageInfoResponse.setMessage("查询成功");
pageInfoResponse.setData(pageInfo);
......@@ -398,4 +391,12 @@ public class DataGoodsServiceImpl implements DataGoodsService {
return encrypt;
}
/**
* 获取用户
* @return
*/
public MallCustomerApiDto getCustomer() {
MallCustomerApiDto customer = (MallCustomerApiDto) redisTemplate.opsForValue().get("USER_" + RedisMessageConstant.SENDTYPE_LOGIN_CUSTOMER);
return customer;
}
}
\ No newline at end of file
package com.jz.dm.mall.moduls.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.jz.common.bean.MallCustomerApiDto;
import com.jz.common.constant.RedisMessageConstant;
import com.jz.common.constant.ResultMsg;
import com.jz.common.entity.Department;
import com.jz.common.enums.AuditStatusEnum;
import com.jz.common.enums.DelFlagEnum;
import com.jz.common.exception.ResponseException;
import com.jz.common.utils.Base64Util;
import com.jz.common.utils.DateUtils;
import com.jz.common.utils.RedisUtil;
import com.jz.common.utils.Result;
import com.jz.dm.mall.moduls.controller.customer.bean.dto.CustomerDto;
import com.jz.dm.mall.moduls.controller.customer.bean.req.CustomerRequest;
import com.jz.dm.mall.moduls.controller.customer.bean.req.LoginByVSSReq;
import com.jz.dm.mall.moduls.controller.customer.bean.req.LoginRequest;
import com.jz.dm.mall.moduls.entity.FinanceCustomerAssets;
import com.jz.dm.mall.moduls.entity.MallCustomer;
import com.jz.dm.mall.moduls.entity.MallMenu;
import com.jz.dm.mall.moduls.mapper.DepartmentDao;
import com.jz.dm.mall.moduls.mapper.FinanceCustomerAssetsDao;
import com.jz.dm.mall.moduls.mapper.MallCustomerDao;
import com.jz.dm.mall.moduls.service.MallCustomerService;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletRequest;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -37,12 +51,20 @@ import java.util.stream.Collectors;
*/
@Service("mallCustomerService")
public class MallCustomerServiceImpl implements MallCustomerService {
private static final Logger logger = LoggerFactory.getLogger(MallCustomerServiceImpl.class);
@Autowired
private MallCustomerDao tMallCustomerDao;
@Autowired
private DepartmentDao departmentDao;
@Autowired
private RedisTemplate redisTemplate;
@Autowired
private FinanceCustomerAssetsDao assetsDao;
/**
* 通过用户账号进行查询
*
......@@ -81,7 +103,7 @@ public class MallCustomerServiceImpl implements MallCustomerService {
Map mapUser = new HashMap();
if (StringUtils.isNotEmpty(customerRequest.getUsername())) {
mapUser.put("customerAccount",customerRequest.getUsername());
mapUser.put("customerAccount", customerRequest.getUsername());
}
MallCustomerApiDto customerUser = tMallCustomerDao.selectByUser(mapUser);
if (customerUser != null) {
......@@ -89,7 +111,7 @@ public class MallCustomerServiceImpl implements MallCustomerService {
}
Map mapPhone = new HashMap();
if (StringUtils.isNotEmpty(customerRequest.getTelephone())) {
mapPhone.put("customerPhone",customerRequest.getTelephone());
mapPhone.put("customerPhone", customerRequest.getTelephone());
}
MallCustomerApiDto customerPhone = tMallCustomerDao.selectByUser(mapPhone);
if (customerPhone != null) {
......@@ -108,6 +130,7 @@ public class MallCustomerServiceImpl implements MallCustomerService {
customer.setPassword(Base64Util.encode(customerRequest.getPassword()));
customer.setCustomerPhone(telephone);
customer.setCreTime(DateUtils.getToday());
customer.setCustomerSource("01");
customer.setRegisterTime(DateUtils.getToday());
tMallCustomerDao.saveCustomer(customer);
return Result.of_success("注册成功!");
......@@ -176,8 +199,8 @@ public class MallCustomerServiceImpl implements MallCustomerService {
// 找到所有的一级分类
List<MallMenu> level1Menus = entities.stream().filter(sysMenuEntity ->
sysMenuEntity.getParentId() == 0 && sysMenuEntity.getIfChild().equals("N")
).map((menu)->{
menu.setChildren(getChildrens(menu,entities));
).map((menu) -> {
menu.setChildren(getChildrens(menu, entities));
return menu;
}).collect(Collectors.toList());
return Result.of_success(ResultMsg.SUCCESS, level1Menus);
......@@ -185,6 +208,7 @@ public class MallCustomerServiceImpl implements MallCustomerService {
/**
* 登陆
*
* @param customer
* @return
*/
......@@ -201,8 +225,6 @@ public class MallCustomerServiceImpl implements MallCustomerService {
return Result.of_error("用户不存在,请注册!");
}
if (customer.getPassword().equals(Base64Util.decode(mallCustomer.getPassword()))) {
MallCustomerApiDto mallCustomerApiDto = new MallCustomerApiDto();
BeanUtils.copyProperties(mallCustomer,mallCustomerApiDto);
redisTemplate.opsForValue().set("USER_" + RedisMessageConstant.SENDTYPE_LOGIN_CUSTOMER, mallCustomer, 3, TimeUnit.DAYS);
return Result.of_success(ResultMsg.LOGIN_SUCCESS, mallCustomer);
......@@ -210,7 +232,7 @@ public class MallCustomerServiceImpl implements MallCustomerService {
return Result.of_error(ResultMsg.LOGIN_ERROR);
}
map = new HashMap();
map.put("customerAccount",customer.getUsername());
map.put("customerAccount", customer.getUsername());
MallCustomerApiDto mallCustomer = tMallCustomerDao.selectByUser(map);
if (mallCustomer == null) {
return Result.of_error("用户不存在,请注册!");
......@@ -222,20 +244,167 @@ public class MallCustomerServiceImpl implements MallCustomerService {
// BeanUtils.copyProperties(mallCustomer,mallCustomerApiDto);
// redisTemplate.opsForValue().set("USER_" + RedisMessageConstant.SENDTYPE_LOGIN_CUSTOMER, mallCustomerApiDto, 3, TimeUnit.DAYS);
// }
MallCustomerApiDto mallCustomerApiDto = new MallCustomerApiDto();
BeanUtils.copyProperties(mallCustomer,mallCustomerApiDto);
redisTemplate.opsForValue().set("USER_" + RedisMessageConstant.SENDTYPE_LOGIN_CUSTOMER, mallCustomer, 3, TimeUnit.DAYS);
return Result.of_success(ResultMsg.LOGIN_SUCCESS, mallCustomer);
}
return Result.of_error(ResultMsg.LOGIN_ERROR);
}
/**
* vss系统登陆
*
* @param req
* @return
*/
@Override
@Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRES_NEW)
public Result loginByVss(LoginByVSSReq req) throws ResponseException {
MallCustomerApiDto mallCustomerApiDto = tMallCustomerDao.selectByVSS(req);
// 如果不为空,则登陆
if (mallCustomerApiDto != null) {
// 企业名称不同,覆盖信息
if (!mallCustomerApiDto.getDepartmentName().equals(req.getDepartmentName())) {
// 更新企业名称
Department department = new Department();
department.setDepartmentId(mallCustomerApiDto.getDepartmentId());
department.setDepartmentName(req.getDepartmentName());
department.setUptPerson(mallCustomerApiDto.getCustomerId() + "");
department.setDepartmentSource("02");
department.setUptTime(DateUtils.getToday());
department.setDelFlag(DelFlagEnum.NO.getValue());
if (departmentDao.updateById(department) != 1) {
throw ResponseException.of_error(ResultMsg.UPDATE_FAIL);
}
logger.info("========================vss账号登陆:企业信息更新成功!================================");
}
// 如果供应商编号不一致
if (!mallCustomerApiDto.getVendorId().equals(req.getVendorId())) {
// 关系供应商编号
MallCustomer mallCustomer = new MallCustomer();
mallCustomer.setCustomerId(mallCustomerApiDto.getCustomerId());
mallCustomer.setCustomerSource("02");
mallCustomer.setVendorId(req.getVendorId());
mallCustomer.setUptPerson(mallCustomerApiDto.getCustomerId() + "");
mallCustomer.setUptTime(DateUtils.getToday());
if (tMallCustomerDao.updateById(mallCustomer) != 1) {
throw ResponseException.of_error(ResultMsg.UPDATE_FAIL);
}
logger.info("========================vss账号登陆:用户信息更新成功!================================");
}
//登陆
redisTemplate.opsForValue().set("USER_" + RedisMessageConstant.SENDTYPE_LOGIN_CUSTOMER, mallCustomerApiDto, 3, TimeUnit.DAYS);
return Result.ok(mallCustomerApiDto);
}
// 如果为null
QueryWrapper<Department> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("unified_credit_code", req.getUnifiedCreditCode());
queryWrapper.eq("del_flag", DelFlagEnum.NO.getValue());
Department department = departmentDao.selectOne(queryWrapper);
if (department == null) {
department = insertDepartment(req);
// 新增资产
insertAssets(department);
}
// 查询资产
QueryWrapper<FinanceCustomerAssets> wrapper = new QueryWrapper<>();
wrapper.eq("department_id", department.getDepartmentId());
wrapper.eq("del_flag", DelFlagEnum.NO.getValue());
FinanceCustomerAssets assets = assetsDao.selectOne(wrapper);
if (assets == null) {
return Result.of_error("资产账号为空!");
}
// 查询账号
QueryWrapper<MallCustomer> query = new QueryWrapper<>();
query.eq("customer_account", req.getCustomerAccount());
query.eq("customer_source", "02");
query.eq("del_flag", DelFlagEnum.NO.getValue());
MallCustomer mallCustomer = tMallCustomerDao.selectOne(query);
if (mallCustomer == null) {
// 新增账号
mallCustomer = insetCustomer(department, req);
}
MallCustomerApiDto apiDto = new MallCustomerApiDto();
apiDto.setCustomerId(mallCustomer.getCustomerId());
apiDto.setAssetsId(assets.getAssetsId() + "");
apiDto.setDepartmentId(department.getDepartmentId());
apiDto.setCustomerAccount(mallCustomer.getCustomerAccount());
apiDto.setDepartmentName(department.getDepartmentName());
apiDto.setVendorId(mallCustomer.getVendorId());
redisTemplate.opsForValue().set("USER_" + RedisMessageConstant.SENDTYPE_LOGIN_CUSTOMER, apiDto, 3, TimeUnit.DAYS);
return Result.ok(apiDto);
}
/**
* 新增企业
*/
private Department insertDepartment(LoginByVSSReq req) {
// 新增企业
Department department = new Department();
department.setDepartmentName(req.getDepartmentName());
department.setUnifiedCreditCode(req.getUnifiedCreditCode());
department.setCreTime(DateUtils.getToday());
department.setAuditTime(department.getCreTime());
department.setDepartmentSource("02");
department.setAuditStatus(AuditStatusEnum.YSH.getValue());
if (departmentDao.insert(department) != 1) {
throw ResponseException.of_error(ResultMsg.INSERT_FAIL);
}
logger.info("========================vss账号登陆:新增企业信息成功!================================");
return department;
}
return Result.of_success(ResultMsg.LOGIN_SUCCESS, mallCustomerApiDto);
/**
* 新增资产
*/
private Result insertAssets(Department department) {
FinanceCustomerAssets assets = new FinanceCustomerAssets();
assets.setDepartmentId(department.getDepartmentId());
assets.setCreTime(DateUtils.getToday());
assets.setDelFlag(DelFlagEnum.NO.getValue());
if (assetsDao.insert(assets) != 1) {
throw ResponseException.of_error(ResultMsg.INSERT_FAIL);
}
return Result.of_error(ResultMsg.LOGIN_ERROR);
logger.info("========================vss账号登陆:新增企业资产信息成功!================================");
return Result.ok();
}
/**
* 新增账号信息
*/
private MallCustomer insetCustomer(Department department, LoginByVSSReq req) {
MallCustomer mallCustomer = new MallCustomer();
mallCustomer.setCustomerAccount(req.getCustomerAccount());
mallCustomer.setDepartmentId(department.getDepartmentId());
mallCustomer.setCustomerSource("02");
mallCustomer.setVendorId(req.getVendorId());
mallCustomer.setCreTime(DateUtils.getToday());
mallCustomer.setCrePerson(mallCustomer.getCustomerId() + "");
mallCustomer.setRegisterTime(DateUtils.getToday());
mallCustomer.setDelFlag(DelFlagEnum.NO.getValue());
if (tMallCustomerDao.insert(mallCustomer) !=1){
throw ResponseException.of_error(ResultMsg.INSERT_FAIL);
}
logger.info("========================vss账号登陆:新增用户信息成功!================================");
return mallCustomer;
}
/**
* 获取登陆信息
*
* @return
*/
@Override
public Result getUserMessage() {
MallCustomerApiDto customer = (MallCustomerApiDto) redisTemplate.opsForValue().get("USER_" + RedisMessageConstant.SENDTYPE_LOGIN_CUSTOMER);
if (customer != null) {
return Result.ok(customer);
}
return Result.of_error(ResultMsg.LOGIN_ERROR);
}
private List<MallMenu> getChildrens(MallMenu sysMenu,List<MallMenu> all) {
private List<MallMenu> getChildrens(MallMenu sysMenu, List<MallMenu> all) {
List<MallMenu> children = all.stream().filter(sysMenuEntity -> {
return sysMenuEntity.getParentId() == sysMenu.getMenuId() && sysMenuEntity.getIfChild().equals("Y");
......
package com.jz.dm.mall.moduls.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
......@@ -59,14 +60,16 @@ public class OrderServiceImpl implements OrderService {
@Autowired
private RedisTemplate redisTemplate;
@Value("${domain.gatewayUpSalt}")
private String gatewayUpSalt;
@Value("${domain.gatewayOrderLogDetails}")
@Value("${gateway.gatewayOrderLogDetails}")
private String gatewayOrderLogDetails;
@Value("${domain.gatewayOrderLogNumError}")
@Value("${gateway.gatewayOrderLogNumError}")
private String gatewayOrderLogNumError;
@Value("${gateway.gatewayUpSalt}")
private String gatewayUpSalt;
/**
* 订单管理列表(分页查询)
*
......@@ -116,7 +119,6 @@ public class OrderServiceImpl implements OrderService {
@Override
public OrderDto getOrderDetail(String orderId) throws Exception {
OrderDto orderDto = null;
if (StringUtils.isNotEmpty(orderId)) {
orderDto = orderDao.getOrderDetail(orderId);
if (orderDto != null) {
......@@ -150,41 +152,7 @@ public class OrderServiceImpl implements OrderService {
return returnMap;
}
/**
* 重置盐值
*
* @param req
* @return
*/
@Override
public Result updateSalt(SaltResetReq req) {
// 获取当前用户
MallCustomerApiDto customer = (MallCustomerApiDto) redisTemplate.opsForValue().get("USER_" + RedisMessageConstant.SENDTYPE_LOGIN_CUSTOMER);
//调用gatway
JSONObject object = new JSONObject();
object.put("authCode", req.getGoodsToken());
object.put("createUser", customer.getCustomerName());
String s = HttpsUtilsTest.submitPost(gatewayUpSalt, object.toString());
//处理返回的参数
JSONObject params = JSONObject.parseObject(s);
if (!params.get("code").equals(200) || org.springframework.util.StringUtils.isEmpty(params.get("data"))) {
return Result.error("修改失败!");
}
String data = params.getString("data");
JSONObject dataParam = JSONObject.parseObject(data);
String salt = dataParam.getString("salt");
// 修改参数
Order order = new Order();
order.setSaltValue(salt);
order.setOrderId(req.getId());
order.setUptTime(DateUtils.getToday());
order.setUptPerson(customer.getCustomerId() + "");
orderDao.updateSalt(order);
Map map = new HashMap();
map.put("salt", salt);
return Result.of_success(ResultMsg.SUCCESS, salt);
}
/**
* 订单管理列表(分页查询)--卖方
* @param req
......@@ -264,7 +232,7 @@ public class OrderServiceImpl implements OrderService {
@Override
public Result<PageInfoResponse<OrderByPurchaserDto>> queryPageListByPurchaser(OrderRequest req) {
// 调用gateway,获取调用数/错误率
List<Map<String, String>> reqList = orderDao.getApiKey(getCustomer().getCustomerId());
List<Map<String, String>> reqList = orderDao.getApiKey(getCustomer().getDepartmentId());
JSONObject object = new JSONObject();
object.put("reqList", reqList);
String s = HttpsUtilsTest.submitPost(gatewayOrderLogNumError, object.toString());
......@@ -273,7 +241,6 @@ public class OrderServiceImpl implements OrderService {
if (!params.get("code").equals(200) || org.springframework.util.StringUtils.isEmpty(params.get("data"))) {
return Result.of_error("获取参数失败!");
}
PageInfoResponse<OrderByPurchaserDto> pageInfoResponse = new PageInfoResponse<>();
Map<String, Object> param = new HashMap<>();
if (StringUtils.isNotBlank(req.getDataName())) {
param.put("dataName", req.getDataName());
......@@ -281,10 +248,13 @@ public class OrderServiceImpl implements OrderService {
if (StringUtils.isNotBlank(req.getPriceType())) {
param.put("priceType", req.getPriceType());
}
if (getCustomer().getCustomerId() != null) {
param.put("customerId", getCustomer().getCustomerId());
if (StringUtils.isNotBlank(req.getGoodsStatus())) {
param.put("goodsStatus", req.getGoodsStatus());
}
if (getCustomer().getCustomerId() != null && getCustomer().getDepartmentId() != null) {
param.put("departmentId", getCustomer().getDepartmentId());
}else {
return Result.of_error("用户未登录,请登录!");
return Result.of_error("用户未认证,请认证!");
}
PageHelper.startPage(req.getPageNum(), req.getPageSize());
List<OrderByPurchaserDto> list = orderDao.queryPageListByPurchaser(param);
......@@ -299,7 +269,6 @@ public class OrderServiceImpl implements OrderService {
}
}
PageInfo<OrderByPurchaserDto> pageInfo = new PageInfo<>(list);
return Result.of_success(pageInfo);
......@@ -332,7 +301,45 @@ public class OrderServiceImpl implements OrderService {
if (!params.get("code").equals(200) || org.springframework.util.StringUtils.isEmpty(params.get("data"))){
return Result.of_error("获取日志详情失败!");
}
return Result.ok(params.get("data"));
JSONObject object = JSONObject.parseObject(params.getString("data"));
List<ApiReqLogDto> records = JSONObject.parseArray(object.getString("records"), ApiReqLogDto.class);
return Result.ok(records);
}
/**
* 重置盐值
*
* @param req
* @return
*/
@Override
public Result updateSalt(SaltResetReq req) {
//调用gatway
JSONObject object = new JSONObject();
object.put("authCode", req.getGoodsToken());
object.put("createUser", getCustomer().getCustomerId());
String s = HttpsUtilsTest.submitPost(gatewayUpSalt, object.toString());
//处理返回的参数
JSONObject params = JSONObject.parseObject(s);
if (!params.get("code").equals(200) || org.springframework.util.StringUtils.isEmpty(params.get("data"))) {
return Result.error("修改失败!");
}
String data = params.getString("data");
JSONObject dataParam = JSONObject.parseObject(data);
String salt = dataParam.getString("salt");
// 修改参数
Order order = new Order();
order.setSaltValue(salt);
order.setOrderId(req.getId());
order.setUptTime(DateUtils.getToday());
order.setUptPerson(getCustomer().getCustomerId() + "");
if (orderDao.updateById(order) != 1) {
return Result.of_error(ResultMsg.UPDATE_FAIL);
}
Map map = new HashMap();
map.put("salt", salt);
return Result.of_success(ResultMsg.SUCCESS, salt);
}
public MallCustomerApiDto getCustomer() {
......
......@@ -56,7 +56,7 @@ public class PayServiceImpl implements PayService {
//@Autowired
//private HttpsUtils httpsUtils;
@Value("${domain.gatewayGetAuth}")
@Value("${gateway.gatewayGetAuth}")
private String gatewayGetAuth;
/**
......
package com.jz.dm.mall.moduls.service.impl;
import com.jz.dm.mall.moduls.service.SceneCategoryService;
import org.springframework.stereotype.Service;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/2/3
* @Version:
*/
@Service("SceneCategoryService")
public class SceneCategoryServiceImpl implements SceneCategoryService {
}
package com.jz.dm.mall.moduls.service.impl;
import com.aliyuncs.CommonRequest;
import com.aliyuncs.CommonResponse;
import com.aliyuncs.DefaultAcsClient;
import com.aliyuncs.IAcsClient;
import com.aliyuncs.exceptions.ClientException;
import com.aliyuncs.exceptions.ServerException;
import com.aliyuncs.http.MethodType;
import com.aliyuncs.profile.DefaultProfile;
import com.jz.common.constant.RedisMessageConstant;
import com.jz.common.utils.Result;
import com.jz.common.utils.SMSUtils;
import com.jz.common.utils.StatusCode;
import com.jz.common.utils.ValidateCodeUtils;
import com.jz.dm.mall.moduls.service.ValidateCodeService;
import org.springframework.beans.factory.annotation.Autowired;
......
......@@ -75,12 +75,13 @@ logging:
level:
com.jz.dm.mall: debug
# 调用gateway接口路径
domain:
gateway:
gatewayGetAuth: http://47.115.53.1:8088/api/auth/mall-user-auth-api
gatewayUpSalt: http://192.168.1.114:8088/api/auth/reset-salt
apigateway: http://127.0.0.1:8088/api/producer/addDataBankApiInfo
gatewayOrderLogDetails: http://127.0.0.1:8088/api/logging/listApiLog
gatewayOrderLogNumError: http://127.0.0.1:8088/api/logging/queryNumberAndError
getApiDetail: http://127.0.0.1:8088/api/interface/getApiDetail
gatewayUpSalt: http://127.0.0.1:8088/api/auth/reset-salt
ftp:
url: 192.168.1.141
port: 21
......
......@@ -92,10 +92,10 @@
</select>
<!--新增所有列-->
<insert id="insert" keyProperty="customerId" useGeneratedKeys="true">
insert into t_mall_customer(department_id, password, customer_account, customer_name, customer_phone, customer_email, customer_address, customer_point, register_time, customer_level, identity_card, cre_time, upt_time, del_flag)
values (#{departmentId}, #{password}, #{customerAccount}, #{customerName}, #{customerPhone}, #{customerEmail}, #{customerAddress}, #{customerPoint}, #{registerTime}, #{customerLevel}, #{identityCard}, #{creTime}, #{uptTime}, #{delFlag})
</insert>
<!--<insert id="insert" keyProperty="customerId" useGeneratedKeys="true">-->
<!--insert into t_mall_customer(department_id, password, customer_account, customer_name, customer_phone, customer_email, customer_address, customer_point, register_time, customer_level, identity_card, cre_time, upt_time, del_flag)-->
<!--values (#{departmentId}, #{password}, #{customerAccount}, #{customerName}, #{customerPhone}, #{customerEmail}, #{customerAddress}, #{customerPoint}, #{registerTime}, #{customerLevel}, #{identityCard}, #{creTime}, #{uptTime}, #{delFlag})-->
<!--</insert>-->
<insert id="insertBatch" keyProperty="customerId" useGeneratedKeys="true">
insert into t_mall_customer(department_id, password, customer_account, customer_name,
......@@ -293,7 +293,8 @@
left JOIN t_department t2 ON t1.department_id = t2.department_id
left JOIN t_finance_customer_assets t3 ON t3.department_id = t2.department_id
WHERE
t1.del_flag = 'N'
t1.del_flag = 'N' and
t1.customer_source = '01'
<if test="customerAccount != null">
and t1.customer_account = #{customerAccount}
</if>
......@@ -302,4 +303,23 @@
</if>
GROUP BY t1.customer_id
</select>
<select id="selectByVSS" resultType="com.jz.common.bean.MallCustomerApiDto">
SELECT
t1.customer_id AS customerId,
t1.department_id AS departmentId,
t1.customer_account AS customerAccount,
t3.assets_id AS assetsId,
t2.department_name as departmentName,
t1.vendor_id as vendorId
FROM
t_mall_customer t1
inner JOIN t_department t2 ON t1.department_id = t2.department_id
inner JOIN t_finance_customer_assets t3 ON t3.department_id = t2.department_id
WHERE
t1.del_flag = 'N' and
t1.customer_source = '02' and
t2.unified_credit_code = #{unifiedCreditCode}
and t1.customer_account = #{customerAccount}
</select>
</mapper>
\ No newline at end of file
......@@ -72,10 +72,10 @@
</select>
<!--新增所有列-->
<insert id="insert" keyProperty="assetsId" useGeneratedKeys="true">
insert into t_finance_customer_assets(department_id, use_money, frozen_money, total_money, cre_time, cre_person, upt_time, upt_person, del_flag)
values (#{departmentId}, #{useMoney}, #{frozenMoney}, #{totalMoney}, #{creTime}, #{crePerson}, #{uptTime}, #{uptPerson}, #{delFlag})
</insert>
<!--<insert id="insert" keyProperty="assetsId" useGeneratedKeys="true">-->
<!--insert into t_finance_customer_assets(department_id, use_money, frozen_money, total_money, cre_time, cre_person, upt_time, upt_person, del_flag)-->
<!--values (#{departmentId}, #{useMoney}, #{frozenMoney}, #{totalMoney}, #{creTime}, #{crePerson}, #{uptTime}, #{uptPerson}, #{delFlag})-->
<!--</insert>-->
<insert id="insertBatch" keyProperty="assetsId" useGeneratedKeys="true">
insert into t_finance_customer_assets(department_id, use_money, frozen_money, total_money,
......
......@@ -179,55 +179,138 @@
</select>
<!--通过实体作为筛选条件查询-->
<select id="findList" resultType="com.jz.dm.mall.moduls.controller.goods.bean.dto.DataGoodsListDto" parameterType="map">
<!--&lt;!&ndash;通过实体作为筛选条件查询&ndash;&gt;-->
<!--<select id="findList" resultType="com.jz.dm.mall.moduls.controller.goods.bean.dto.DataGoodsListDto" parameterType="map">-->
<!--SELECT-->
<!--t1.data_goods_id as dataGoodsId,-->
<!--t1.category_id as categoryId,-->
<!--t2.category_name as categoryName,-->
<!--t1.data_name as dataName,-->
<!--( CASE WHEN t1.data_type = '01' THEN 'api' WHEN t1.data_type = '02' THEN '数据包' END ) dataType,-->
<!--t1.data_label as dataLabel,-->
<!--t1.data_picture as dataPicture,-->
<!--( CASE when t1.price_type = '01' then '免费' when t1.price_type = '02' then '收费' end) priceType,-->
<!--t1.discount_price as discountPrice,-->
<!--t1.data_price as dataPrice,-->
<!--t1.price_type as pariceType,-->
<!--t2.parent_id as parentId,-->
<!--t1.year_type as yearType,-->
<!--t1.season_type as seasonType,-->
<!--t1.month_type as monthType,-->
<!--t1.second_type as secondType-->
<!--FROM-->
<!--t_data_goods t1-->
<!--INNER JOIN t_data_goods_category t2 on t1.category_id = t2.category_id-->
<!--where-->
<!--1= 1 and-->
<!--t1.del_flag = 'N' and-->
<!--t1.data_status = '02'-->
<!--<if test="categoryId != null">-->
<!--and t1.category_id = #{categoryId}-->
<!--</if>-->
<!--<if test="dataName != null and dataName != ''">-->
<!--and data_name like concat('%',#{dataName},'%')-->
<!--</if>-->
<!--<if test="dataType != null and dataType != ''">-->
<!--and data_type = #{dataType}-->
<!--</if>-->
<!--<if test="priceType != null and priceType != ''">-->
<!--and price_type = #{priceType}-->
<!--</if>-->
<!--<if test="uptTime != null ">-->
<!--ORDER BY-->
<!--t1.upt_time desc-->
<!--</if>-->
<!--<if test="usePerson != null ">-->
<!--ORDER BY-->
<!--t1.use_person desc-->
<!--</if>-->
<!--<if test="synthesizeRank != null">-->
<!--ORDER BY-->
<!--t1.upt_time,t1.use_person desc-->
<!--</if>-->
<!--</select>-->
<select id="findList" resultType="com.jz.dm.mall.moduls.controller.goods.bean.dto.DataGoodsListDto" parameterType="map">
select
ttt.data_desc as dataDesc,
ttt.data_name as dataName,
ttt.data_goods_id as dataGoodsId,
ttt.upt_time as uptTime,
ttt.goodsToken as goodsToken,
ttt.category_id as categoryId,
ttt.scene_id as sceneId,
ttt.userNumbers as userNumbers,
ttt.api_key as apiKey
from
(
SELECT
tt.data_goods_id,
tt.data_name,
tt.data_desc,
tt.upt_time,
tt.category_id,
tt.scene_id,
tt.del_flag,
tt.api_key,
case when tt.data_goods_id in (
SELECT
t.data_goods_id
FROM
t_data_goods t
INNER JOIN t_order_goods_info t1 ON t.data_goods_id = t1.data_goods_id
INNER JOIN t_order t2 ON t1.order_id = t2.order_id
WHERE
t.del_flag = 'N'
<if test="departmentId != null">
and t2.department_id = #{departmentId}
</if>
) then '已授权' else '' end goodsToken,
(SELECT
count(t1.data_goods_id)
from
t_data_goods t1
INNER JOIN t_order_goods_info t2 on t1.data_goods_id = t2.data_goods_id
inner join t_order t3 on t2.order_id = t3.order_id
where t1.data_goods_id=tt.data_goods_id) as userNumbers
FROM
t_data_goods tt ) as ttt
INNER JOIN t_role_goods tr ON tr.data_goods_id = ttt.data_goods_id
INNER JOIN t_mall_role tmr ON tmr.role_id = tr.role_id
where
ttt.del_flag = 'N'
AND tr.del_flag = 'N'
AND tmr.role_id = #{roleId}
<if test="dataName != null and dataName != ''">
and ttt.data_name = #{dataName}
</if>
<if test="categoryId != null">
and ttt.category_id = #{categoryId}
</if>
<if test="sceneId != null">
and ttt.scene_id = #{sceneId}
</if>
order by ttt.upt_time desc
</select>
<select id="selectByDetails" resultType="com.jz.dm.mall.moduls.controller.goods.bean.dto.DataGoodsApiDto">
SELECT
t1.data_goods_id as dataGoodsId,
t1.category_id as categoryId,
t2.category_name as categoryName,
t1.data_name as dataName,
( CASE WHEN t1.data_type = '01' THEN 'api' WHEN t1.data_type = '02' THEN '数据包' END ) dataType,
t1.data_label as dataLabel,
t1.data_picture as dataPicture,
( CASE when t1.price_type = '01' then '免费' when t1.price_type = '02' then '收费' end) priceType,
t1.discount_price as discountPrice,
t1.data_price as dataPrice,
t1.price_type as pariceType,
t2.parent_id as parentId,
t1.year_type as yearType,
t1.season_type as seasonType,
t1.month_type as monthType,
t1.second_type as secondType
t1.data_name as dataName,
t1.user_id as userId,
t1.upt_time as uptTime,
t2.category_name as categoryName,
t1.year_type as yearType,
t1.season_type as seasonType,
t1.month_type as monthType,
t1.second_type as secondType,
t1.goods_limited as goodsLimited,
t1.data_desc as dataDesc,
t1.data_picture as dataPicture,
t1.price_type as priceType
FROM
t_data_goods t1
INNER JOIN t_data_goods_category t2 on t1.category_id = t2.category_id
where
1= 1 and
t1.del_flag = 'N' and
t1.data_status = '02'
<if test="categoryId != null">
and t1.category_id = #{categoryId}
</if>
<if test="dataName != null and dataName != ''">
and data_name like concat('%',#{dataName},'%')
</if>
<if test="dataType != null and dataType != ''">
and data_type = #{dataType}
</if>
<if test="priceType != null and priceType != ''">
and price_type = #{priceType}
</if>
<if test="uptTime != null ">
ORDER BY
t1.upt_time desc
</if>
<if test="usePerson != null ">
ORDER BY
t1.use_person desc
</if>
<if test="synthesizeRank != null">
ORDER BY
t1.upt_time,t1.use_person desc
</if>
t_data_goods t1
left join t_data_goods_category t2 on t1.category_id = t2.category_id
where t1.del_flag = 'N'
and t1.data_goods_id = #{dataGoodsId}
</select>
</mapper>
\ No newline at end of file
......@@ -397,21 +397,7 @@
where order_id = #{orderId}
</update>
<update id="updateSalt" parameterType="com.jz.dm.mall.moduls.entity.Order">
update t_order
<set>
<if test="saltValue != null and saltValue != ''">
salt_value = #{saltValue},
</if>
<if test="uptTime != null">
upt_time = #{uptTime},
</if>
<if test="uptPerson != null and uptPerson != ''">
upt_person = #{uptPerson},
</if>
</set>
where order_id = #{orderId}
</update>
<select id="queryPageListBySeller" resultType="com.jz.dm.mall.moduls.controller.order.bean.dto.OrderBySellerDto">
SELECT
......@@ -500,28 +486,34 @@
<select id="queryPageListByPurchaser" resultType="com.jz.dm.mall.moduls.controller.order.bean.dto.OrderByPurchaserDto">
SELECT
t1.order_id as orderId,
t3.data_goods_id as dataGoodsId,
t1.goods_token as requestToken,
t1.api_key as apiKey,
t1.salt_value as saltValue,
t1.price_type as priceType,
t3.data_name as dataName
t3.data_name as dataName,
(CASE WHEN (t1.invalid_time >= DATE_FORMAT(NOW(), '%Y-%m-%d')) THEN '01' ELSE '02' END ) goodsStatus
FROM
t_order t1
join t_order_goods_info t2 on t1.order_id = t2.order_id
join t_data_goods t3 on t2.data_goods_id = t3.data_goods_id
where
t1.customer_id = #{customerId}
t1.department_id = #{departmentId}
<if test="dataName != null and dataName != ''">
and t3.data_name = #{dataName}
</if>
<if test="priceType != null and priceType != ''">
and t3.price_type = #{priceType}
and t1.price_type = #{priceType}
</if>
<if test="goodsStatus != null">
and (CASE WHEN (t1.invalid_time >= DATE_FORMAT(NOW(), '%Y-%m-%d')) THEN '01' ELSE '02' END ) = #{goodsStatus}
</if>
GROUP BY t1.api_key
order BY t1.order_time
</select>
<select id="getApiKey" resultType="map">
select api_key as apiKey,goods_token as requestToken from t_order where customer_id = #{customerId}
select api_key as apiKey,goods_token as requestToken from t_order where department_id = #{departmentId}
</select>
</mapper>
\ No newline at end of file
package com.jz.manage.moduls.controller.customer;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jz.common.constant.ResultMsg;
import com.jz.common.utils.Result;
import com.jz.manage.moduls.controller.BaseController;
import com.jz.manage.moduls.controller.customer.bean.dto.EnterpriseAuditDto;
import com.jz.manage.moduls.controller.customer.bean.request.CheckDepartmentAuditReq;
import com.jz.manage.moduls.controller.customer.bean.request.DepartmentAuditReq;
import com.jz.manage.moduls.controller.customer.bean.request.EnterpriseAuditRequest;
import com.jz.manage.moduls.controller.customer.bean.request.SaveCustomerRequest;
......@@ -15,6 +17,7 @@ import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;
/**
* 企业(Department)表控制层
......@@ -24,7 +27,7 @@ import javax.servlet.http.HttpServletRequest;
*/
@RestController
@RequestMapping("department")
@Api(tags = "企业信息管理--controller")
@Api(tags = "平台--企业管理--controller")
public class DepartmentController extends BaseController {
/**
* 服务对象
......@@ -40,9 +43,14 @@ public class DepartmentController extends BaseController {
* @throws Exception
*/
@PostMapping(value = "/findList")
@ApiOperation(value = "条件分页查询企业审核信息")
@ApiOperation(value = "企业审核--条件分页查询企业审核信息")
public Result<IPage<EnterpriseAuditDto>> findList(@RequestBody EnterpriseAuditRequest auditRequest, HttpServletRequest req) throws Exception {
return departmentService.findList(auditRequest, req);
try {
return departmentService.findList(auditRequest, req);
}catch (Exception e) {
e.printStackTrace();
return Result.of_error(ResultMsg.DATA_NOT_FOUND);
}
}
/**
......@@ -52,7 +60,7 @@ public class DepartmentController extends BaseController {
* @return
*/
@GetMapping(value = "/getDepartment/{id}")
@ApiOperation(value = "主键查询用户企业详情信息")
@ApiOperation(value = "企业审核--主键查询用户企业详情信息")
public Result selectById(@PathVariable(value = "id") Long id, HttpServletRequest req) throws Exception{
if (id != null) {
return departmentService.selectById(id);
......@@ -66,14 +74,20 @@ public class DepartmentController extends BaseController {
* @return
*/
@PostMapping(value = "/audit")
@ApiOperation(value = "企业审核")
public Result audit(@RequestBody DepartmentAuditReq req) throws Exception{
@ApiOperation(value = "企业审核--审核")
public Result audit(@RequestBody @Valid DepartmentAuditReq req) throws Exception{
if (!StringUtils.isEmpty(req)) {
return departmentService.audit(req);
}
return Result.error("企业审核失败");
}
@PostMapping(value = "/check")
@ApiOperation(value = "企业审核--校验企业是否已认证")
public Result check(@RequestBody @Valid CheckDepartmentAuditReq req) {
return departmentService.check(req);
}
/**
* 添加用户
* @param saveCustomerRequest
......@@ -82,11 +96,22 @@ public class DepartmentController extends BaseController {
* @throws Exception
*/
@PostMapping(value = "/add")
@ApiOperation(value = "添加用户")
public Result add(@RequestBody SaveCustomerRequest saveCustomerRequest, HttpServletRequest req) throws Exception {
@ApiOperation(value = "添加企业")
public Result add(@RequestBody @Valid SaveCustomerRequest saveCustomerRequest, HttpServletRequest req) throws Exception {
if (saveCustomerRequest != null) {
return departmentService.add(saveCustomerRequest, req);
}
return Result.error("添加用户失败!");
}
/**
* 通过授权码查税号--调用接口
* @param goodsToken
* @return
*/
@PostMapping(value = "/findUcCodeByGoodsToken")
@ApiOperation(value = "通过授权码查税号--调用接口")
public Result findUcCodeByGoodsToken(@RequestParam(name = "goodsToken") String goodsToken) {
return departmentService.findUcCodeByGoodsToken(goodsToken);
}
}
\ No newline at end of file
package com.jz.manage.moduls.controller.customer.bean.dto;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
......@@ -39,5 +40,6 @@ public class EnterpriseAuditDto {
private Date auditTime;
@ApiModelProperty(value = "企业角色")
@JsonIgnore
private Long roleId;
}
package com.jz.manage.moduls.controller.customer.bean.request;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/2/18
* @Version:
*/
@ApiModel("校验企业是否通过认证请求参数")
@Data
public class CheckDepartmentAuditReq implements Serializable {
@ApiModelProperty(value = "统一社会信用代码")
@NotNull(message = "统一社会信用代码不能为空")
private String unifiedCreditCode;
}
......@@ -4,6 +4,7 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
......@@ -17,9 +18,15 @@ import java.io.Serializable;
public class DepartmentAuditReq implements Serializable {
@ApiModelProperty(value = "企业id")
@NotNull(message = "企业id不能为空")
private Long departmentId;
@ApiModelProperty(value = "统一社会信用代码")
@NotNull(message = "统一社会信用代码不能为空")
private String unifiedCreditCode;
@ApiModelProperty(value = "审核状态 01通过,02未通过")
@NotNull(message = "审核状态不能为空")
private String auditStatus;
@ApiModelProperty(value = "驳回原因")
......
package com.jz.manage.moduls.controller.customer.bean.request;
import com.jz.common.bean.BasePageBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* @ClassName:
* @Author: Carl
......@@ -18,8 +15,7 @@ import java.util.Date;
@Data
public class EnterpriseAuditRequest extends BasePageBean {
@ApiModelProperty(value = "企业地址")
private String registeredAddress;
@ApiModelProperty(value = "企业名称")
private String departmentName;
......@@ -38,4 +34,7 @@ public class EnterpriseAuditRequest extends BasePageBean {
@ApiModelProperty(value = "企业角色")
private Long roleId;
@ApiModelProperty(value = "企业地址")
private String registeredAddress;
}
......@@ -3,11 +3,12 @@ package com.jz.manage.moduls.controller.customer.bean.request;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.jz.common.bean.BasePageBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
/**
......@@ -16,49 +17,56 @@ import java.math.BigDecimal;
* @Date: 2020/12/10
* @Version:
*/
@ApiModel(value = "用户添加信息请求参数封装")
@ApiModel(value = "企业添加信息请求参数封装")
@Data
public class SaveCustomerRequest extends BasePageBean {
@ApiModelProperty(value = "企业id")
@TableId(value = "department_id",type = IdType.AUTO)
private Long departmentId;
public class SaveCustomerRequest implements Serializable {
@ApiModelProperty(value = "企业名称")
@NotNull(message = "企业名称不能为空")
private String departmentName;
@ApiModelProperty(value = "企业地址")
@NotNull(message = "企业地址不能为空")
private String registeredAddress;
@ApiModelProperty(value = "营业执照")
@NotNull(message = "营业执照不能为空")
private String businessLicense;
@ApiModelProperty(value = "统一社会信用代码")
@NotNull(message = "统一社会信用代码不能为空")
private String unifiedCreditCode;
@ApiModelProperty(value = "银行卡号")
@NotNull(message = "银行卡号不能为空")
private String bankCardNumber;
@ApiModelProperty(value = "开户行地址")
@NotNull(message = "开户行地址不能为空")
private String bankAddress;
@ApiModelProperty(value = "联系人姓名")
@NotNull(message = "联系人姓名不能为空")
private String linkman;
@ApiModelProperty(value = "联系人电话")
@NotNull(message = "联系人电话不能为空")
private String telephone;
@ApiModelProperty(value = "账号名")
@NotNull(message = "账号名不能为空")
private String customerAccount;
@ApiModelProperty(value = "账号手机号")
@ApiModelProperty(value = "账号手机号",hidden = true)
private String customerPhone;
@ApiModelProperty(value = "密码")
@NotNull(message = "密码不能为空")
private String password;
@ApiModelProperty(value = "充值金额")
private BigDecimal balanceMoney;
@ApiModelProperty(value = "用户角色")
@ApiModelProperty(value = "用户角色",hidden = true)
private String roleId;
}
......@@ -6,10 +6,8 @@ import com.jz.common.utils.Result;
import com.jz.manage.moduls.controller.BaseController;
import com.jz.manage.moduls.controller.finance.platForm.dto.BalanceInfoDto;
import com.jz.manage.moduls.controller.finance.platForm.dto.BalanceListDto;
import com.jz.manage.moduls.controller.finance.platForm.req.BalanceAuditRequest;
import com.jz.manage.moduls.controller.finance.platForm.req.BalanceListRequest;
import com.jz.manage.moduls.controller.finance.platForm.req.BalanceQuickReq;
import com.jz.manage.moduls.controller.finance.platForm.req.CashOutQuickReq;
import com.jz.manage.moduls.controller.finance.platForm.dto.DepartmentTradeDto;
import com.jz.manage.moduls.controller.finance.platForm.req.*;
import com.jz.manage.moduls.service.FinanceCustomerBalanceService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......@@ -144,8 +142,30 @@ public class FinanceCustomerBalanceController extends BaseController {
* @return
*/
@PostMapping("/searchCompany")
@ApiOperation(value = "充值/提现管理-搜索企业", notes = "搜索企业")
@ApiOperation(value = "充值/提现管理--搜索企业", notes = "搜索企业")
public Result searchCompany(@RequestParam String search) {
return financeCustomerBalanceService.searchCompany(search);
}
/**
* 条件查询企业交易记录
* @param req
* @return
*/
@PostMapping("/tradeCompany")
@ApiOperation(value = "财务管理-企业--条件查询企业交易记录")
public Result<IPage<DepartmentTradeDto>> tradeCompany(@RequestBody TradeCompanyReq req) {
return financeCustomerBalanceService.tradeCompany(req);
}
/**
* 主键查询企业交易详情
* @param departmentId
* @return
*/
@GetMapping("/tradeCompanyDetail")
@ApiOperation(value = "财务管理-企业--主键查询企业交易详情")
public Result tradeCompanyDetail(@RequestParam(name = "departmentId") Long departmentId) {
return financeCustomerBalanceService.tradeCompanyDetail(departmentId);
}
}
\ No newline at end of file
package com.jz.manage.moduls.controller.finance.platForm.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
/**
* @ClassName:
......@@ -38,10 +41,14 @@ public class DepartmentAssetsDto implements Serializable {
private String dataName;
@ApiModelProperty("生效日期")
private String takeEffectTime;
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date takeEffectTime;
@ApiModelProperty("失效日期")
private String invalidTime;
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date invalidTime;
@ApiModelProperty("购买方式")
private String purchaseMethod;
......@@ -59,4 +66,7 @@ public class DepartmentAssetsDto implements Serializable {
private String secondType;
@ApiModelProperty("订单id")
private Long orderId;
@ApiModelProperty(value = "价格类型 01免费,02收费")
private String priceType;
}
package com.jz.manage.moduls.controller.finance.platForm.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/2/18
* @Version:
*/
@ApiModel("条件分页查询企业交易记录返回参数")
@Data
public class DepartmentTradeDto implements Serializable {
@ApiModelProperty(value = "企业名称")
private String departmentName;
@ApiModelProperty(value = "企业id")
private Long departmentId;
@ApiModelProperty(value = "企业联系人")
private String linkman;
@ApiModelProperty(value = "企业联系人电话")
private String telephone;
@ApiModelProperty(value = "交易订单量")
private String orderTotal;
@ApiModelProperty(value = "交易总金额")
private String transactionMoney;
}
package com.jz.manage.moduls.controller.finance.platForm.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/2/19
* @Version:
*/
@ApiModel("财务管理-企业-企业交易详情返回参数")
@Data
public class TradeCompanyDetailDto implements Serializable {
@ApiModelProperty(value = "订单id")
private Long orderId;
@ApiModelProperty(value = "订单编号")
private String orderNumber;
@ApiModelProperty(value = "商品名称")
private String dataName;
@ApiModelProperty(value = "订单金额")
private String paymentMoney;
@ApiModelProperty(value = "创建时间")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date creTime;
@ApiModelProperty(value = "支付方式 01:余额")
private String paymentMethod;
}
package com.jz.manage.moduls.controller.finance.platForm.req;
import com.jz.common.bean.BasePageBean;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/2/18
* @Version:
*/
@ApiModel("企业交易记录请求参数")
@Data
public class TradeCompanyReq extends BasePageBean implements Serializable {
@ApiModelProperty(value = "搜索条件")
private String search;
@ApiModelProperty(value = "联系人电话")
private String telephone;
}
......@@ -102,13 +102,18 @@ public class DataGoodsCategoryController extends BaseController {
*/
@PostMapping(value = "/selectByCategory")
@ApiOperation(value = "商品分类管理--条件查询商品分类")
public Result selectByCategory(@RequestParam(required = false) String search) {
public Result selectByCategory(@RequestParam(name = "search",required = false) String search) {
return categoryService.selectByCategory(search);
}
@PostMapping(value = "/deleteByCategory")
@ApiOperation(value = "商品分类管理--删除分类")
public Result deleteByCategory(@RequestBody @Valid CategoryAndSceneReq req) {
return categoryService.deleteByCategory(req);
try {
return categoryService.deleteByCategory(req);
}catch (Exception e) {
e.printStackTrace();
return Result.of_error(ResultMsg.DELETE_FAIL);
}
}
}
\ No newline at end of file
......@@ -8,13 +8,12 @@ import com.jz.common.constant.Constants;
import com.jz.common.constant.ResultMsg;
import com.jz.common.utils.Result;
import com.jz.manage.moduls.controller.BaseController;
import com.jz.manage.moduls.controller.goods.bean.dto.DataGoodsAuditDto;
import com.jz.manage.moduls.controller.goods.bean.dto.DataGoodsDto;
import com.jz.manage.moduls.controller.goods.bean.dto.DataGoodsListDto;
import com.jz.manage.moduls.controller.goods.bean.dto.*;
import com.jz.manage.moduls.controller.goods.bean.request.*;
import com.jz.manage.moduls.entity.DataGoods;
import com.jz.manage.moduls.service.DataGoodsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
......@@ -63,7 +62,12 @@ public class DataGoodsController extends BaseController {
@ApiOperation(value = "商品审核管理--列表查询数据")
public Result<IPage<DataGoodsAuditDto>> findByAudit(@RequestBody DataGoodsAuditListReq req, HttpServletRequest httpRequest){
return dataGoodsService.findByAudit(req,httpRequest);
}
@GetMapping(value = "/findByDataTypeList")
@ApiOperation(value = "商品列表--获取数据类型", notes = "调用接口")
public Result findByDataTypeList() {
return dataGoodsService.findByDataTypeList();
}
/**
......@@ -79,23 +83,6 @@ public class DataGoodsController extends BaseController {
/**主键查询数据商品
* @param DataGoodsRequest
* @return
*/
@RequestMapping(method = RequestMethod.POST, value = "/view")
public BaseBeanResponse<DataGoodsDto> view(@RequestBody DataGoodsRequest DataGoodsRequest, HttpServletRequest httpRequest){
BaseBeanResponse<DataGoodsDto> baseBeanResponse = new BaseBeanResponse<DataGoodsDto>();
try {
baseBeanResponse = dataGoodsService.findById(DataGoodsRequest, httpRequest);
} catch (Exception e) {
baseBeanResponse.setMessage("请求失败");
baseBeanResponse.setCode(Constants.FAILURE_CODE);
e.printStackTrace();
}
return baseBeanResponse;
}
/**新增数据商品
* @param
......@@ -122,54 +109,16 @@ public class DataGoodsController extends BaseController {
// }
/**删除数据商品
* @param DataGoodsRequest
* @return
*/
@RequestMapping(method = RequestMethod.POST, value = "/delete")
public BaseResponse delete(@RequestBody DataGoodsRequest DataGoodsRequest, HttpServletRequest httpRequest){
BaseResponse baseResponse = new BaseResponse();
try {
baseResponse = dataGoodsService.deleteById(DataGoodsRequest, httpRequest);
} catch (Exception e) {
baseResponse.setMessage("删除失败");
baseResponse.setCode(Constants.FAILURE_CODE);
e.printStackTrace();
}
return baseResponse;
}
/**修改数据商品
* @param
* @return
*/
@RequestMapping(method = RequestMethod.POST, value = "/edit")
public BaseBeanResponse<DataGoods> edit(@RequestBody DataGoods dataGoods, HttpServletRequest httpRequest){
BaseBeanResponse<DataGoods> baseBeanResponse = new BaseBeanResponse<DataGoods>();
try {
baseBeanResponse = dataGoodsService.edit(dataGoods, httpRequest);
} catch (Exception e) {
baseBeanResponse.setMessage("修改失败");
baseBeanResponse.setCode(Constants.FAILURE_CODE);
e.printStackTrace();
}
return baseBeanResponse;
}
/**
* 商品上下架
* @param goodsId
* @param statusId
* @return
*/
@PostMapping("/editStatus/{goodsId}/{statusId}")
@PostMapping("/editStatus")
@ApiOperation(value = "商品列表--商品上下架")
public Result editStatus(@PathVariable(value = "goodsId") Long goodsId,
@PathVariable(value = "statusId") String statusId) {
public Result editStatus(@RequestBody @Valid DataGoodsEditReq req) {
try {
return dataGoodsService.editStatus(goodsId, statusId);
return dataGoodsService.editStatus(req);
}catch (Exception e) {
e.printStackTrace();
return Result.of_error(ResultMsg.UPDATE_FAIL);
......@@ -192,7 +141,7 @@ public class DataGoodsController extends BaseController {
* @param dataGoodsId
* @return
*/
@PostMapping("/findByAuthorization")
@GetMapping("/findByAuthorization")
@ApiOperation(value = "商品列表--浏览授权--查询授权")
public Result findByAuthorization(@RequestParam(name = "dataGoodsId") Long dataGoodsId) {
return dataGoodsService.findByAuthorization(dataGoodsId);
......@@ -221,6 +170,7 @@ public class DataGoodsController extends BaseController {
}
/**
* 根据主键查询商品详情-api
* @param id
......@@ -247,6 +197,24 @@ public class DataGoodsController extends BaseController {
return dataGoodsService.getAPIList(req);
}
/**
* 获取制作的商品
* @param req
* @return
*/
@PostMapping("/getDataGoodsNewsList")
@ApiOperation(value = "制作商品-获取制作的商品")
public Result<IPage<ApiDataGoodsListDto>> getDataGoodsNewsList(@RequestBody @Valid DataGoodsByMakeReq req) {
return dataGoodsService.getDataGoodsNewsList(req);
}
@PostMapping("/updateSendStatus")
@ApiOperation(value = "制作商品-退回数据")
public Result updateSendStatus(@RequestBody @Valid ApiInterfaceDetailReq req) {
return dataGoodsService.updateSendStatus(req);
}
/**
* 获取API详情
* @param req
......@@ -254,10 +222,9 @@ public class DataGoodsController extends BaseController {
*/
@ApiOperation(value = "制作商品-API详情查询",notes = "调用接口")
@PostMapping(value = "/getApiInterfaceDetail")
public Result getApiInterfaceDetail(@RequestBody @Valid ApiInterfaceDetailReq req) {
public Result<DataDetailsDto> getApiInterfaceDetail(@RequestBody @Valid ApiInterfaceDetailReq req) {
return dataGoodsService.getApiInterfaceDetail(req);
}
/**
* 制作商品
* @param req
......@@ -273,6 +240,4 @@ public class DataGoodsController extends BaseController {
return Result.of_error("制作失败!");
}
}
}
\ No newline at end of file
......@@ -52,6 +52,11 @@ public class DemandController extends BaseController {
return tDemandService.findByDemand(demandId);
}
/**
* 审核需求
* @param req
* @return
*/
@PostMapping("/auditDemand")
@ApiOperation(value = "需求审核--审核需求")
public Result auditDemand(@RequestBody @Valid DemandAuditReq req) {
......
package com.jz.manage.moduls.controller.goods.bean.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/2/22
* @Version:
*/
@ApiModel("根据api制作的商品返回参数")
@Data
public class ApiDataGoodsListDto implements Serializable {
@ApiModelProperty(value = "商品id")
private Long dataGoodsId;
@ApiModelProperty(value = "商品名称")
private String dataName;
@ApiModelProperty(value = "商品上下架状态 04上架,03下架")
private String dataStatus;
@ApiModelProperty(value = "apiKey")
private String apiKey;
}
package com.jz.manage.moduls.controller.goods.bean.dto;
import com.jz.manage.moduls.entity.DataGoods;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/2/20
* @Version:
*/
@ApiModel("数据列表返回参数")
@Data
public class ApiDataListDto implements Serializable {
@ApiModelProperty(value = "api名称")
private String apiName;
@ApiModelProperty(value = "apiId")
private Long id;
@ApiModelProperty(value = "数据类型")
private String apiType;
@ApiModelProperty(value = "apiKey")
private String apiKey;
@ApiModelProperty(value = "数据大小" , hidden = true)
private String dataBag;
@ApiModelProperty(value = "创建时间")
private Date createDate;
@ApiModelProperty(value = "更新时间")
private Date updateDate;
@ApiModelProperty(value = "商品")
private List<ApiDataGoodsListDto> children;
// @ApiModelProperty(value = "商品id")
// private Long dataGoodsId;
//
// @ApiModelProperty(value = "商品名称")
// private String dataName;
//
// @ApiModelProperty(value = "商品上下架 01上架 02下架")
// private String dataStatus;
}
package com.jz.manage.moduls.controller.goods.bean.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/2/20
* @Version:
*/
@ApiModel("api详情返回参数")
@Data
public class DataDetailsDto implements Serializable {
@ApiModelProperty(value = "apiId")
private Long id;
@ApiModelProperty(value = "apiKey")
private String apiKey;
@ApiModelProperty(value = "api名称")
private String apiName;
@ApiModelProperty(value = "返回类型")
private String outputType;
@ApiModelProperty(value = "加密方式 0:无 1:MD5,2:RES")
private String signType;
@ApiModelProperty(value = "传输方式 0,http,1.https")
private String apiProtocl;
@ApiModelProperty(value = "超时时间")
private String timeout;
@ApiModelProperty(value = "请求方式")
private String reqType;
@ApiModelProperty(value = "最大行数")
private Integer maxRow;
@ApiModelProperty(value = "每页返回数")
private Integer pageRow;
@ApiModelProperty(value = "调用限制")
private Integer reqFrequency;
@ApiModelProperty(value = "api描述")
private String apiFunction;
@ApiModelProperty(value = "最大数据量")
private Integer maxData;
@ApiModelProperty(value = "请求参数")
private String requestParam;
@ApiModelProperty(value = "返回参数")
private String responseParam;
@ApiModelProperty(value = "api类型")
private String apiType;
}
......@@ -4,6 +4,7 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
......@@ -16,7 +17,7 @@ import java.util.Date;
*/
@ApiModel(value = "商品列表", description = "商品列表参数对象")
@Data
public class DataGoodsListDto {
public class DataGoodsListDto implements Serializable {
/**
* 数据商品id
......@@ -66,7 +67,9 @@ public class DataGoodsListDto {
@ApiModelProperty(value = "数据状态")
private String dataStatus;
@ApiModelProperty(value = "商品状态")
@ApiModelProperty(value = "商品状态 01有效,02失效")
private String goodsState;
@ApiModelProperty(value = "apiKey")
private String apiKey;
}
package com.jz.manage.moduls.controller.goods.bean.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
......@@ -36,12 +38,18 @@ public class DepartmentDataGoodsDto implements Serializable {
private String goodsStatus;
@ApiModelProperty("授权时间")
private Date date;
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date privilegedTime;
@ApiModelProperty("授权开始时间")
private String takeEffectTime;
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date takeEffectTime;
@ApiModelProperty("授权结束时间")
private String invalidTime;
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date invalidTime;
}
......@@ -17,10 +17,10 @@ import java.io.Serializable;
* @Description:
**/
@Data
@ApiModel("API详情信息")
@ApiModel(value = "API详情信息")
public class ApiInterfaceDetailReq implements Serializable {
@ApiModelProperty(value = "id",required = true)
@NotNull(message = "id不能为空")
private Long id;
@ApiModelProperty(value = "apiKey",required = true)
@NotNull(message = "apiKey不能为空")
private String apiKey;
}
......@@ -38,24 +38,12 @@ public class DataApiUpReq implements Serializable {
private Long categoryId;
@ApiModelProperty(value = "场景分类")
private Long sceneId;
@ApiModelProperty(value = "目标地址")
@NotNull(message = "目标地址不能为空")
private String targetUrl;
@ApiModelProperty(value = "数据描述")
@NotNull(message = "数据描述不能为空")
private String dataDesc;
@ApiModelProperty(value = "商品图片")
@NotNull(message = "商品图片不能为空")
private String dataPicture;
@ApiModelProperty(value = "数据最大量")
@NotNull(message = "数据最大量不能为空")
private String dataMaximum;
@ApiModelProperty(value = "最大页数")
@NotNull(message = "最大页数不能为空")
private String maxPages;
@ApiModelProperty(value = "每页数据量")
@NotNull(message = "每页数据量不能为空")
private String dataSize;
@ApiModelProperty(value = "商品有限期")
@NotNull(message = "商品有限期不能为空")
private Integer goodsLimited;
......@@ -71,23 +59,5 @@ public class DataApiUpReq implements Serializable {
@ApiModelProperty(value = "次(元)")
private BigDecimal secondType;
/**
* gateway制作参数
* api
*/
// @ApiModelProperty(value = "api类型 01:api 02: 数据包")
// private String apiType;
// @ApiModelProperty(value = "api名称")
// private String apiName;
// @ApiModelProperty(value = "返回类型 json/flow")
// private String returnType;
// @ApiModelProperty(value = "加密方式 MD5/RSA")
// private String encryMode;
// @ApiModelProperty(value = "传输方式")
// private String transMode;
// @ApiModelProperty(value = "超时时间")
// private String overTime;
// @ApiModelProperty(value = "api请求协议:http,https")
// private String apiProtocl;
}
package com.jz.manage.moduls.controller.goods.bean.request;
import com.jz.common.bean.BasePageBean;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/2/22
* @Version:
*/
@ApiModel(value = "制作商品-获取制作的商品请求参数")
@Data
public class DataGoodsByMakeReq extends BasePageBean implements Serializable {
@ApiModelProperty(value = "apiKey", required = true)
@NotNull(message = "apiKey不能为空")
private String apiKey;
@ApiModelProperty(value = "商品名称")
private String dataName;
@ApiModelProperty(value = "商品上架状态 03下架,04上架")
private Integer dataStatus;
}
package com.jz.manage.moduls.controller.goods.bean.request;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/2/20
* @Version:
*/
@ApiModel
@Data
public class DataGoodsEditReq implements Serializable {
@ApiModelProperty(value = "商品id", required = true)
@NotNull(message = "商品id不能为空")
private Long dataGoodsId;
@ApiModelProperty(value = "上下架状态 ,01上架,02下架",required = true)
@NotNull(message = "上下架状态不能为空")
private String statusId;
}
package com.jz.manage.moduls.controller.goods.bean.request;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
......@@ -17,30 +20,40 @@ import java.util.Date;
@Data
@ApiModel
public class GoodsByAuthorizationReq implements Serializable {
@ApiModelProperty(value = "商品id")
@ApiModelProperty(value = "商品id", required = true)
@NotNull(message = "商品id不能为空")
private Long dataGoodsId;
@ApiModelProperty(value = "企业id")
@ApiModelProperty(value = "企业id", required = true)
@NotNull(message = "企业id不能为空")
private Long departmentId;
@ApiModelProperty(value = "用户id")
@ApiModelProperty(value = "用户id", required = true)
@NotNull(message = "用户id不能为空")
private Long customerId;
@ApiModelProperty(value = "购买方式 01年,02季,03月,04次")
@ApiModelProperty(value = "购买方式 01年,02季,03月,04次", required = true)
@NotNull(message = "购买方式不能为空")
private String purchaseMethod;
@ApiModelProperty(value = "生效期")
@ApiModelProperty(value = "生效期", required = true)
@NotNull(message = "生效期不能为空")
private Date takeEffectTime;
@ApiModelProperty(value = "失效期")
@ApiModelProperty(value = "失效期", required = true)
@NotNull(message = "失效期不能为空")
private Date invalidTime;
@ApiModelProperty(value = "apiKey")
@ApiModelProperty(value = "apiKey", required = true)
@NotNull(message = "apiKey不能为空")
private String apiKey;
@ApiModelProperty(value = "商品金额")
@ApiModelProperty(value = "商品金额", required = true)
@NotNull(message = "商品金额不能为空")
private BigDecimal dataPrice;
@ApiModelProperty(value = "价格类型")
@ApiModelProperty(value = "价格类型 01免费,02收费")
private String priceType;
@ApiModelProperty(value = "资产账户id")
@ApiModelProperty(value = "资产账户id", required = true)
@NotNull(message = "资产账户id不能为空")
private Long assetsId;
}
......@@ -5,7 +5,9 @@ import com.jz.common.utils.Result;
import com.jz.manage.moduls.controller.BaseController;
import com.jz.manage.moduls.controller.order.bean.dto.OrderDetailDto;
import com.jz.manage.moduls.controller.order.bean.dto.OrderDto;
import com.jz.manage.moduls.controller.order.bean.req.ApiInterfaceDetailReq;
import com.jz.manage.moduls.controller.order.bean.req.OrderRequest;
import com.jz.manage.moduls.controller.order.bean.req.SaltResetReq;
import com.jz.manage.moduls.service.OrderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......@@ -14,6 +16,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;
/**
* 订单表(TOrder)表控制层
......@@ -48,17 +51,38 @@ public class OrderController extends BaseController {
* @param orderId
* @author Bellamy
*/
@GetMapping(value = "/orderDetail")
@ApiOperation(value = "订单详情", notes = "订单详情")
@GetMapping(value = "/getOrderDetail")
@ApiOperation(value = "API订单--订单详情", notes = "订单详情")
public Result<OrderDetailDto> getOrderDetail(@RequestParam(value = "orderId") String orderId, HttpServletRequest req) throws Exception {
Result<OrderDetailDto> result = new Result<OrderDetailDto>();
if (StringUtils.isNotEmpty(orderId)) {
OrderDetailDto orderDto = orderService.queryOrderDetail(orderId);
result.setData(orderDto);
return orderService.queryOrderDetail(orderId);
} else {
result.setMessage("参数为不能为空!");
}
return result;
}
@PostMapping(value = "/getOrderApiDetail")
@ApiOperation(value = "API订单--订单详情--接口文档")
public Result getOrderApiDetail(@RequestBody @Valid ApiInterfaceDetailReq req) {
return orderService.getOrderApiDetail(req);
}
/**
* 订单详情--重置盐值
* @param req
* @return
*/
@PostMapping(value = "/resetSalt")
@ApiOperation(value = "订单详情---重置盐值", notes = "重置盐值")
public Result resetSalt(@RequestBody @Valid SaltResetReq req) {
Result result = new Result();
if (StringUtils.isNotEmpty(req.getGoodsToken()) && req.getId() != null) {
result = orderService.updateSalt(req);
}else {
result.setMessage("参数不能为空!");
}
return result;
}
}
\ No newline at end of file
package com.jz.manage.moduls.controller.order.bean.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @ClassName:
* @Author: Carl
* @Date: 2021/2/18
* @Version:
*/
@ApiModel("订单详情")
@Data
public class ApiInterfaceDetailDto implements Serializable {
/**
* 目标url
*/
@ApiModelProperty("目标url")
private String targetUrl;
/**
* 请求方式:GET POST
*/
@ApiModelProperty("请求方式")
private String reqType;
/**
* api唯一标识
*/
@ApiModelProperty("api唯一标识")
private String apiKey;
/**
* '输出类型:flow 流形式输出, json格式输出',
*/
@ApiModelProperty("输出类型")
private String outputType;
@ApiModelProperty("参数名称")
private String paramsName;
@ApiModelProperty("参数类型")
private String paramsType;
@ApiModelProperty("参数描述")
private String paramsDesc;
@ApiModelProperty("默认值")
private String defaultValue;
}
......@@ -19,6 +19,6 @@ public class OrderAndAuthorizedDto implements Serializable {
@ApiModelProperty("是否有效:01有效,02无效")
private String goodsState;
@ApiModelProperty("用户id")
private Long customerId;
@ApiModelProperty("企业id")
private Long departmentId;
}
......@@ -3,6 +3,7 @@ package com.jz.manage.moduls.controller.order.bean.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
......@@ -15,6 +16,7 @@ import java.util.Date;
*/
@ApiModel(value = "订单管理--订单列表返回参数对象", description = "订单列表返回参数对象")
@Data
public class OrderDetailDto {
private static final long serialVersionUID = 651546246975691600L;
/**
......@@ -23,118 +25,34 @@ public class OrderDetailDto {
@ApiModelProperty(value = "订单编号")
private String orderNumber;
/**
* 订单状态:01待支付,02已支付,03已取消
*/
@ApiModelProperty(value = "订单状态:01待支付,02已支付,03已取消")
private String orderStatus;
/**
* 订单金额
* 数据名称
*/
@ApiModelProperty(value = "订单金额")
private BigDecimal orderMoney;
@ApiModelProperty(value = "数据名称")
private String dataName;
@ApiModelProperty(value = "数据类型")
private String dataType;
/**
* 订单时间
*/
@ApiModelProperty(value = "订单时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date orderTime;
/**
* 支付方式:01余额
*/
@ApiModelProperty(value = "支付方式:01余额")
private String paymentMethod;
/**
* 购买方式:01年,02季,03月,04次(服务类型)
*/
@ApiModelProperty(value = "购买方式:01年,02季,03月,04次(服务类型)")
private String purchaseMethod;
@ApiModelProperty(value = "有效期")
private String indate;
/**
* 数据名称
*/
@ApiModelProperty(value = "数据名称")
private String dataName;
/**
* 数据分类
*/
@ApiModelProperty(value = "数据分类")
private String dataType;
/**
* 企业名称
* 失效日期
*/
@ApiModelProperty(value = "企业名称")
private String departmentName;
public String getOrderNumber() {
return orderNumber;
}
public void setOrderNumber(String orderNumber) {
this.orderNumber = orderNumber;
}
public String getOrderStatus() {
return orderStatus;
}
public void setOrderStatus(String orderStatus) {
this.orderStatus = orderStatus;
}
public BigDecimal getOrderMoney() {
return orderMoney;
}
public void setOrderMoney(BigDecimal orderMoney) {
this.orderMoney = orderMoney;
}
public Date getOrderTime() {
return orderTime;
}
public void setOrderTime(Date orderTime) {
this.orderTime = orderTime;
}
public String getPaymentMethod() {
return paymentMethod;
}
public void setPaymentMethod(String paymentMethod) {
this.paymentMethod = paymentMethod;
}
public String getPurchaseMethod() {
return purchaseMethod;
}
public void setPurchaseMethod(String purchaseMethod) {
this.purchaseMethod = purchaseMethod;
}
public String getDataName() {
return dataName;
}
public void setDataName(String dataName) {
this.dataName = dataName;
}
public String getDataType() {
return dataType;
}
public void setDataType(String dataType) {
this.dataType = dataType;
}
public String getDepartmentName() {
return departmentName;
}
@ApiModelProperty(value = "失效日期")
private Date invalidTime;
public void setDepartmentName(String departmentName) {
this.departmentName = departmentName;
}
@ApiModelProperty("goodsToken")
private String goodsToken;
}
\ No newline at end of file
......@@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.util.Date;
......@@ -47,8 +48,9 @@ public class OrderDto {
* 订单时间
*/
@ApiModelProperty(value = "订单时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date orderTime;
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date creTime;
/**
* 企业名称
......@@ -56,4 +58,7 @@ public class OrderDto {
@ApiModelProperty(value = "企业名称")
private String departmentName;
}
\ No newline at end of file
@ApiModelProperty(value = "apiKey")
private String apiKey;
}
\ No newline at end of file
package com.jz.manage.moduls.controller.order.bean.req;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
* @author Carl
* @DATE: 2021/2/18 15:34
**/
@Data
@ApiModel("API详情信息")
public class ApiInterfaceDetailReq implements Serializable {
@ApiModelProperty(value = "id",required = false)
private Long id;
@ApiModelProperty(value = "apiKey",required = true)
@NotNull(message = "apiKey不能为空")
private String apiKey;
}
package com.jz.manage.moduls.controller.order.bean.req;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
* @author ZC
* @PACKAGE_NAME: com.jz.dm.models.req
* @PROJECT_NAME: jz-dm-parent
* @NAME: SaltResetReq
* @DATE: 2020-12-26/19:16
* @DAY_NAME_SHORT: 周六
* @Description:
**/
@Data
@ApiModel("盐值重置请求体")
public class SaltResetReq implements Serializable {
@ApiModelProperty(value = "授权码",required = true)
@NotNull(message = "授权码不能为空")
private String goodsToken;
@ApiModelProperty(value = "订单id")
// @NotNull(message = "订单id不能为空")
private Long id;
}
......@@ -27,12 +27,15 @@ public class DataGoods implements Serializable {
* 数据商品id
*/
@TableId(value = "data_goods_id", type = IdType.AUTO)
@ApiModelProperty(value = "数据商品id")
private Long dataGoodsId;
/**
* 商品分类id(行业)
*/
@TableField("category_id")
@ApiModelProperty(value = "商品分类id")
private Long categoryId;
@ApiModelProperty(value = "场景id")
@TableField("scene_id")
private Long sceneId;
/**
......@@ -47,6 +50,7 @@ public class DataGoods implements Serializable {
* 数据商品名称
*/
@TableField("data_name")
@ApiModelProperty(value = "数据商品名称")
private String dataName;
/**
* 数据类型:01api,02数据包
......@@ -78,6 +82,9 @@ public class DataGoods implements Serializable {
*/
@TableField("price_type")
private String priceType;
@TableField("api_key")
private String apiKey;
/**
* 商品规格
*/
......@@ -87,6 +94,7 @@ public class DataGoods implements Serializable {
* 数据状态:01预售,02在售中,03下架,04上架
*/
@TableField("data_status")
@ApiModelProperty(value = "数据状态: 03下架,04上架")
private String dataStatus;
/**
* 审核状态:01待审核,02已审核,03未通过
......
......@@ -84,7 +84,12 @@ public class DataGoodsCategory implements Serializable {
@TableField("del_flag")
@ApiModelProperty(value = "是否删除")
private String delFlag;
@ApiModelProperty("场景")
@TableField(exist = false)
private String sceneName;
@ApiModelProperty("场景id")
@TableField(exist = false)
private String sceneId;
@TableField(exist = false)
private List<DataGoodsCategory> children;
......
......@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
......@@ -17,6 +18,7 @@ import java.util.Date;
*/
@TableName("t_department")
@ApiModel
@Data
public class Department implements Serializable {
private static final long serialVersionUID = -86955761674824098L;
/**
......@@ -27,358 +29,145 @@ public class Department implements Serializable {
/**
* 企业名称
*/
@TableField(value = "department_name")
private String departmentName;
/**
* 法人代表
*/
@TableField(value = "legal_representative")
private String legalRepresentative;
/**
* 省份
*/
@TableField(value = "province")
private String province;
/**
* 城市
*/
@TableField(value = "city")
private String city;
@TableField(value = "linkman")
private String linkman;
/**
* 行业
*/
@TableField(value = "industry")
private String industry;
/**
* 联系人
*/
private String linkman;
/**
* 联系电话
*/
@TableField(value = "telephone")
private String telephone;
/**
* 注册地址
*/
@TableField(value = "registered_address")
private String registeredAddress;
/**
* 区域编码
*/
@TableField(value = "zone_code")
private Object zoneCode;
/**
* 企业照片
*/
@TableField(value = "depart_picture")
private String departPicture;
/**
* 营业执照
*/
@TableField(value = "business_license")
private String businessLicense;
/**
* 税务登记
*/
@TableField(value = "tax_registration")
private String taxRegistration;
/**
* 企业照片(代码)到期时间
*/
@TableField(value = "depart_picture_time")
private Date departPictureTime;
/**
* 营业执照到期时间
*/
@TableField(value = "business_license_time")
private Date businessLicenseTime;
/**
* 税务登记到期时间
*/
@TableField(value = "tax_registration_time")
private Date taxRegistrationTime;
@TableField(value = "department_source")
private String departmentSource;
/**
* 统一社会信用代码
*/
@TableField(value = "unified_credit_code")
private String unifiedCreditCode;
/**
* 开户行名称
*/
@TableField(value = "bank_name")
private String bankName;
/**
* 银行卡号
*/
@TableField(value = "bank_card_number")
private String bankCardNumber;
/**
* 开户行地址
*/
@TableField(value = "bank_address")
private String bankAddress;
/**
* 开户行号
*/
@TableField(value = "bank_no")
private String bankNo;
/**
* 审核状态:01待审核,02已审核,03未通过
*/
@TableField(value = "audit_status")
private String auditStatus;
/**
* 驳回原因
*/
@TableField(value = "reject_reason")
private String rejectReason;
/**
* 审核人
*/
@TableField(value = "audit_person")
private String auditPerson;
/**
* 审核时间
*/
@TableField(value = "audit_time")
private Date auditTime;
/**
* 创建时间
*/
@TableField(value = "cre_time")
private Date creTime;
/**
* 创建人
*/
@TableField(value = "cre_person")
private String crePerson;
/**
* 更新时间
*/
@TableField(value = "upt_time")
private Date uptTime;
/**
* 更新人
*/
@TableField(value = "upt_person")
private String uptPerson;
/**
* 删除标识
*/
@TableField(value = "del_flag")
private String delFlag;
public Long getDepartmentId() {
return departmentId;
}
public void setDepartmentId(Long departmentId) {
this.departmentId = departmentId;
}
public String getDepartmentName() {
return departmentName;
}
public void setDepartmentName(String departmentName) {
this.departmentName = departmentName;
}
public String getLegalRepresentative() {
return legalRepresentative;
}
public void setLegalRepresentative(String legalRepresentative) {
this.legalRepresentative = legalRepresentative;
}
public String getProvince() {
return province;
}
public void setProvince(String province) {
this.province = province;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getIndustry() {
return industry;
}
public void setIndustry(String industry) {
this.industry = industry;
}
public String getTelephone() {
return telephone;
}
public void setTelephone(String telephone) {
this.telephone = telephone;
}
public String getRegisteredAddress() {
return registeredAddress;
}
public void setRegisteredAddress(String registeredAddress) {
this.registeredAddress = registeredAddress;
}
public Object getZoneCode() {
return zoneCode;
}
public void setZoneCode(Object zoneCode) {
this.zoneCode = zoneCode;
}
public String getDepartPicture() {
return departPicture;
}
public void setDepartPicture(String departPicture) {
this.departPicture = departPicture;
}
public String getBusinessLicense() {
return businessLicense;
}
public void setBusinessLicense(String businessLicense) {
this.businessLicense = businessLicense;
}
public String getTaxRegistration() {
return taxRegistration;
}
public void setTaxRegistration(String taxRegistration) {
this.taxRegistration = taxRegistration;
}
public Date getDepartPictureTime() {
return departPictureTime;
}
public void setDepartPictureTime(Date departPictureTime) {
this.departPictureTime = departPictureTime;
}
public Date getBusinessLicenseTime() {
return businessLicenseTime;
}
public void setBusinessLicenseTime(Date businessLicenseTime) {
this.businessLicenseTime = businessLicenseTime;
}
public Date getTaxRegistrationTime() {
return taxRegistrationTime;
}
public void setTaxRegistrationTime(Date taxRegistrationTime) {
this.taxRegistrationTime = taxRegistrationTime;
}
public String getUnifiedCreditCode() {
return unifiedCreditCode;
}
public void setUnifiedCreditCode(String unifiedCreditCode) {
this.unifiedCreditCode = unifiedCreditCode;
}
public String getBankName() {
return bankName;
}
public void setBankName(String bankName) {
this.bankName = bankName;
}
public String getBankCardNumber() {
return bankCardNumber;
}
public void setBankCardNumber(String bankCardNumber) {
this.bankCardNumber = bankCardNumber;
}
public String getBankAddress() {
return bankAddress;
}
public void setBankAddress(String bankAddress) {
this.bankAddress = bankAddress;
}
public String getBankNo() {
return bankNo;
}
public void setBankNo(String bankNo) {
this.bankNo = bankNo;
}
public String getAuditStatus() {
return auditStatus;
}
public void setAuditStatus(String auditStatus) {
this.auditStatus = auditStatus;
}
public String getRejectReason() {
return rejectReason;
}
public void setRejectReason(String rejectReason) {
this.rejectReason = rejectReason;
}
public String getAuditPerson() {
return auditPerson;
}
public void setAuditPerson(String auditPerson) {
this.auditPerson = auditPerson;
}
public Date getAuditTime() {
return auditTime;
}
public void setAuditTime(Date auditTime) {
this.auditTime = auditTime;
}
public Date getCreTime() {
return creTime;
}
public void setCreTime(Date creTime) {
this.creTime = creTime;
}
public String getCrePerson() {
return crePerson;
}
public void setCrePerson(String crePerson) {
this.crePerson = crePerson;
}
public Date getUptTime() {
return uptTime;
}
public void setUptTime(Date uptTime) {
this.uptTime = uptTime;
}
public String getUptPerson() {
return uptPerson;
}
public void setUptPerson(String uptPerson) {
this.uptPerson = uptPerson;
}
public String getDelFlag() {
return delFlag;
}
public void setDelFlag(String delFlag) {
this.delFlag = delFlag;
}
public String getLinkman() {
return linkman;
}
public void setLinkman(String linkman) {
this.linkman = linkman;
}
}
\ No newline at end of file
package com.jz.manage.moduls.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
......@@ -23,69 +24,95 @@ public class MallCustomer implements Serializable {
/**
* 用户id
*/
@TableId(value = "customer_id", type = IdType.AUTO)
@TableId(value = "customer_id",type = IdType.AUTO)
private Long customerId;
/**
* 企业id
*/
@TableField(value = "department_id")
private Long departmentId;
/**
* 密码
*/
@TableField(value = "password")
private String password;
/**
* 账户
*/
@TableField(value = "customer_account")
private String customerAccount;
/**
* 用户真实姓名
*/
@TableField(value = "customer_name")
private String customerName;
/**
* 联系电话
*/
@TableField(value = "customer_phone")
private String customerPhone;
/**
* 邮箱
*/
@TableField(value = "customer_email")
private String customerEmail;
/**
* 地址
*/
@TableField(value = "customer_address")
private String customerAddress;
/**
* 供应商编码
*/
@TableField(value = "vendor_id")
private String vendorId;
/**
* 账号来源
*/
@TableField(value = "customer_source")
private String customerSource;
/**
* 用户积分
*/
@TableField(value = "customer_point")
private Long customerPoint;
/**
* 注册时间
*/
@TableField(value = "register_time")
private Date registerTime;
/**
* 会员等级
*/
@TableField(value = "customer_level")
private String customerLevel;
/**
* 证件号
*/
@TableField(value = "identity_card")
private String identityCard;
/**
* 创建时间
*/
@TableField(value = "cre_time")
private Date creTime;
/**
* 创建人
*/
@TableField(value = "upt_person")
private String crePerson;
/**
* 更新时间
*/
@TableField(value = "upt_time")
private Date uptTime;
/**
* 更新人
*/
@TableField(value = "upt_person")
private String uptPerson;
/**
* 删除标识:Y是,N否
*/
@TableField(value = "del_flag")
private String delFlag;
}
\ No newline at end of file
......@@ -34,6 +34,8 @@ public class Order implements Serializable {
* 用户id
*/
private Long customerId;
private Long departmentId;
/**
* 订单状态:01待支付,02已支付,03已取消
*/
......
......@@ -30,7 +30,7 @@ import java.util.Date;
public class SceneCategory implements Serializable {
private static final long serialVersionUID = -6098559795341556267L;
/**
* 商品分类id
* 场景分类id
*/
@TableId(value = "scene_id", type = IdType.AUTO)
@ApiModelProperty(value = "场景分类id")
......
......@@ -26,11 +26,16 @@ public interface DataGoodsCategoryDao extends BaseMapper<DataGoodsCategory> {
/**
* 条件查询分类
* @param categoryName
* @param id
* @return
*/
List<DataGoodsCategory> selectByList(@Param("categoryName") String categoryName);
List<DataGoodsCategory> selectByList(@Param("id") Long id);
CategoryAndSceneDto getCategoryDetail(@Param("categoryId") Long categoryId);
List<DataGoodsCategory> selectByCategory();
List<DataGoodsCategory> selectByList1(@Param("id") Long id);
}
\ No newline at end of file
......@@ -6,9 +6,7 @@ import java.util.List;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jz.common.base.BaseMapper;
import com.jz.manage.moduls.controller.goods.bean.dto.DataGoodsAuditDto;
import com.jz.manage.moduls.controller.goods.bean.dto.DataGoodsDto;
import com.jz.manage.moduls.controller.goods.bean.dto.DataGoodsListDto;
import com.jz.manage.moduls.controller.goods.bean.dto.*;
import com.jz.manage.moduls.entity.DataGoods;
import org.apache.ibatis.annotations.Param;
......@@ -83,4 +81,25 @@ public interface DataGoodsDao extends BaseMapper<DataGoods> {
*/
IPage<DataGoodsListDto> findList(IPage<DataGoodsListDto> pageInfoResponse,@Param("ew")QueryWrapper<DataGoodsListDto> queryWrapper);
/**
* 批量删除商品分类id
* @param list
* @return
*/
int updateByCategory(@Param("list") List<DataGoods> list);
/**
* 查询api制作的商品
* @param list
* @return
*/
List<ApiDataGoodsListDto> selectByApiDataGoodsList(List<ApiDataListDto> list);
/**
* 搜索商品
* @param dataGoodsId
* @return
*/
DataGoods selectByGoodsId(@Param("dataGoodsId") Long dataGoodsId);
}
\ No newline at end of file
......@@ -4,7 +4,11 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jz.common.base.BaseMapper;
import com.jz.common.utils.Result;
import com.jz.manage.moduls.controller.finance.platForm.dto.DepartmentAssetsDto;
import com.jz.manage.moduls.controller.finance.platForm.dto.DepartmentTradeDto;
import com.jz.manage.moduls.controller.finance.platForm.dto.TradeCompanyDetailDto;
import com.jz.manage.moduls.controller.finance.platForm.req.TradeCompanyReq;
import com.jz.manage.moduls.entity.Department;
import com.jz.manage.moduls.controller.customer.bean.dto.CompanyDetailsDto;
import com.jz.manage.moduls.controller.customer.bean.dto.EnterpriseAuditDto;
......@@ -40,4 +44,21 @@ public interface DepartmentDao extends BaseMapper<Department> {
* @return
*/
List<DepartmentAssetsDto> selectByDepartment(@Param("ew")QueryWrapper<DepartmentAssetsDto> query);
/**
* 企业交易记录-条件查询
* @param page
* @param
* @return
*/
IPage<DepartmentTradeDto> selectByTradeCompany(IPage<DepartmentTradeDto> page, @Param("ew") QueryWrapper<DepartmentTradeDto> queryWrapper);
/**
* 企业交易记录-查询详情
* @param departmentId
* @return
*/
List<TradeCompanyDetailDto> tradeCompanyDetail(@Param("departmentId") Long departmentId);
String findUcCodeByGoodsToken(String goodsToken);
}
\ No newline at end of file
......@@ -53,9 +53,11 @@ public interface OrderDao extends BaseMapper<Order> {
/**
*
* @param customerId
* @param departmentId
* @param dataGoodsId
* @return
*/
OrderAndAuthorizedDto isAuthorization(@Param("customerId") Long customerId,@Param("dataGoodsId") Long dataGoodsId);
OrderAndAuthorizedDto isAuthorization(@Param("departmentId") Long departmentId,@Param("dataGoodsId") Long dataGoodsId);
}
\ No newline at end of file
......@@ -64,5 +64,5 @@ public interface DataGoodsCategoryService {
* @param req
* @return
*/
Result deleteByCategory(CategoryAndSceneReq req);
Result deleteByCategory(CategoryAndSceneReq req) throws Exception;
}
\ No newline at end of file
......@@ -69,11 +69,10 @@ public interface DataGoodsService {
/**
* 商品上下级管理
* @param goodsId
* @param statusId
* @return
*/
Result editStatus(Long goodsId, String statusId) throws Exception;
Result editStatus(DataGoodsEditReq req) throws Exception;
/**
* 列表查询审核数据商品
......@@ -143,7 +142,25 @@ public interface DataGoodsService {
*/
Result findByDepartment(DepartmentGoodsReq req);
/**
* 获取制作的商品
* @param req
* @return
*/
Result getDataGoodsNewsList(DataGoodsByMakeReq req);
/**
* 获取数据类型
* @return
*/
Result findByDataTypeList();
/**
* 退回数据到dmp
* @param req
* @return
*/
Result updateSendStatus(ApiInterfaceDetailReq req);
// Result getJoinType(String parentKey);
......
......@@ -5,6 +5,7 @@ import com.jz.common.bean.PageInfoResponse;
import com.jz.common.utils.Result;
import com.jz.manage.moduls.controller.customer.bean.dto.CompanyDetailsDto;
import com.jz.manage.moduls.controller.customer.bean.dto.EnterpriseAuditDto;
import com.jz.manage.moduls.controller.customer.bean.request.CheckDepartmentAuditReq;
import com.jz.manage.moduls.controller.customer.bean.request.DepartmentAuditReq;
import com.jz.manage.moduls.controller.customer.bean.request.EnterpriseAuditRequest;
import com.jz.manage.moduls.controller.customer.bean.request.SaveCustomerRequest;
......@@ -46,4 +47,18 @@ public interface DepartmentService {
* @param saveCustomerRequest
*/
Result add(SaveCustomerRequest saveCustomerRequest, HttpServletRequest req) throws Exception;
/**
* 校验企业是否认证
* @param req
* @return
*/
Result check(CheckDepartmentAuditReq req);
/**
* 通过授权码查税号--调用接口
* @param goodsToken
* @return
*/
Result findUcCodeByGoodsToken(String goodsToken);
}
\ No newline at end of file
......@@ -4,10 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jz.common.utils.Result;
import com.jz.manage.moduls.controller.finance.platForm.dto.BalanceInfoDto;
import com.jz.manage.moduls.controller.finance.platForm.dto.BalanceListDto;
import com.jz.manage.moduls.controller.finance.platForm.req.BalanceAuditRequest;
import com.jz.manage.moduls.controller.finance.platForm.req.BalanceListRequest;
import com.jz.manage.moduls.controller.finance.platForm.req.BalanceQuickReq;
import com.jz.manage.moduls.controller.finance.platForm.req.CashOutQuickReq;
import com.jz.manage.moduls.controller.finance.platForm.req.*;
import javax.servlet.http.HttpServletRequest;
......@@ -63,4 +60,18 @@ public interface FinanceCustomerBalanceService {
* @return
*/
Result searchCompany(String search);
/**
* 企业交易记录-条件查询
* @param req
* @return
*/
Result tradeCompany(TradeCompanyReq req);
/**
* 企业交易记录-主键查询详情
* @return
*/
Result tradeCompanyDetail(Long departmentId);
}
\ No newline at end of file
......@@ -4,7 +4,9 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jz.common.utils.Result;
import com.jz.manage.moduls.controller.order.bean.dto.OrderDetailDto;
import com.jz.manage.moduls.controller.order.bean.dto.OrderDto;
import com.jz.manage.moduls.controller.order.bean.req.ApiInterfaceDetailReq;
import com.jz.manage.moduls.controller.order.bean.req.OrderRequest;
import com.jz.manage.moduls.controller.order.bean.req.SaltResetReq;
import javax.servlet.http.HttpServletRequest;
......@@ -31,5 +33,20 @@ public interface OrderService {
* @return
* @throws Exception
*/
OrderDetailDto queryOrderDetail(String orderId) throws Exception;
Result queryOrderDetail(String orderId) throws Exception;
/**
* 重置盐值
* @param req
* @return
*/
Result updateSalt(SaltResetReq req);
/**
* apikey获取接口文档
* @param req
* @return
*/
Result getOrderApiDetail(ApiInterfaceDetailReq req);
}
\ No newline at end of file
......@@ -71,7 +71,7 @@ public class DataGoodsApiServiceImpl implements DataGoodsApiService {
@Autowired
private RedisTemplate redisTemplate;
@Value("${domain.updateAuthRenew}")
@Value("${gateway.updateAuthRenew}")
private String updateAuthRenew;
/**
......
......@@ -19,10 +19,12 @@ import com.jz.manage.moduls.controller.goods.bean.request.AddCateGoryReq;
import com.jz.manage.moduls.controller.goods.bean.request.CategoryAndSceneReq;
import com.jz.manage.moduls.controller.goods.bean.request.CategoryDetailReq;
import com.jz.manage.moduls.controller.goods.bean.request.DataGoodsByCategoryReq;
import com.jz.manage.moduls.entity.DataGoods;
import com.jz.manage.moduls.entity.DataGoodsCategory;
import com.jz.manage.moduls.entity.SceneCategory;
import com.jz.manage.moduls.entity.SceneGoodsCategory;
import com.jz.manage.moduls.mapper.DataGoodsCategoryDao;
import com.jz.manage.moduls.mapper.DataGoodsDao;
import com.jz.manage.moduls.mapper.SceneCategoryDao;
import com.jz.manage.moduls.mapper.SceneGoodsCategoryDao;
import com.jz.manage.moduls.service.DataGoodsCategoryService;
......@@ -57,6 +59,9 @@ public class DataGoodsCategoryServiceImpl implements DataGoodsCategoryService {
@Autowired
private SceneGoodsCategoryDao sceneGoodsCategoryDao;
@Autowired
private DataGoodsDao dataGoodsDao;
@Autowired
private RedisTemplate redisTemplate;
......@@ -68,9 +73,7 @@ public class DataGoodsCategoryServiceImpl implements DataGoodsCategoryService {
@Override
public Result<List<DataGoodsCategory>> findByCategory() {
//1、查出所有分类
QueryWrapper<DataGoodsCategory> query = new QueryWrapper<>();
query.eq("del_flag", DelFlagEnum.NO.getValue());
List<DataGoodsCategory> entities = categoryDao.selectList(query);
List<DataGoodsCategory> entities = categoryDao.selectByCategory();
// 找到所有的一级分类
List<DataGoodsCategory> level1Menus = entities.stream().filter(categoryEntity ->
categoryEntity.getParentId() == 0 && categoryEntity.getIfChild().equals("N")
......@@ -119,23 +122,32 @@ public class DataGoodsCategoryServiceImpl implements DataGoodsCategoryService {
@Override
@Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRES_NEW)
public Result addCategory(AddCateGoryReq req) throws Exception {
QueryWrapper<DataGoodsCategory> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("category_name", req.getCategoryName());
queryWrapper.eq("del_flag",DelFlagEnum.NO.getValue());
DataGoodsCategory goodsCategory = categoryDao.selectOne(queryWrapper);
if (goodsCategory != null) {
return Result.of_error("同一分类层级已存在相同的分类名称,请填写其他分类名称");
}
DataGoodsCategory category = new DataGoodsCategory();
category.setCategoryName(req.getCategoryName());
// 添加子级分类
if (req.getCategoryId() != null) {
category.setParentId(req.getCategoryId());
category.setIfChild(YNEnum.YES.getValue());
QueryWrapper<DataGoodsCategory> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("parent_id", req.getCategoryId());
queryWrapper.eq("category_name", req.getCategoryName());
queryWrapper.eq("del_flag",DelFlagEnum.NO.getValue());
DataGoodsCategory goodsCategory = categoryDao.selectOne(queryWrapper);
if (goodsCategory != null) {
return Result.of_error("同一分类层级已存在相同的分类名称,请填写其他分类名称");
}
}else {
// 添加一级分类
category.setParentId(0L);
category.setIfChild(YNEnum.NO.getValue());
QueryWrapper<DataGoodsCategory> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("parent_id", "0");
queryWrapper.eq("category_name", req.getCategoryName());
queryWrapper.eq("del_flag",DelFlagEnum.NO.getValue());
DataGoodsCategory goodsCategory = categoryDao.selectOne(queryWrapper);
if (goodsCategory != null) {
return Result.of_error("同一分类层级已存在相同的分类名称,请填写其他分类名称");
}
}
category.setCreTime(DateUtils.getToday());
category.setCrePerson(getUserId()+ "");
......@@ -213,16 +225,57 @@ public class DataGoodsCategoryServiceImpl implements DataGoodsCategoryService {
if (StringUtils.isEmpty(search)) {
return findByCategory();
}
List<DataGoodsCategory> entities = categoryDao.selectByList(search);
// 找到所有的一级分类
List<DataGoodsCategory> level1Menus = entities.stream().filter(categoryEntity ->
categoryEntity.getParentId() == 0 && categoryEntity.getIfChild().equals("N")
).map((menu)->{
menu.setChildren(getChildrens(menu,entities));
return menu;
}).collect(Collectors.toList());
return Result.of_success(ResultMsg.SUCCESS, level1Menus);
// 模糊查询返回所有id和名字
QueryWrapper<DataGoodsCategory> queryWrapper = new QueryWrapper<>();
queryWrapper.like("category_name",search);
queryWrapper.eq("del_flag",DelFlagEnum.NO.getValue());
List<DataGoodsCategory> list = categoryDao.selectList(queryWrapper);
if (list != null) {
Map<Long, DataGoodsCategory> dicMap = new HashMap<>();
for (DataGoodsCategory dataGoodsCategory : list) {
Long id = dataGoodsCategory.getCategoryId();
List<DataGoodsCategory> entities = categoryDao.selectByList(id);
entities.forEach(x->{
dicMap.put(x.getCategoryId(),x);
});
}
List<DataGoodsCategory> entities = dicMap.entrySet().parallelStream().map(x->{
return x.getValue();
}).collect(Collectors.toList());
// 找到所有的一级分类
List<DataGoodsCategory> level1Menus = entities.stream().filter(categoryEntity ->
categoryEntity.getParentId() == 0 && categoryEntity.getIfChild().equals("N")
).map((menu)->{
menu.setChildren(getChildrens(menu,entities));
return menu;
}).collect(Collectors.toList());
return Result.of_success(ResultMsg.SUCCESS, level1Menus);
}
return Result.of_error(ResultMsg.DATA_NOT_FOUND);
//
// if (StringUtils.isEmpty(search)) {
// return findByCategory();
// }
// QueryWrapper<DataGoodsCategory> queryWrapper = new QueryWrapper<>();
// queryWrapper.like("category_name",search);
// queryWrapper.eq("del_flag",DelFlagEnum.NO.getValue());
// List<DataGoodsCategory> list = categoryDao.selectList(queryWrapper);
// if (list != null) {
// for (DataGoodsCategory dataGoodsCategory : list) {
// List<DataGoodsCategory> entities = categoryDao.selectByList(dataGoodsCategory.getCategoryName());
// // 找到所有的一级分类
// List<DataGoodsCategory> level1Menus = entities.stream().filter(categoryEntity ->
// categoryEntity.getParentId() == 0 && categoryEntity.getIfChild().equals("N")
// ).map((menu)->{
// menu.setChildren(getChildrens(menu,entities));
// return menu;
// }).collect(Collectors.toList());
// return Result.of_success(ResultMsg.SUCCESS, level1Menus);
// }
// }
// return Result.of_error(ResultMsg.DATA_NOT_FOUND);
}
/**
......@@ -247,7 +300,17 @@ public class DataGoodsCategoryServiceImpl implements DataGoodsCategoryService {
* @return
*/
@Override
public Result deleteByCategory(CategoryAndSceneReq req) {
@Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRES_NEW)
public Result deleteByCategory(CategoryAndSceneReq req) throws Exception{
//
QueryWrapper<DataGoodsCategory> queryWrapperList = new QueryWrapper<>();
queryWrapperList.eq("parent_id", req.getCategoryId());
queryWrapperList.eq("del_flag",DelFlagEnum.NO.getValue());
queryWrapperList.eq("if_child", YNEnum.YES.getValue());
List<DataGoodsCategory> result = categoryDao.selectList(queryWrapperList);
if (result.size() != 0) {
return Result.of_error("该分类下存在子分类不允许删除");
}
// 删除category
DataGoodsCategory category = new DataGoodsCategory();
category.setCategoryId(req.getCategoryId());
......@@ -255,6 +318,14 @@ public class DataGoodsCategoryServiceImpl implements DataGoodsCategoryService {
if (categoryDao.updateById(category) != 1) {
return Result.of_error(ResultMsg.DELETE_FAIL);
}
// 删除商品关联的分类
QueryWrapper query = new QueryWrapper();
query.eq("category_id", req.getCategoryId());
query.eq("del_flag", DelFlagEnum.NO.getValue());
List<DataGoods> list = dataGoodsDao.selectList(query);
if (list.size() != 0) {
dataGoodsDao.updateByCategory(list);
}
// 删除category-scene中间表
if (req.getSceneId() != null) {
QueryWrapper<SceneGoodsCategory> queryWrapper = new QueryWrapper();
......
package com.jz.manage.moduls.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
......@@ -38,10 +39,8 @@ import org.springframework.web.bind.annotation.CrossOrigin;
import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
/**
......@@ -84,16 +83,25 @@ public class DataGoodsServiceImpl implements DataGoodsService {
//@Autowired
//private HttpsUtils httpsUtils;
@Value("${domain.gatewayGetAuth}")
@Value("${gateway.gatewayGetAuth}")
private String gatewayGetAuth;
@Value("${domain.apigateway}")
@Value("${gateway.apigateway}")
private String apiGateway;
@Value("${domain.updateSendStatus}")
@Value("${gateway.updateSendStatus}")
private String updateSendStatus;
@Value("${gateway.getApiTypeList}")
private String getApiTypeList;
@Value("${gateway.getApiDetail}")
private String getApiDetail;
@Value("${gateway.listSendDataBank}")
private String listSendDataBank;
/**
* 条件分页查询数据列表
*
......@@ -108,7 +116,7 @@ public class DataGoodsServiceImpl implements DataGoodsService {
QueryWrapper<DataGoodsListDto> queryWrapper = new QueryWrapper<>();
//数据商品id
if (StringUtils.isNotBlank(goodsListRequest.getSearch())) {
queryWrapper.and(wrapper -> wrapper.like("t1.dataName", goodsListRequest.getSearch()));
queryWrapper.like("t1.data_name", goodsListRequest.getSearch());
}
//数据状态:01预售,02在售中,03下架,04上架
......@@ -119,19 +127,26 @@ public class DataGoodsServiceImpl implements DataGoodsService {
String startTime = goodsListRequest.getCreTime().substring(0, 10) + " 00:00:00";
String endTime = goodsListRequest.getCreTime().substring(11, 21) + " 23:59:59";
queryWrapper.between("t1.cre_time", startTime, endTime);
queryWrapper.orderByDesc("t1.cre_time");
}
if (StringUtils.isNotBlank(goodsListRequest.getUptTime())) {
String startTime = goodsListRequest.getUptTime().substring(0, 10) + " 00:00:00";
String endTime = goodsListRequest.getUptTime().substring(11, 21) + " 23:59:59";
queryWrapper.between("t1.upt_time", startTime, endTime);
queryWrapper.orderByDesc("t1.upt_time");
}
queryWrapper.eq("t1.del_flag", "N");
queryWrapper.orderByDesc("t1.cre_time");
IPage<DataGoodsListDto> list = dataGoodsDao.findList(pageInfoResponse, queryWrapper);
if (list.getTotal() == 0) {
return Result.of_error("请制作商品!");
}
for (DataGoodsListDto record : list.getRecords()) {
if (record.getGoodsState().equals("02") && record.getDataStatus().equals("04")) {
DataGoods dataGoods = new DataGoods();
dataGoods.setDataGoodsId(record.getDataGoodsId());
dataGoods.setDataStatus("03");
dataGoodsDao.updateById(dataGoods);
}
}
return Result.of_success(list);
}
......@@ -218,39 +233,31 @@ public class DataGoodsServiceImpl implements DataGoodsService {
/**
* 商品上下架
*
* @param goodsId
* @param statusId
*/
@Override
public Result editStatus(Long goodsId, String statusId) throws Exception {
public Result editStatus(DataGoodsEditReq req) throws Exception {
// 获取用户信息
SysUserDto sysUserDto = (SysUserDto) redisTemplate.opsForValue().get("USER_" + RedisMessageConstant.SENDTYPE_LOGIN_SYS);
// 获取商品的信息
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.eq("data_goods_id", goodsId);
queryWrapper.eq("data_goods_id", req.getDataGoodsId());
queryWrapper.eq("del_flag", "N");
DataGoods dataGoods = dataGoodsDao.selectOne(queryWrapper);
if (dataGoods == null) {
return Result.of_error("查询失败!");
}
// 查询当前商品是否在使用
DataAndOrderDto dataAndOrderDto = orderDao.selectByGoods(goodsId);
//商品没有在使用
if (StringUtils.isNotBlank(dataAndOrderDto.getOrderState()) && dataAndOrderDto.getOrderTotal() != 0) {
return Result.of_error("商品在使用,不能修改!");
}
// 商品失效
if (StringUtils.isNotEmpty(dataAndOrderDto.getOrderState()) && dataAndOrderDto.getOrderState().equals("1")) {
return Result.of_error("商品在使用,不能修改!");
}
DataAndOrderDto dataAndOrderDto = orderDao.selectByGoods(req.getDataGoodsId());
// 上架
if ("01".equals(statusId)) {
if ("01".equals(req.getStatusId())) {
// 商品失效
if (dataAndOrderDto.getOrderState().equals("02")) {
return Result.of_error("该商品已失效,请修改商品信息或选择其他商品!");
}
if (dataGoods.getDataStatus().equals(DataStatusEnum.SJ.getValue())) {
return Result.of_error("商品已上架,无需上架!");
}
dataGoods.setDataGoodsId(goodsId);
dataGoods.setDataGoodsId(req.getDataGoodsId());
dataGoods.setDataStatus(DataStatusEnum.SJ.getValue());
dataGoods.setUptPerson(sysUserDto.getUserId() + "");
dataGoods.setUptTime(DateUtils.getToday());
......@@ -260,11 +267,15 @@ public class DataGoodsServiceImpl implements DataGoodsService {
return Result.of_success(ResultMsg.UPDATE_SUCCESS);
}
// 下架
if ("02".equals(statusId)) {
if ("02".equals(req.getStatusId())) {
//商品在使用
if (dataAndOrderDto.getOrderState().equals("01") && dataAndOrderDto.getOrderTotal() != 0) {
return Result.of_error("有企业正常使用此商品,暂不允许下架!");
}
if (dataGoods.getDataStatus().equals(DataStatusEnum.XJ.getValue())) {
return Result.of_error("商品已下架,无需下架!");
}
dataGoods.setDataGoodsId(goodsId);
dataGoods.setDataGoodsId(req.getDataGoodsId());
dataGoods.setDataStatus(DataStatusEnum.XJ.getValue());
dataGoods.setUptPerson(sysUserDto.getUserId() + "");
dataGoods.setUptTime(DateUtils.getToday());
......@@ -371,12 +382,28 @@ public class DataGoodsServiceImpl implements DataGoodsService {
*/
@Override
public Result getAPIList(SendDataReq req) {
String s = HttpsUtilsTest.submitPost("http://127.0.0.1:8088/api/interface/listSendDataBank", JSON.toJSONString(req));
String s = HttpsUtilsTest.submitPost(listSendDataBank, JSON.toJSONString(req));
JSONObject params = JSONObject.parseObject(s);
if (!params.get("code").equals(200) || org.springframework.util.StringUtils.isEmpty(params.get("data"))) {
return Result.of_error("获取api列表失败!");
}
return Result.of_success(params.get("data"));
JSONObject dataParams = JSONObject.parseObject(params.getString("data"));
JSONArray array = dataParams.getJSONArray("records");
List<ApiDataListDto> list = JSONObject.parseArray(array.toJSONString(), ApiDataListDto.class);
// if (list != null) {
// List<ApiDataGoodsListDto> apiDataGoodsListDtos = dataGoodsDao.selectByApiDataGoodsList(list);
// Map<String, List<ApiDataGoodsListDto>> collect = apiDataGoodsListDtos.stream().collect(Collectors.groupingBy(ApiDataGoodsListDto::getApiKey));
// for (Map.Entry<String, List<ApiDataGoodsListDto>> entry : collect.entrySet()) {
// for (ApiDataListDto apiDataListDto : list) {
// if (entry.getKey().equals(apiDataListDto.getApiKey())) {
// apiDataListDto.setChildren(entry.getValue());
// }
// }
// }
// }
// return null;
return Result.of_success(list);
}
/**
......@@ -387,13 +414,14 @@ public class DataGoodsServiceImpl implements DataGoodsService {
*/
@Override
public Result getApiInterfaceDetail(ApiInterfaceDetailReq req) {
String s = HttpsUtilsTest.submitPost("http://127.0.0.1:8088/api/interface/getApiInterfaceDetail", JSON.toJSONString(req));
String s = HttpsUtilsTest.submitPost(getApiDetail, JSON.toJSONString(req));
JSONObject params = JSONObject.parseObject(s);
if (!params.get("code").equals(200) || org.springframework.util.StringUtils.isEmpty(params.get("data"))) {
return Result.of_error("获取api详情失败!");
}
DataDetailsDto dataDetailsDto = JSONObject.parseObject(params.getString("data"), DataDetailsDto.class);
return Result.of_success(params.get("data"));
return Result.of_success(dataDetailsDto);
}
/**
......@@ -558,7 +586,6 @@ public class DataGoodsServiceImpl implements DataGoodsService {
return Result.ok(dataGoods);
}
return Result.of_error("商品未上架,无效!");
}
/**
......@@ -574,7 +601,7 @@ public class DataGoodsServiceImpl implements DataGoodsService {
return Result.of_error("用户没关联企业,支付失败!");
}
// 校验商品是否已授权
OrderAndAuthorizedDto dto = orderDao.isAuthorization(req.getCustomerId(),req.getDataGoodsId());
OrderAndAuthorizedDto dto = orderDao.isAuthorization(req.getDepartmentId(),req.getDataGoodsId());
if (dto != null && dto.getGoodsState().equals("01")) {
return Result.of_error("该企业已经有该商品的使用授权,请选择其他企业进行授权!");
}
......@@ -582,18 +609,18 @@ public class DataGoodsServiceImpl implements DataGoodsService {
// 获取授权
Result authorization = getAuthorization(req);
if (!authorization.isSuccess()) {
return Result.of_success("获取授权失败!");
throw ResponseException.of_error("获取授权失败!");
}
// 新增订单关系表:订单表,订单支付表,订单商品表
Result result = addOrder(req);
if (!result.isSuccess()) {
return Result.of_success("新增订单关系表失败!");
throw ResponseException.of_error("新增订单关系表失败!");
}
Order order = (Order) result.getData();
// 修改企业资产关系表:资产表,新增记录
Result params = uptAssets(req, order);
if (!params.isSuccess()) {
return Result.of_success("修改企业资产关系表失败!");
throw ResponseException.of_error("修改企业资产关系表失败!");
}
Map<String, String> map = (Map) params.getData();
return Result.of_success(ResultMsg.SUCCESS,map);
......@@ -611,31 +638,90 @@ public class DataGoodsServiceImpl implements DataGoodsService {
QueryWrapper<DepartmentAssetsDto> query = new QueryWrapper();
// 使用授权时搜索企业
if (StringUtils.isNotEmpty(req.getSearch())) {
query.and(wrapper -> wrapper.like("t1.department_name", req.getSearch()));
query.like("t1.department_name", req.getSearch());
}
// 续费时搜索企业
if (req.getDepartmentId() != null && req.getDataGoodsId() != null) {
if (req.getDepartmentId() != null ) {
query.eq("t1.department_id", req.getDepartmentId());
query.eq("t6.data_goods_id", req.getDataGoodsId());
}
query.eq("t1.del_flag", DelFlagEnum.NO.getValue());
query.groupBy("t1.department_id");
List<DepartmentAssetsDto> department = departmentDao.selectByDepartment(query);
if (department.size() != 0) {
QueryWrapper<DataGoods> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("data_goods_id", req.getDataGoodsId());
queryWrapper.eq("del_flag", DelFlagEnum.NO.getValue());
DataGoods dataGoods = dataGoodsDao.selectOne(queryWrapper);
for (DepartmentAssetsDto departmentAssetsDto : department) {
departmentAssetsDto.setYearType(dataGoods.getYearType().toString());
departmentAssetsDto.setSeasonType(dataGoods.getSeasonType().toString());
departmentAssetsDto.setMonthType(dataGoods.getMonthType().toString());
departmentAssetsDto.setSecondType(dataGoods.getSecondType().toString());
}
return Result.of_success(ResultMsg.SUCCESS, department);
return Result.of_success(department);
}
return Result.of_success(ResultMsg.DATA_NOT_FOUND);
}
/**
* 获取制作的商品
*
* @param req
* @return
*/
@Override
public Result getDataGoodsNewsList(DataGoodsByMakeReq req) {
IPage<DataGoods> page = new Page<>(req.getPageNum(), req.getPageSize());
QueryWrapper<DataGoods> queryWrapper = new QueryWrapper<>();
if (StringUtils.isNotBlank(req.getDataName())) {
queryWrapper.like("data_name", req.getDataName());
}
if (req.getDataStatus() != null) {
queryWrapper.eq("data_status", req.getDataStatus());
}
queryWrapper.eq("api_key", req.getApiKey());
queryWrapper.eq("del_flag", DelFlagEnum.NO.getValue());
IPage<DataGoods> dataGoodsIPage = dataGoodsDao.selectPage(page, queryWrapper);
if (dataGoodsIPage != null) {
return Result.ok(dataGoodsIPage);
}
return Result.of_error(ResultMsg.DATA_NOT_FOUND);
}
/**
* 获取数据类型
*
* @return
*/
@Override
public Result findByDataTypeList() {
Map<String, String> map = new HashMap<>();
map.put("parentKey", "10006");
String get = HttpsUtilsTest.doGet(getApiTypeList, map);
JSONObject params = JSONObject.parseObject(get);
if (!params.get("code").equals(200) || org.springframework.util.StringUtils.isEmpty(params.get("data"))) {
return Result.of_error("获取api详情失败!");
}
return Result.ok(params.get("data"));
}
/**
* 退回数据到dmp
*
* @param req
* @return
*/
@Override
public Result updateSendStatus(ApiInterfaceDetailReq req) {
QueryWrapper<DataGoods> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("api_key", req.getApiKey());
queryWrapper.eq("data_status", DataStatusEnum.SJ.getValue());
queryWrapper.eq("del_flag", DelFlagEnum.NO.getValue());
List<DataGoods> dataGoods = dataGoodsDao.selectList(queryWrapper);
if (dataGoods.size() != 0) {
return Result.of_error("已被制作成商品或者商品未下架!");
}
Map<String, String> map = new HashMap<>();
map.put("apiKey", req.getApiKey());
String get = HttpsUtilsTest.doGet(updateSendStatus, map);
JSONObject params = JSONObject.parseObject(get);
if (!params.get("code").equals(200)) {
return Result.of_error("获取api详情失败!");
}
return Result.of_success(ResultMsg.SUCCESS,params.get("data"));
}
/**
......@@ -741,6 +827,7 @@ public class DataGoodsServiceImpl implements DataGoodsService {
// 新增订单主表
Order order = new Order();
order.setCustomerId(payReq.getCustomerId());
order.setDepartmentId(payReq.getDepartmentId());
order.setOrderMoney(payReq.getDataPrice());
order.setOrderStatus(OrderStatusEnum.YZF.getValue());
order.setPaymentMoney(payReq.getDataPrice());
......@@ -750,15 +837,16 @@ public class DataGoodsServiceImpl implements DataGoodsService {
order.setSellerId(getUserId()); //
// order.setDistrictMoney(); //TODO 优惠金额
order.setTakeEffectTime(order.getOrderTime());
order.setInvalidTime(payReq.getInvalidTime());
order.setApiKey(payReq.getApiKey());
//处理生效期
Date time = getTime(payReq);
if (time != null) {
order.setInvalidTime(time);
}
// Date time = getTime(payReq);
// if (time != null) {
// order.setInvalidTime(time);
// }
order.setPurchaseMethod(payReq.getPurchaseMethod());
order.setPriceType(payReq.getPriceType());
order.setCrePerson(payReq.getCustomerId() + "");
order.setCrePerson(payReq.getDepartmentId() + "");
order.setCreTime(DateUtils.getToday());
order.setDelFlag(DelFlagEnum.NO.getValue());
if (orderDao.insert(order) != 1) {
......@@ -768,6 +856,7 @@ public class DataGoodsServiceImpl implements DataGoodsService {
// 新增订单支付表/订单商品表
if (order.getOrderId() != null) {
OrderPayment orderPayment = new OrderPayment();
orderPayment.setOrderId(order.getOrderId());
orderPayment.setSellerId(getUserId()); // TODO
orderPayment.setPaymentMoney(payReq.getDataPrice());
orderPayment.setPaymentTime(DateUtils.getToday());
......@@ -776,7 +865,7 @@ public class DataGoodsServiceImpl implements DataGoodsService {
orderPayment.setPaymentStatus(order.getOrderStatus());
orderPayment.setPurchaseMethod(payReq.getPurchaseMethod());
orderPayment.setCreTime(DateUtils.getToday());
orderPayment.setCrePerson(payReq.getCustomerId()+"");
orderPayment.setCrePerson(payReq.getDepartmentId()+"");
orderPayment.setDelFlag(DelFlagEnum.NO.getValue());
if (orderPaymentDao.insert(orderPayment) != 1) {
throw ResponseException.of_error("新增订单支付表失败!");
......@@ -787,7 +876,7 @@ public class DataGoodsServiceImpl implements DataGoodsService {
goodsInfo.setOrderId(order.getOrderId());
goodsInfo.setDataGoodsId(payReq.getDataGoodsId());
goodsInfo.setCreTime(DateUtils.getToday());
goodsInfo.setCrePerson(payReq.getCustomerId()+"");
goodsInfo.setCrePerson(payReq.getDepartmentId()+"");
goodsInfo.setDelFlag(DelFlagEnum.NO.getValue());
// 新增
if (goodsInfoDao.insert(goodsInfo) != 1) {
......@@ -810,15 +899,16 @@ public class DataGoodsServiceImpl implements DataGoodsService {
// 可用金额减去支付金额
BigDecimal bigDecimal = new BigDecimal(assets.getUseMoney()+ "");
BigDecimal bigDecima2 = new BigDecimal(req.getDataPrice()+ "");
if (bigDecimal.compareTo(bigDecima2) == -1){
return Result.error("金额不足!请充值!");
}
BigDecimal subtract = bigDecimal.subtract(bigDecima2);
// if (bigDecimal.compareTo(bigDecima2) == -1){
// return Result.error("金额不足!请充值!");
// }
// BigDecimal subtract = bigDecimal.subtract(bigDecima2);
BigDecimal subtract = BigDecimal.ZERO;
// 修改金额
assets.setUseMoney(subtract);
assets.setTotalMoney(subtract);
assets.setUptTime(DateUtils.getToday());
assets.setUptPerson(req.getCustomerId()+ "");
assets.setUptPerson(req.getDepartmentId()+ "");
if (financeCustomerAssetsDao.updateById(assets) != 1) {
throw ResponseException.of_error("修改资产金额失败!");
}
......@@ -830,8 +920,8 @@ public class DataGoodsServiceImpl implements DataGoodsService {
order.setGoodsToken(map.get("authCode"));
order.setSaltValue(map.get("salt"));
order.setUptTime(DateUtils.getToday());
order.setOrderNumber(NumberUtils.getOrderNumber(req.getCustomerId()+""));
order.setUptPerson(req.getCustomerId() + "");
order.setOrderNumber(NumberUtils.getOrderNumber(req.getDepartmentId()+""));
order.setUptPerson(req.getDepartmentId() + "");
if (orderDao.updateById(order) != 1) {
throw ResponseException.of_error("修改订单盐值失败!");
}
......@@ -846,7 +936,7 @@ public class DataGoodsServiceImpl implements DataGoodsService {
flow.setTradeMoney(req.getDataPrice());
flow.setTradeType(TradeFlowEnum.FK.getValue());
flow.setCreTime(DateUtils.getToday());
flow.setCrePerson(req.getCustomerId() + "");
flow.setCrePerson(req.getDepartmentId() + "");
flow.setTradeFlowNumber(NumberUtils.getDealNum());
flow.setDelFlag(DelFlagEnum.NO.getValue());
if (financeTradeFlowDao.insert(flow) != 1) {
......
......@@ -7,12 +7,15 @@ import com.jz.common.bean.SysUserDto;
import com.jz.common.constant.RedisMessageConstant;
import com.jz.common.constant.ResultCode;
import com.jz.common.constant.ResultMsg;
import com.jz.common.enums.AuditStatusEnum;
import com.jz.common.enums.DelFlagEnum;
import com.jz.common.exception.ResponseException;
import com.jz.common.utils.DateUtils;
import com.jz.common.utils.NumberUtils;
import com.jz.common.utils.Result;
import com.jz.manage.moduls.controller.customer.bean.dto.CompanyDetailsDto;
import com.jz.manage.moduls.controller.customer.bean.dto.EnterpriseAuditDto;
import com.jz.manage.moduls.controller.customer.bean.request.CheckDepartmentAuditReq;
import com.jz.manage.moduls.controller.customer.bean.request.DepartmentAuditReq;
import com.jz.manage.moduls.controller.customer.bean.request.EnterpriseAuditRequest;
import com.jz.manage.moduls.controller.customer.bean.request.SaveCustomerRequest;
......@@ -30,6 +33,7 @@ import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
......@@ -73,25 +77,25 @@ public class DepartmentServiceImpl implements DepartmentService {
IPage<EnterpriseAuditDto> page = new Page<>(auditRequest.getPageNum(), auditRequest.getPageSize());
QueryWrapper<EnterpriseAuditDto> query = new QueryWrapper();
if (org.apache.commons.lang3.StringUtils.isNotBlank(auditRequest.getSearch())){
query.and(wrapper -> wrapper.like("t1.department_name",auditRequest.getSearch())
.or().like("t1.linkman",auditRequest.getSearch())
if (org.apache.commons.lang3.StringUtils.isNotBlank(auditRequest.getSearch())) {
query.and(wrapper -> wrapper.like("t1.department_name", auditRequest.getSearch())
.or().like("t1.linkman", auditRequest.getSearch())
.or().eq("t1.telephone", auditRequest.getSearch()));
}
if (org.apache.commons.lang3.StringUtils.isNotBlank(auditRequest.getAuditStatus())){
query.eq("t1.audit_status",auditRequest.getAuditStatus());
if (org.apache.commons.lang3.StringUtils.isNotBlank(auditRequest.getAuditStatus())) {
query.eq("t1.audit_status", auditRequest.getAuditStatus());
}
// if (auditRequest.getRoleId() != null){
// query.eq("t4.role_id",auditRequest.getRoleId());
// }
if (org.apache.commons.lang3.StringUtils.isNotBlank(auditRequest.getCreTime())){
if (org.apache.commons.lang3.StringUtils.isNotBlank(auditRequest.getCreTime())) {
String startTime = auditRequest.getCreTime().substring(0, 10) + " 00:00:00";
String endTime = auditRequest.getCreTime().substring(11, 21)+ " 23:59:59";
query.between( "t1.cre_time",startTime, endTime);
String endTime = auditRequest.getCreTime().substring(11, 21) + " 23:59:59";
query.between("t1.cre_time", startTime, endTime);
}
query.eq("t1.del_flag","N");
query.eq("t1.del_flag", "N");
query.orderByDesc("t1.cre_time");
IPage<EnterpriseAuditDto> list= tDepartmentDao.findList(page, query);
IPage<EnterpriseAuditDto> list = tDepartmentDao.findList(page, query);
if (list.getTotal() == 0) {
return Result.of_error("没有待审核的企业!");
}
......@@ -100,13 +104,14 @@ public class DepartmentServiceImpl implements DepartmentService {
/**
* 主键获取用户企业详情信息
*
* @param id
* @return
*/
@Override
public Result selectById(Long id) {
CompanyDetailsDto companyDetails = tDepartmentDao.selectById(id);
if (companyDetails == null){
if (companyDetails == null) {
return Result.of_success("查询失败!");
}
return Result.of_success(ResultMsg.SUCCESS, companyDetails);
......@@ -118,35 +123,41 @@ public class DepartmentServiceImpl implements DepartmentService {
* @param req
*/
@Override
public Result audit(DepartmentAuditReq req) {
public Result audit(DepartmentAuditReq req) {
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.eq("department_id", req.getDepartmentId());
queryWrapper.eq("del_flag", "N");
queryWrapper.eq("unified_credit_code", req.getUnifiedCreditCode());
queryWrapper.eq("del_flag", DelFlagEnum.NO.getValue());
// 获取企业详细信息
Department department = tDepartmentDao.selectOne(queryWrapper);
// 从session获取平台用户id
SysUserDto sysUser = (SysUserDto) redisTemplate.opsForValue().get("USER_" + RedisMessageConstant.SENDTYPE_LOGIN_SYS);
if (department == null) {
return Result.of_error(ResultMsg.DATA_NOT_FOUND);
}
// 更新信息: 将企业审核状态改为已审核,企业信息更新
if ("01".equals(req.getAuditStatus())) {
// 已通过
department.setAuditStatus("02");
department.setAuditPerson(sysUser.getUserId() + "");
department.setAuditPerson(getUser().getUserId() + "");
department.setAuditTime(DateUtils.getToday());
department.setUptTime(DateUtils.getToday());
department.setUptPerson(sysUser.getUserId()+ "");
tDepartmentDao.updateById(department);
department.setUptPerson(getUser().getUserId() + "");
if (tDepartmentDao.updateById(department) != 1) {
return Result.of_error(ResultMsg.UPDATE_FAIL);
}
return Result.of_success("企业审核已通过!");
}
if ("02".equals(req.getAuditStatus())){
if ("02".equals(req.getAuditStatus())) {
// 未通过
department.setAuditStatus("03");
department.setAuditPerson(sysUser.getUserId() + "");
department.setAuditPerson(getUser().getUserId() + "");
department.setAuditTime(DateUtils.getToday());
department.setUptTime(DateUtils.getToday());
department.setUptPerson(sysUser.getUserId()+ "");
department.setUptPerson(getUser().getUserId() + "");
department.setRejectReason(req.getRejectReason());
tDepartmentDao.updateById(department);
if (tDepartmentDao.updateById(department) != 1) {
return Result.of_error(ResultMsg.UPDATE_FAIL);
}
return Result.of_success("企业审核未通过!");
}
return Result.of_error("审核失败!");
......@@ -168,14 +179,52 @@ public class DepartmentServiceImpl implements DepartmentService {
}
// 保存企业信息
Result result = saveCompany(saveCustomerReq);
Department department = (Department) result.getData();
Department department = (Department) result.getData();
// 保存用户资产信息
saveUserAndAssests(saveCustomerReq, department);
return Result.of_success("添加用户成功!");
}
/**
* 校验企业是否认证
*
* @param req
* @return
*/
@Override
public Result check(CheckDepartmentAuditReq req) {
if (StringUtils.isNotEmpty(req.getUnifiedCreditCode())) {
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.eq("unified_credit_code", req.getUnifiedCreditCode());
queryWrapper.eq("audit_status", AuditStatusEnum.YSH.getValue());
queryWrapper.eq("department_source", "01");
queryWrapper.eq("del_flag", DelFlagEnum.NO.getValue());
Department department = tDepartmentDao.selectOne(queryWrapper);
if (department != null) {
return Result.of_success("该企业已通过认证!");
}
}
return Result.of_error(ResultMsg.DATA_NOT_FOUND);
}
/**
* 通过授权码查税号--调用接口
*
* @param goodsToken
* @return
*/
@Override
public Result findUcCodeByGoodsToken(String goodsToken) {
String unifiedCreditCode = tDepartmentDao.findUcCodeByGoodsToken(goodsToken);
if (unifiedCreditCode == null) {
return Result.of_error(ResultMsg.DATA_NOT_FOUND);
}
return Result.ok(unifiedCreditCode);
}
/**
* 保存企业信息
*
* @param saveCustomerReq
*/
private Result saveCompany(SaveCustomerRequest saveCustomerReq) {
......@@ -191,13 +240,16 @@ public class DepartmentServiceImpl implements DepartmentService {
department.setBusinessLicense(saveCustomerReq.getBusinessLicense());
department.setBankAddress(saveCustomerReq.getBankAddress());
department.setBankCardNumber(saveCustomerReq.getBankCardNumber());
department.setDepartmentSource("01");
// 联系人信息
department.setLinkman(saveCustomerReq.getLinkman());
department.setTelephone(saveCustomerReq.getTelephone());
// 已审核
department.setAuditStatus("02");
department.setAuditTime(DateUtils.getToday());
department.setCreTime(DateUtils.getToday());
department.setAuditTime(department.getCreTime());
if (tDepartmentDao.insert(department) != 1) {
throw ResponseException.of_error("企业添加失败!");
}
......@@ -219,60 +271,63 @@ public class DepartmentServiceImpl implements DepartmentService {
mallCustomer.setPassword(saveCustomerReq.getPassword());
mallCustomer.setCreTime(DateUtils.getToday());
mallCustomer.setCustomerPoint(0L);
mallCustomer.setCrePerson(getUser().getUserId()+"");
mallCustomer.setCustomerSource("01");
mallCustomer.setCrePerson(getUser().getUserId() + "");
mallCustomer.setDelFlag("N");
mallCustomerDao.insert(mallCustomer);
logger.info("###################企业添加用户:账号信息添加成功!############################");
// 如果充值金额不为空
if (saveCustomerReq.getBalanceMoney() != null) {
// 新增一条企业客户资产
FinanceCustomerAssets assets = new FinanceCustomerAssets();
assets.setCrePerson(mallCustomer.getCustomerId() + "");
if (department.getDepartmentId() != null) {
try {
assets.setDepartmentId(department.getDepartmentId());
// 新增一条企业客户资产
FinanceCustomerAssets assets = new FinanceCustomerAssets();
assets.setCrePerson(mallCustomer.getCustomerId() + "");
if (department.getDepartmentId() != null) {
try {
assets.setDepartmentId(department.getDepartmentId());
if (saveCustomerReq.getBalanceMoney() != null) {
assets.setUseMoney(saveCustomerReq.getBalanceMoney());
assets.setTotalMoney(saveCustomerReq.getBalanceMoney());
assets.setCreTime(DateUtils.getToday());
assets.setCrePerson(mallCustomer.getCustomerId() + "");
assets.setDelFlag("N");
financeCustomerAssetsDao.insert(assets);
logger.info("###################企业添加用户:企业客户资产添加成功!############################");
}catch (Exception e) {
throw ResponseException.of(ResultCode.FAILURE, "新增企业资产失败!");
}
assets.setCreTime(DateUtils.getToday());
assets.setCrePerson(mallCustomer.getCustomerId() + "");
assets.setDelFlag("N");
financeCustomerAssetsDao.insert(assets);
logger.info("###################企业添加用户:企业客户资产添加成功!############################");
} catch (Exception e) {
throw ResponseException.of(ResultCode.FAILURE, "新增企业资产失败!");
}
// 新增一条充值记录表
// 获取最新的资产id
Long assetsId = assets.getAssetsId();
FinanceCustomerBalance balance = new FinanceCustomerBalance();
FinanceTradeFlow flow = new FinanceTradeFlow();
if (assetsId != null) {
try{
balance.setAssetsId(assetsId);
balance.setBalanceMoney(saveCustomerReq.getBalanceMoney());
balance.setCrePerson(mallCustomer.getCustomerId() + "");
balance.setCreTime(DateUtils.getToday());
balance.setAuditStatus("02");
balance.setDelFlag("N");
if (financeCustomerBalanceDao.insert(balance) != 1) {
throw ResponseException.of(ResultCode.FAILURE, "充值记录添加失败!");
// 如果充值金额不为空
if (saveCustomerReq.getBalanceMoney() != null) {
// 新增一条充值记录表
// 获取最新的资产id
Long assetsId = assets.getAssetsId();
FinanceCustomerBalance balance = new FinanceCustomerBalance();
FinanceTradeFlow flow = new FinanceTradeFlow();
if (assetsId != null) {
try {
balance.setAssetsId(assetsId);
balance.setBalanceMoney(saveCustomerReq.getBalanceMoney());
balance.setCrePerson(mallCustomer.getCustomerId() + "");
balance.setCreTime(DateUtils.getToday());
balance.setAuditStatus("02");
balance.setDelFlag("N");
if (financeCustomerBalanceDao.insert(balance) != 1) {
throw ResponseException.of(ResultCode.FAILURE, "充值记录添加失败!");
}
logger.info("###################企业添加用户:充值记录添加成功!############################");
flow.setAssetsId(assetsId);
flow.setCustomerBalanceId(balance.getCustomerBalanceId());
flow.setTradeFlowNumber(NumberUtils.getDealNum());
flow.setTradeMoney(saveCustomerReq.getBalanceMoney());
flow.setTradeType("02");
flow.setBalanceMoney(assets.getUseMoney());
flow.setCreTime(DateUtils.getToday());
flow.setCrePerson(getUser().getUserId() + "");
flow.setDelFlag("N");
financeTradeFlowDao.insert(flow);
logger.info("###################企业添加用户:企业客户交易流水添加成功!############################");
} catch (Exception e) {
throw ResponseException.of(ResultCode.FAILURE, "新增充值记录/企业客户交易流水失败!");
}
logger.info("###################企业添加用户:充值记录添加成功!############################");
flow.setAssetsId(assetsId);
flow.setCustomerBalanceId(balance.getCustomerBalanceId());
flow.setTradeFlowNumber(NumberUtils.getDealNum());
flow.setTradeMoney(saveCustomerReq.getBalanceMoney());
flow.setTradeType("02");
flow.setBalanceMoney(assets.getUseMoney());
flow.setCreTime(DateUtils.getToday());
flow.setCrePerson(getUser().getUserId()+ "");
flow.setDelFlag("N");
financeTradeFlowDao.insert(flow);
logger.info("###################企业添加用户:企业客户交易流水添加成功!############################");
}catch (Exception e) {
throw ResponseException.of(ResultCode.FAILURE, "新增充值记录/企业客户交易流水失败!");
}
}
}
......@@ -282,12 +337,14 @@ public class DepartmentServiceImpl implements DepartmentService {
/**
* 校验企业/账号是否存在
*
* @param saveCustomerReq
*/
private Result userCheck(SaveCustomerRequest saveCustomerReq) {
// 校验公司是否已存在
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.eq("unified_credit_code", saveCustomerReq.getUnifiedCreditCode());
queryWrapper.eq("department_source", "01");
Department department = tDepartmentDao.selectOne(queryWrapper);
// 如果为空
if (department != null) {
......@@ -297,10 +354,9 @@ public class DepartmentServiceImpl implements DepartmentService {
Map<String, Object> accountMap = new HashMap<>();
accountMap.put("customerAccount", saveCustomerReq.getCustomerAccount());
// 查询用户是否存在
Map mapUser = new HashMap();
if (StringUtils.isNotEmpty(saveCustomerReq.getCustomerAccount())) {
mapUser.put("customerAccount",saveCustomerReq.getCustomerAccount());
mapUser.put("customerAccount", saveCustomerReq.getCustomerAccount());
}
MallCustomer customerUser = mallCustomerDao.selectByUser(mapUser);
if (customerUser != null) {
......@@ -308,7 +364,7 @@ public class DepartmentServiceImpl implements DepartmentService {
}
Map mapPhone = new HashMap();
if (StringUtils.isNotEmpty(saveCustomerReq.getTelephone())) {
mapPhone.put("customerPhone",saveCustomerReq.getTelephone());
mapPhone.put("customerPhone", saveCustomerReq.getTelephone());
}
MallCustomer customerPhone = mallCustomerDao.selectByUser(mapPhone);
if (customerPhone != null) {
......
......@@ -7,18 +7,14 @@ import com.jz.common.bean.SysUserDto;
import com.jz.common.constant.RedisMessageConstant;
import com.jz.common.constant.ResultMsg;
import com.jz.common.enums.AuditStatusEnum;
import com.jz.common.enums.DelFlagEnum;
import com.jz.common.enums.TradeFlowEnum;
import com.jz.common.exception.ResponseException;
import com.jz.common.utils.DateUtils;
import com.jz.common.utils.NumberUtils;
import com.jz.common.utils.Result;
import com.jz.manage.moduls.controller.finance.platForm.dto.BalanceInfoDto;
import com.jz.manage.moduls.controller.finance.platForm.dto.BalanceListDto;
import com.jz.manage.moduls.controller.finance.platForm.dto.DepartmentAssetsDto;
import com.jz.manage.moduls.controller.finance.platForm.req.BalanceAuditRequest;
import com.jz.manage.moduls.controller.finance.platForm.req.BalanceListRequest;
import com.jz.manage.moduls.controller.finance.platForm.req.BalanceQuickReq;
import com.jz.manage.moduls.controller.finance.platForm.req.CashOutQuickReq;
import com.jz.manage.moduls.controller.finance.platForm.dto.*;
import com.jz.manage.moduls.controller.finance.platForm.req.*;
import com.jz.manage.moduls.entity.*;
import com.jz.manage.moduls.mapper.*;
import com.jz.manage.moduls.service.FinanceCustomerBalanceService;
......@@ -359,6 +355,53 @@ public class FinanceCustomerBalanceServiceImpl implements FinanceCustomerBalance
}
return Result.of_error("搜索失败!");
}
/**
* 企业交易记录-条件查询
*
* @param req
* @return
*/
@Override
public Result tradeCompany(TradeCompanyReq req) {
IPage<DepartmentTradeDto> page = new Page<>(req.getPageNum(), req.getPageSize());
QueryWrapper<DepartmentTradeDto> queryWrapper = new QueryWrapper<>();
if (StringUtils.isNotBlank(req.getSearch())) {
queryWrapper.and(s -> s.like("t1.department_name", req.getSearch())
.or().like("t1.linkman", req.getSearch()));
}
if (StringUtils.isNotBlank(req.getTelephone())) {
queryWrapper.like("t1.telephone", req.getTelephone());
}
queryWrapper.eq("t1.del_flag", DelFlagEnum.NO.getValue());
queryWrapper.groupBy("t1.department_id");
queryWrapper.orderByDesc("transactionMoney");
IPage<DepartmentTradeDto> list = departmentDao.selectByTradeCompany(page, queryWrapper);
if (list.getRecords() != null) {
return Result.ok(list);
}
return Result.of_error(ResultMsg.DATA_NOT_FOUND);
}
/**
* 企业交易记录-主键查询详情
*
* @param departmentId
* @return
*/
@Override
public Result tradeCompanyDetail(Long departmentId) {
if (departmentId == null) {
return Result.of_error(ResultMsg.DATA_NOT_FOUND);
}
List<TradeCompanyDetailDto> list = departmentDao.tradeCompanyDetail(departmentId);
if (list == null) {
return Result.of_error(ResultMsg.DATA_NOT_FOUND);
}
return Result.ok(list);
}
/**
* 获取当前用户
* @return
......
package com.jz.manage.moduls.service.impl;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jz.common.bean.MallCustomerApiDto;
import com.jz.common.bean.SysUserDto;
import com.jz.common.constant.RedisMessageConstant;
import com.jz.common.constant.ResultMsg;
import com.jz.common.utils.DateUtils;
import com.jz.common.utils.HttpsUtilsTest;
import com.jz.common.utils.Result;
import com.jz.manage.moduls.controller.order.bean.dto.ApiInterfaceDetailDto;
import com.jz.manage.moduls.controller.order.bean.dto.OrderDetailDto;
import com.jz.manage.moduls.controller.order.bean.dto.OrderDto;
import com.jz.manage.moduls.controller.order.bean.req.ApiInterfaceDetailReq;
import com.jz.manage.moduls.controller.order.bean.req.OrderRequest;
import com.jz.manage.moduls.controller.order.bean.req.SaltResetReq;
import com.jz.manage.moduls.entity.Order;
import com.jz.manage.moduls.mapper.OrderDao;
import com.jz.manage.moduls.service.OrderService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletRequest;
import java.util.*;
/**
* 订单表(TOrder)表服务实现类
......@@ -33,6 +47,12 @@ public class OrderServiceImpl implements OrderService {
@Autowired
private RedisTemplate redisTemplate;
@Value("${gateway.gatewayUpSalt}")
private String gatewayUpSalt;
@Value("${gateway.getApiDetail}")
private String getApiDetail;
/**
* 订单管理列表(分页查询)
* @param req
......@@ -55,11 +75,11 @@ public class OrderServiceImpl implements OrderService {
if (StringUtils.isNotBlank(req.getOrderTime())) {
String startTime = req.getOrderTime().substring(0, 10) + " 00:00:00";
String endTime = req.getOrderTime().substring(11, 21) + " 23:59:59";
query.between("t.order_time", startTime, endTime);
query.between("t.cre_time", startTime, endTime);
}
query.eq("t.del_flag", "N");
query.orderByDesc("t.order_time");
query.orderByDesc("t.cre_time");
IPage<OrderDto> list = orderDao.queryListOrderInfo(page, query);
if (list.getTotal() == 0) {
return Result.of_error("没有订单!");
......@@ -74,7 +94,127 @@ public class OrderServiceImpl implements OrderService {
* @throws Exception
*/
@Override
public OrderDetailDto queryOrderDetail(String orderId) throws Exception {
return orderDao.queryOrderDetail(orderId);
public Result queryOrderDetail(String orderId) throws Exception {
OrderDetailDto orderDetailDto = orderDao.queryOrderDetail(orderId);
if (orderDetailDto != null) {
Date endTime = orderDetailDto.getInvalidTime();
String indate = DateUtils.getTime(endTime, DateUtils.getToday());
orderDetailDto.setIndate(indate);
}
return Result.ok(orderDetailDto);
}
/**
* 重置盐值
*
* @param req
* @return
*/
@Override
public Result updateSalt(SaltResetReq req) {
//调用gatway
JSONObject object = new JSONObject();
object.put("authCode", req.getGoodsToken());
object.put("createUser", getUserId());
String s = HttpsUtilsTest.submitPost(gatewayUpSalt, object.toString());
//处理返回的参数
JSONObject params = JSONObject.parseObject(s);
if (!params.get("code").equals(200) || org.springframework.util.StringUtils.isEmpty(params.get("data"))) {
return Result.error("修改失败!");
}
String data = params.getString("data");
JSONObject dataParam = JSONObject.parseObject(data);
String salt = dataParam.getString("salt");
// 修改参数
Order order = new Order();
order.setSaltValue(salt);
order.setOrderId(req.getId());
order.setUptTime(DateUtils.getToday());
order.setUptPerson(getUserId() + "");
if (orderDao.updateById(order) != 1) {
return Result.of_error(ResultMsg.UPDATE_FAIL);
}
Map map = new HashMap();
map.put("salt", salt);
return Result.of_success(ResultMsg.SUCCESS, salt);
}
/**
* apikey获取接口文档
*
* @param req
* @return
*/
@Override
public Result getOrderApiDetail(ApiInterfaceDetailReq req) {
//调用gatway
JSONObject object = new JSONObject();
object.put("apiKey", req.getApiKey());
String s = HttpsUtilsTest.submitPost(getApiDetail, object.toString());
//处理返回的参数
JSONObject params = JSONObject.parseObject(s);
if (!params.get("code").equals(200) || org.springframework.util.StringUtils.isEmpty(params.get("data"))) {
return Result.error("修改失败!");
}
String data = params.getString("data");
JSONObject dataParam = JSONObject.parseObject(data);
Map<String, Object> map = new HashMap<>();
ApiInterfaceDetailDto apiInterfaceDetailDto = new ApiInterfaceDetailDto();
apiInterfaceDetailDto.setApiKey(dataParam.getString("apiKey"));
apiInterfaceDetailDto.setOutputType(dataParam.getString("outputType"));
apiInterfaceDetailDto.setTargetUrl(dataParam.getString("targetUrl"));
apiInterfaceDetailDto.setReqType(dataParam.getString("reqType"));
map.put("dataInfo", apiInterfaceDetailDto);
// 响应参数
List responseParam = returnParams("responseParam", data);
// 请求参数
List requestParam = returnParams("requestParam", data);
// 固定参数
List inboxParam = returnParams("inboxParam", data);
map.put("responseParam", responseParam);
map.put("requestParam", requestParam);
map.put("inboxParam",inboxParam);
return Result.ok(map);
}
/**
* 封装参数
* @param params
* @param data
* @return
*/
public List returnParams(String params, String data) {
JSONArray list = JSONObject.parseObject(data).getJSONArray(params);
if (list == null) {
return null;
}
List<ApiInterfaceDetailDto> listParams = new ArrayList<>();
for (Object o : list) {
JSONObject result = (JSONObject)o;
ApiInterfaceDetailDto dto = new ApiInterfaceDetailDto();
if (StringUtils.isNotEmpty(result.getString("name"))) {
dto.setParamsName(result.getString("name"));
}
if (StringUtils.isNotEmpty(result.getString("type"))) {
dto.setParamsType(result.getString("type"));
}
if (StringUtils.isNotEmpty(result.getString("defaultValue"))) {
dto.setDefaultValue(result.getString("defaultValue"));
}
if (StringUtils.isNotEmpty(result.getString("desc"))) {
dto.setParamsDesc(result.getString("desc"));
}
listParams.add(dto);
}
return listParams;
}
/**
* 获取当前用户
* @return
*/
public Long getUserId() {
SysUserDto sysUserDto = (SysUserDto) redisTemplate.opsForValue().get("USER_" + RedisMessageConstant.SENDTYPE_LOGIN_SYS);
return sysUserDto.getUserId();
}
}
\ No newline at end of file
......@@ -71,11 +71,17 @@ logging:
level:
com.jz.manage: debug
domain:
gatewayGetAuth: http://127.0.0.1:8088/api/auth/mall-user-auth-api
gateway:
gatewayGetAuth: http://127.0.0.1:8088/api/auth/user-auth-api
apigateway: http://127.0.0.1:8088/api/producer/addDataBankApiInfo
gatewayUpSalt: http://127.0.0.1:8088/api/auth/reset-salt
updateSendStatus: http://127.0.0.1:8088/api/interface/updateSendStatus
updateAuthRenew: http://192.168.1.114:8088/api/auth/auth-renew
updateAuthRenew: http://127.0.0.1:8088/api/auth/auth-renew
getApiDetail: http://127.0.0.1:8088/api/interface/getApiDetail
getApiTypeList: http://127.0.0.1:8088/api/direction/getApiTypeList
listSendDataBank: http://127.0.0.1:8088/api/interface/listSendDataBank
ftp:
url: 192.168.1.141
port: 21
......
......@@ -360,14 +360,71 @@
t4.invalid_time as invalidTime,
t4.purchase_method as purchaseMethod,
t4.payment_money as paymentMoney,
t4.order_id as orderId
t4.order_id as orderId,
(CASE WHEN t6.year_type = '0.00000' then 0 else year_type end) as yearType,
(CASE WHEN t6.season_type = '0.00000' then 0 else season_type end) as seasonType,
(CASE WHEN t6.month_type = '0.00000' then 0 else month_type end) as monthType,
(CASE WHEN t6.second_type = '0.00000' then 0 else second_type end) as secondType
FROM
t_department t1
INNER JOIN t_finance_customer_assets t2 ON t1.department_id = t2.department_id
INNER JOIN t_mall_customer t3 ON t1.department_id = t3.department_id
left join t_order t4 on t4.customer_id = t3.customer_id
inner join t_order_goods_info t5 on t4.order_id = t5.order_id
INNER JOIN t_data_goods t6 on t6.data_goods_id = t5.data_goods_id
left join t_order t4 on t4.department_id = t1.department_id
left join t_order_goods_info t5 on t4.order_id = t5.order_id
left JOIN t_data_goods t6 on t6.data_goods_id = t5.data_goods_id
${ew.customSqlSegment}
</select>
<select id="selectByTradeCompany" resultType="com.jz.manage.moduls.controller.finance.platForm.dto.DepartmentTradeDto">
SELECT
t1.department_id,
t1.department_name,
t1.linkman,
t1.telephone,
t2.customer_name,
count(t4.order_id) as orderTotal,
ifnull(sum(t4.payment_money),0) as transactionMoney
FROM
t_department t1
INNER JOIN t_mall_customer t2 on t1.department_id = t2.department_id
LEFT JOIN t_order t3 on t2.customer_id = t3.customer_id
inner JOIN t_order_payment t4 on t3.order_id = t4.order_id
${ew.customSqlSegment}
</select>
<select id="tradeCompanyDetail" resultType="com.jz.manage.moduls.controller.finance.platForm.dto.TradeCompanyDetailDto">
SELECT
t1.order_id as orderID,
t1.order_number as orderNumber,
t1.payment_method as paymentMethod,
ROUND(t2.payment_money, 2) as paymentMoney,
t2.cre_time as creTime,
t4.data_name as dataName,
t6.department_name as departmentName
from
t_order t1
INNER JOIN t_order_payment t2 on t1.order_id = t2.order_id
inner join t_order_goods_info t3 on t1.order_id = t3.order_id
inner join t_data_goods t4 on t3.data_goods_id = t4.data_goods_id
INNER JOIN t_mall_customer t5 on t1.customer_id = t5.customer_id
INNER JOIN t_department t6 on t5.department_id = t6.department_id
where
1=1
<if test="departmentId != null">
and t6.department_id = #{departmentId}
</if>
and t1.del_flag = 'N'
</select>
<select id="findUcCodeByGoodsToken" resultType="java.lang.String">
SELECT
t.unified_credit_code
FROM
t_department t
INNER JOIN t_mall_customer t1 on t.department_id = t1.department_id
INNER JOIN t_order t2 on t1.customer_id = t2.customer_id
where
t.del_flag = 'N' and
t2.goods_token = #{goodsToken}
</select>
</mapper>
\ No newline at end of file
......@@ -177,7 +177,8 @@
INNER JOIN t_mall_user_role t2 ON t1.customer_id = t2.customer_id
INNER JOIN t_mall_role t3 ON t2.role_id = t3.role_id
where
del_flag='N'
t1.del_flag='N'
and t1.customer_source = '01'
<if test="customerPhone != null and customerPhone != ''">
and customer_phone = #{customerPhone}
</if>
......@@ -202,6 +203,7 @@
WHERE
t1.customer_id = #{customerId}
and t1.del_flag ='N'
GROUP BY t1.customer_id
</select>
</mapper>
\ No newline at end of file
......@@ -73,7 +73,8 @@
t1.invalid_time as invalidTime,
t5.data_name as dataName ,
t5.data_goods_id as dataGoodsId,
(CASE WHEN ( t1.invalid_time >= DATE_FORMAT(NOW(), '%Y-%m-%d')) THEN '有效' ELSE '无效' END ) as goodsStatus
t1.take_effect_time as privilegedTime,
(CASE WHEN ( t1.invalid_time >= DATE_FORMAT(NOW(), '%Y-%m-%d')) THEN '有效' ELSE '失效' END ) as goodsStatus
FROM
t_order t1
inner join t_mall_customer t2 on t1.customer_id = t2.customer_id
......
......@@ -119,49 +119,36 @@
</delete>
<select id="selectByList" resultType="com.jz.manage.moduls.entity.DataGoodsCategory" parameterType="map">
SELECT
*
FROM
(
SELECT
t3.category_id as categoryId,
t3.category_name as categoryName,
t3.parent_id as parentId,
t3.if_child as ifChild,
t3.del_flag as delFlag
FROM
(
SELECT
t1.*,
IF
( FIND_IN_SET( parent_id, @pids ) > 0, @pids := CONCAT( @pids, ',', category_id ), '0' ) AS ischild
FROM
( SELECT * FROM t_data_goods_category AS t WHERE t.del_flag = 'N' ORDER BY t.category_id ASC ) t1,
( SELECT @pids := ( SELECT category_id FROM t_data_goods_category WHERE category_name = #{categoryName} ) ) t2
) t3
WHERE
ischild != '0' UNION ALL
SELECT
T2.category_id,
T2.category_name,
T2.parent_id,
T2.if_child,
T2.del_flag
FROM
(
SELECT
@r AS _id,
( SELECT @r := parent_id FROM t_data_goods_category WHERE category_id = _id ) AS parent_id,
@l := @l + 1 AS lvl
FROM
( SELECT @r := ( SELECT category_id FROM t_data_goods_category WHERE category_name = #{categoryName} ), @l := 0 ) vars,
t_data_goods_category h
WHERE
@r != 0
) T1
JOIN t_data_goods_category T2 ON T1._id = T2.category_id
) t
where t.delFlag = 'N'
SELECT
t.*,
t2.scene_name AS sceneName,
t2.scene_id AS sceneId
FROM
(
SELECT
T2.category_id,
T2.category_name,
T2.parent_id,
T2.if_child,
T2.del_flag
FROM
(
SELECT
@r AS _id,
( SELECT @r := parent_id FROM t_data_goods_category WHERE category_id = _id ) AS parent_id,
@l := @l + 1 AS lvl
FROM
( SELECT @r := #{id}, @l := 0 ) vars,
t_data_goods_category h
WHERE
@r != 0
) T1
JOIN t_data_goods_category T2 ON T1._id = T2.category_id
) AS t
LEFT JOIN t_scene_goods_category sgc ON t.category_id = sgc.category_id
LEFT JOIN t_scene_category t2 ON sgc.scene_id = t2.scene_id
WHERE
t.del_flag = 'N'
</select>
<select id="findByScene" resultType="com.jz.manage.moduls.entity.DataGoodsCategory">
......@@ -187,4 +174,36 @@
and t1.category_id = #{categoryId}
</if>
</select>
<select id="selectByCategory" resultType="com.jz.manage.moduls.entity.DataGoodsCategory">
select
t1.category_id as categoryId,
t1.category_name as categoryName,
t1.if_child as ifChild,
t1.parent_id as parentId,
t3.scene_name as sceneName,
t3.scene_id as sceneId
from
t_data_goods_category t1
left JOIN t_scene_goods_category t2 on t1.category_id = t2.category_id
left JOIN t_scene_category t3 on t2.scene_id = t3.scene_id
where
t1.del_flag = 'N'
</select>
<select id="selectByList1" resultType="com.jz.manage.moduls.entity.DataGoodsCategory">
select
t1.category_id as categoryId,
t1.category_name as categoryName,
t1.if_child as ifChild,
t1.parent_id as parentId,
t3.scene_name as sceneName,
t3.scene_id as sceneId
from
t_data_goods_category t1
left JOIN t_scene_goods_category t2 on t1.category_id = t2.category_id
left JOIN t_scene_category t3 on t2.scene_id = t3.scene_id
where
t1.del_flag = 'N'
and t1.category_id = #{id}
</select>
</mapper>
\ No newline at end of file
......@@ -58,14 +58,15 @@
t2.category_name as categoryName,
t1.upt_time as uptTime,
t1.cre_time as creTime,
t1.api_key as apiKey,
(CASE WHEN t1.data_status = '01' then '预售'
WHEN t1.data_status = '02' then '在售中'
WHEN t1.data_status = '03' then '下架'
WHEN t1.data_status = '04' then '上架' end) dataStatus,
(CASE WHEN ( t1.goods_limited >= DATE_FORMAT(NOW(), '%Y-%m-%d')) THEN '有效' ELSE '无效' END ) goodsState
(CASE WHEN ( t1.goods_limited >= DATE_FORMAT(NOW(), '%Y-%m-%d')) THEN '01' ELSE '02' END ) goodsState
FROM
t_data_goods t1
INNER JOIN t_data_goods_category t2 ON t1.category_id = t2.category_id
left JOIN t_data_goods_category t2 ON t1.category_id = t2.category_id
${ew.customSqlSegment}
</select>
......@@ -194,4 +195,46 @@
join t_data_goods_category t2 on t1.category_id = t2.category_id
${ew.customSqlSegment}
</select>
<update id="updateByCategory">
update t_data_goods
set
category_id = null
where
data_goods_id in
<foreach collection="list" item="list" open="(" close=")" separator=",">
#{list.dataGoodsId}
</foreach>
</update>
<select id="selectByApiDataGoodsList" resultType="com.jz.manage.moduls.controller.goods.bean.dto.ApiDataGoodsListDto">
SELECT
data_goods_id,
data_name,
data_status,
api_key
FROM
t_data_goods
WHERE
api_key in
<foreach collection="list" item="list" open="(" close=")" separator=",">
#{list.apiKey}
</foreach>
and del_flag = 'N'
</select>
<select id="selectByGoodsId" resultType="com.jz.manage.moduls.entity.DataGoods">
SELECT
data_goods_id as dataGoodsId,
price_type as priceType,
(CASE WHEN year_type = '0.00000' then '' else year_type end) as yearType,
(CASE WHEN season_type = '0.00000' then '' else season_type end) as seasonType,
(CASE WHEN month_type = '0.00000' then '' else month_type end) as monthType,
(CASE WHEN second_type = '0.00000' then '' else second_type end) as secondType
FROM
t_data_goods
where
data_goods_id = #{dataGoodsId}
and del_flag = 'N'
</select>
</mapper>
\ No newline at end of file
......@@ -237,7 +237,8 @@
'已取消'
END
) AS orderStatus,
t.order_time AS orderTime,
t.cre_time AS creTime,
t.api_key as apiKey,
t2.data_name AS dataName,
t4.department_name as departmentName
FROM
......@@ -251,28 +252,24 @@
<select id="queryOrderDetail" resultType="com.jz.manage.moduls.controller.order.bean.dto.OrderDetailDto" parameterType="map">
select
t.order_number as orderNumber,
(case when t.order_status ='01' then '待支付'
when t.order_status ='02' then '已支付'
when t.order_status ='03' then '已取消'
end) as orderStatus,
t.order_money as orderMoney,
t.order_time as orderTime,
(case when t.payment_method ='01' then '余额' else '其他' end)AS paymentMethod,
(case when t.purchase_method ='01' then '年'
when t.purchase_method ='02' then '季'
when t.purchase_method ='03' then '月'
when t.purchase_method ='04' then '次'
end) as purchaseMethod,
t2.data_name as dataName,
(case when t2.data_type ='01' then 'API' when t2.data_type ='02' then '数据包' end) as dataType,
t4.department_name as departmentName
t.order_id as orderId,
t.goods_token as goodsToken,
t.order_number as orderNumber,
(case when t.order_status ='01' then '待支付' when t.order_status ='02' then '已支付' when t.order_status ='03' then
'已取消' end) as orderStatus,
t.order_time as orderTime,
(case when t.purchase_method ='01' then '年' when t.purchase_method ='02' then '季' when t.purchase_method ='03'
then '月'
when t.purchase_method ='04' then '次' end) as purchaseMethod,
(DATE_FORMAT(t.take_effect_time,'%Y-%m-%d %H:%i:%s')) as takeEffectTime,
(DATE_FORMAT(t.invalid_time,'%Y-%m-%d %H:%i:%s')) as invalidTime,
t.api_key as apiKey,
t2.data_name as dataName,
(case when t2.data_type ='01' then 'API' when t2.data_type ='02' then '数据包' end) as dataType
from t_order t
left join t_order_goods_info t1 on t.order_id=t1.order_id
inner join t_data_goods t2 on t2.data_goods_id=t1.data_goods_id
left join t_mall_customer t3 on t3.customer_id=t.customer_id
inner join t_department t4 on t4.department_id=t3.department_id
where 1=1 and t.del_flag='N'
where 1=1
<if test="orderId != null">and t.order_id = #{orderId}</if>
</select>
......@@ -301,7 +298,7 @@
<select id="selectByGoods" resultType="com.jz.manage.moduls.controller.goods.bean.dto.DataAndOrderDto">
SELECT
count(t1.order_id) as orderTotal,
( t1.invalid_time >= DATE_FORMAT( NOW( ), '%Y-%m-%d' ) ) orderState,
(CASE WHEN( t3.goods_limited >= DATE_FORMAT( NOW( ), '%Y-%m-%d' )) THEN '01' ELSE '02' END ) orderState,
t1.purchase_method as purchaseMethod,
t1.api_key as apiKey
FROM
......@@ -316,7 +313,7 @@
<select id="isAuthorization" resultType="com.jz.manage.moduls.controller.order.bean.dto.OrderAndAuthorizedDto">
SELECT
t1.customer_id,
t1.department_id as departmentId,
(CASE WHEN ( t1.invalid_time >= DATE_FORMAT(NOW(), '%Y-%m-%d')) THEN '01' ELSE '02' END ) goodsState
FROM
t_order t1
......@@ -324,11 +321,12 @@
where
1=1 and
t1.del_flag = 'N'
<if test="customerId != null">
and t1.customer_id = #{customerId}
<if test="departmentId != null">
and t1.department_id = #{departmentId}
</if>
<if test="customerId != null">
<if test="dataGoodsId != null">
and t2.data_goods_id = #{dataGoodsId}
</if>
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment