From 173e0517f514e8d17bca445c94e24f7ac52a727a Mon Sep 17 00:00:00 2001 From: "1215525055@qq.com" <1215525055@qq.com> Date: Wed, 28 May 2025 15:25:27 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E6=9B=B4=E6=96=B0,=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E4=BA=86=E5=95=86=E5=93=81=E5=B1=95=E7=A4=BA=E5=9B=BE?= =?UTF-8?q?=E7=89=87=E5=9C=A8=E7=BA=BF=E9=A9=AC=E8=B5=9B=E5=85=8B=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/apporder/AppOrderController.java | 42 +- .../goodsonline/GoodsonlineController.java | 7 +- .../route/goods/GoodsRouteController.java | 4 + .../pojo/dtos/goods/GoodsSimpleDTO.java | 12 + .../aishop/pojo/vos/apporder/AppOrder2VO.java | 2 - .../apporder/impl/AppOrderServiceImpl.java | 4 +- .../impl/GoodsonlineServiceImpl.java | 1 + .../tenlion/aishop/util/ShopDateUtils.java | 45 ++ src/main/resources/application-lanproxy.yml | 3 - .../mapper/apporder/app-order-mapper.xml | 4 +- .../resources/templates/apporder/list.html | 7 +- src/main/resources/templates/goods/check.html | 13 +- .../resources/templates/goods/image2.html | 578 ++++++++++++++++++ .../templates/goods/list-system.html | 12 +- src/main/resources/templates/goods/list.html | 18 +- 15 files changed, 701 insertions(+), 51 deletions(-) create mode 100644 src/main/java/cn/com/tenlion/aishop/util/ShopDateUtils.java create mode 100644 src/main/resources/templates/goods/image2.html diff --git a/src/main/java/cn/com/tenlion/aishop/controller/api/apporder/AppOrderController.java b/src/main/java/cn/com/tenlion/aishop/controller/api/apporder/AppOrderController.java index 26166b0..f3f5db1 100644 --- a/src/main/java/cn/com/tenlion/aishop/controller/api/apporder/AppOrderController.java +++ b/src/main/java/cn/com/tenlion/aishop/controller/api/apporder/AppOrderController.java @@ -17,6 +17,7 @@ import com.alibaba.fastjson.JSONArray; import ink.wgink.annotation.CheckRequestBodyAnnotation; import ink.wgink.common.base.DefaultBaseController; import ink.wgink.common.component.SecurityComponent; +import ink.wgink.exceptions.SaveException; import ink.wgink.interfaces.consts.ISystemConstant; import ink.wgink.module.file.enums.UploadTypeEnum; import ink.wgink.module.file.service.IDefaultFileService; @@ -52,7 +53,7 @@ import java.util.*; * @Date: 2025-05-20 14:10:16 * @Version: 3.0 **/ -@Api(tags = ISystemConstant.API_TAGS_SYSTEM_PREFIX + "APP电子软著接口") +@Api(tags = ISystemConstant.API_TAGS_SYSTEM_PREFIX + "电子软著接口") @RestController @RequestMapping(ISystemConstant.API_PREFIX + "/apporder") public class AppOrderController extends DefaultBaseController { @@ -73,9 +74,9 @@ public class AppOrderController extends DefaultBaseController { @Autowired private IDefaultFileService iFileService2; +/* @ApiOperation(value = "价格列表", notes = "价格列表接口")*/ @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @GetMapping("money-list") - @CheckRequestBodyAnnotation public JSONArray moneyList() { return JSON.parseArray(ProjectConfigUtil.getText("MoneyAndDate").trim()); } @@ -143,8 +144,8 @@ public class AppOrderController extends DefaultBaseController { response.flushBuffer(); } - @ApiOperation(value = "转让协议书", notes = "转让协议书接口") - @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) +/* @ApiOperation(value = "转让协议书", notes = "转让协议书接口") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})*/ @GetMapping("create-file/{templateCode}/{id}") public FilePO createXieYi(@PathVariable("templateCode") String templateCode, @PathVariable("id") String id, String name, HttpServletRequest request, HttpServletResponse response) throws Exception { // CBC 其他模块批量生成示例代码, 遍历您的业务数据集循环调用下列代码, 如果需要实时生成, 请在您的新增修改的结尾调用下面代码 17691030315 @@ -189,8 +190,8 @@ public class AppOrderController extends DefaultBaseController { return iFileService2.getPO(fileId); } - @ApiOperation(value = "付款", notes = "付款接口") - @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) +/* @ApiOperation(value = "付款", notes = "付款接口") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})*/ @PostMapping("pay/{orderMoneyId}") @CheckRequestBodyAnnotation public SuccessResultData save(@PathVariable("orderMoneyId") String orderMoneyId) { @@ -198,8 +199,8 @@ public class AppOrderController extends DefaultBaseController { return new SuccessResultData<>(orderId); } - @ApiOperation(value = "下证上传", notes = "下证上传接口") - @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + /* @ApiOperation(value = "下证上传", notes = "下证上传接口") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})*/ @PostMapping("update/success/{appOrderId}") @CheckRequestBodyAnnotation public SuccessResult updateCheck(@PathVariable("appOrderId") String appOrderId, @RequestBody AppOrderSuccessVO appOrderSuccessVO) { @@ -207,8 +208,8 @@ public class AppOrderController extends DefaultBaseController { return new SuccessResult(); } - @ApiOperation(value = "后台审核", notes = "后台审核接口") - @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) +/* @ApiOperation(value = "后台审核", notes = "后台审核接口") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})*/ @PostMapping("update/check/{appOrderId}") @CheckRequestBodyAnnotation public SuccessResult updateCheck(@PathVariable("appOrderId") String appOrderId, @RequestBody AppOrderCheckVO appOrderCheckVO) { @@ -216,8 +217,8 @@ public class AppOrderController extends DefaultBaseController { return new SuccessResult(); } - @ApiOperation(value = "提交审核", notes = "提交审核接口") - @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + /* @ApiOperation(value = "提交审核", notes = "提交审核接口") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})*/ @PostMapping("update/sub-check/{appOrderId}") @CheckRequestBodyAnnotation public SuccessResult updateSubCheck(@PathVariable("appOrderId") String appOrderId) { @@ -225,8 +226,8 @@ public class AppOrderController extends DefaultBaseController { return new SuccessResult(); } - @ApiOperation(value = "鉴别材料", notes = "鉴别材料接口") - @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) +/* @ApiOperation(value = "鉴别材料", notes = "鉴别材料接口") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})*/ @PostMapping("update/3/{appOrderId}") @CheckRequestBodyAnnotation public SuccessResult save(@PathVariable("appOrderId") String appOrderId, @RequestBody AppOrder3VO vo) { @@ -235,18 +236,23 @@ public class AppOrderController extends DefaultBaseController { return new SuccessResult(); } - @ApiOperation(value = "软件基本信息", notes = "软件基本信息接口") - @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) +/* @ApiOperation(value = "软件基本信息", notes = "软件基本信息接口") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})*/ @PostMapping("update/2/{appOrderId}") @CheckRequestBodyAnnotation public SuccessResult save(@PathVariable("appOrderId") String appOrderId, @RequestBody AppOrder2VO vo) { + if(!vo.getDevelopWay().equals("独立开发")) { + if(StringUtils.isEmpty(vo.getGetFile())) { + throw new SaveException("合作协议不能为空"); + } + } Map params = HashMapUtil.beanToMap(vo); appOrderService.saveData(appOrderId, 2, params); return new SuccessResult(); } - @ApiOperation(value = "企业/机构认证", notes = "企业/机构认证接口") - @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) +/* @ApiOperation(value = "企业/机构认证", notes = "企业/机构认证接口") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})*/ @PostMapping("update/1/{appOrderId}") @CheckRequestBodyAnnotation public SuccessResult save(@PathVariable("appOrderId") String appOrderId, @RequestBody AppOrder1VO vo) { diff --git a/src/main/java/cn/com/tenlion/aishop/controller/api/goodsonline/GoodsonlineController.java b/src/main/java/cn/com/tenlion/aishop/controller/api/goodsonline/GoodsonlineController.java index 05ec2eb..1ca33f2 100644 --- a/src/main/java/cn/com/tenlion/aishop/controller/api/goodsonline/GoodsonlineController.java +++ b/src/main/java/cn/com/tenlion/aishop/controller/api/goodsonline/GoodsonlineController.java @@ -40,10 +40,13 @@ public class GoodsonlineController extends DefaultBaseController { @ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String"), - @ApiImplicitParam(name = "goodsGetTime'", value = "取得时间 年", paramType = "query", dataType = "String"), + /* @ApiImplicitParam(name = "goodsGetTime'", value = "取得时间 年", paramType = "query", dataType = "String"),*/ @ApiImplicitParam(name = "goodsGetType", value = "所有者类型", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "goodsDevelop", value = "软著开发语言", paramType = "query", dataType = "String"), - @ApiImplicitParam(name = "goodsType", value = "软著类型", paramType = "query", dataType = "String") + @ApiImplicitParam(name = "goodsType", value = "软著类型", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "priceRangeStart", value = "价格区间", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "priceRangeEnd", value = "价格区间", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "priceOrder", value = "DESC或ASC", paramType = "query", dataType = "String") }) @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @GetMapping("listpage") diff --git a/src/main/java/cn/com/tenlion/aishop/controller/route/goods/GoodsRouteController.java b/src/main/java/cn/com/tenlion/aishop/controller/route/goods/GoodsRouteController.java index 4180301..0c60a37 100644 --- a/src/main/java/cn/com/tenlion/aishop/controller/route/goods/GoodsRouteController.java +++ b/src/main/java/cn/com/tenlion/aishop/controller/route/goods/GoodsRouteController.java @@ -44,6 +44,10 @@ public class GoodsRouteController extends DefaultBaseController { public ModelAndView image() { return new ModelAndView("goods/image"); } + @GetMapping("image2") + public ModelAndView image2() { + return new ModelAndView("goods/image2"); + } @GetMapping("update") diff --git a/src/main/java/cn/com/tenlion/aishop/pojo/dtos/goods/GoodsSimpleDTO.java b/src/main/java/cn/com/tenlion/aishop/pojo/dtos/goods/GoodsSimpleDTO.java index 09a161e..c46c830 100644 --- a/src/main/java/cn/com/tenlion/aishop/pojo/dtos/goods/GoodsSimpleDTO.java +++ b/src/main/java/cn/com/tenlion/aishop/pojo/dtos/goods/GoodsSimpleDTO.java @@ -1,5 +1,6 @@ package cn.com.tenlion.aishop.pojo.dtos.goods; +import cn.com.tenlion.aishop.util.ShopDateUtils; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -47,11 +48,22 @@ public class GoodsSimpleDTO { private String goodsStatusTime; @ApiModelProperty(name = "goodsLastTime", value = "软件截止售卖时间") private String goodsLastTime; + @ApiModelProperty(name = "goodsLastDay", value = "软件截止售卖天数") + private Long goodsLastDay; @ApiModelProperty(name = "goodsVnumber", value = "版本") private Integer goodsVnumber; @ApiModelProperty(name = "goodsFlag", value = "商品标签") private String goodsFlag; + public Long getGoodsLastDay() { + long lastDay = ShopDateUtils.calculateDaysDifference(goodsLastTime); + return lastDay; + } + + public void setGoodsLastDay(Long goodsLastDay) { + this.goodsLastDay = goodsLastDay; + } + public String getGoodsFlag() { return goodsFlag == null ? "" : goodsFlag.trim(); } diff --git a/src/main/java/cn/com/tenlion/aishop/pojo/vos/apporder/AppOrder2VO.java b/src/main/java/cn/com/tenlion/aishop/pojo/vos/apporder/AppOrder2VO.java index f593e63..50fca27 100644 --- a/src/main/java/cn/com/tenlion/aishop/pojo/vos/apporder/AppOrder2VO.java +++ b/src/main/java/cn/com/tenlion/aishop/pojo/vos/apporder/AppOrder2VO.java @@ -23,7 +23,6 @@ public class AppOrder2VO { @CheckEmptyAnnotation(name = "软件名称") private String appName; @ApiModelProperty(name = "subName", value = "软件简称") - @CheckEmptyAnnotation(name = "软件简称") private String subName; @ApiModelProperty(name = "versionName", value = "版本号") @CheckEmptyAnnotation(name = "版本号") @@ -54,7 +53,6 @@ public class AppOrder2VO { @ApiModelProperty(name = "projOwnerIdentity", value = "著作权人证件号") private String projOwnerIdentity; @ApiModelProperty(name = "getFile", value = "合作协议") - @CheckEmptyAnnotation(name = "合作协议") private String getFile; public String getProjOwnerId() { diff --git a/src/main/java/cn/com/tenlion/aishop/service/apporder/impl/AppOrderServiceImpl.java b/src/main/java/cn/com/tenlion/aishop/service/apporder/impl/AppOrderServiceImpl.java index 0c5638d..8a90839 100644 --- a/src/main/java/cn/com/tenlion/aishop/service/apporder/impl/AppOrderServiceImpl.java +++ b/src/main/java/cn/com/tenlion/aishop/service/apporder/impl/AppOrderServiceImpl.java @@ -91,7 +91,7 @@ public class AppOrderServiceImpl extends DefaultBaseService implements IAppOrder // 获取第 i 个元素(JSONObject 类型) JSONObject obj = jsonArray.getJSONObject(i); String id = obj.getString("id"); - if(id == orderMoneyId) { + if(id.equals(orderMoneyId)) { data = obj; } } @@ -103,7 +103,7 @@ public class AppOrderServiceImpl extends DefaultBaseService implements IAppOrder throw new SaveException("价格配置异常"); } Integer day = data.getInteger("day"); - Integer title = data.getInteger("title"); + String title = data.getString("title"); UserInfoBO userInfoBO = this.securityComponent.getCurrentUser(); String userId = userInfoBO.getUserId(); String orderNO = generateOrderNumber(); diff --git a/src/main/java/cn/com/tenlion/aishop/service/goodsonline/impl/GoodsonlineServiceImpl.java b/src/main/java/cn/com/tenlion/aishop/service/goodsonline/impl/GoodsonlineServiceImpl.java index b1c3629..36484f5 100644 --- a/src/main/java/cn/com/tenlion/aishop/service/goodsonline/impl/GoodsonlineServiceImpl.java +++ b/src/main/java/cn/com/tenlion/aishop/service/goodsonline/impl/GoodsonlineServiceImpl.java @@ -3,6 +3,7 @@ package cn.com.tenlion.aishop.service.goodsonline.impl; import cn.com.tenlion.aishop.pojo.dtos.goods.GoodsDTO; import cn.com.tenlion.aishop.pojo.dtos.goods.GoodsSimpleDTO; import cn.com.tenlion.aishop.service.goods.IGoodsService; +import cn.com.tenlion.aishop.util.ShopDateUtils; import ink.wgink.common.base.DefaultBaseService; import ink.wgink.module.dictionary.pojo.dtos.AreaDTO; import ink.wgink.module.dictionary.pojo.dtos.DataDTO; diff --git a/src/main/java/cn/com/tenlion/aishop/util/ShopDateUtils.java b/src/main/java/cn/com/tenlion/aishop/util/ShopDateUtils.java new file mode 100644 index 0000000..78f0b35 --- /dev/null +++ b/src/main/java/cn/com/tenlion/aishop/util/ShopDateUtils.java @@ -0,0 +1,45 @@ +package cn.com.tenlion.aishop.util; + +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; +import java.time.format.DateTimeParseException; +import java.time.temporal.ChronoUnit; + +public class ShopDateUtils { + + private static final DateTimeFormatter FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd"); + + /** + * 计算当前日期与指定日期之间的天数差 + * @param dateStr 格式为"yyyy-MM-dd"的日期字符串 + * @return 天数差(当前日期在前时返回负数,目标日期在前时返回正数) + * @throws DateTimeParseException 当日期格式不正确时抛出 + */ + public static long calculateDaysDifference(String dateStr) { + LocalDate targetDate = LocalDate.parse(dateStr, FORMATTER); + LocalDate currentDate = LocalDate.now(); + return ChronoUnit.DAYS.between(currentDate, targetDate); + } + + /** + * 获取两个日期之间的绝对天数差(不考虑顺序) + * @param dateStr 格式为"yyyy-MM-dd"的日期字符串 + * @return 绝对天数差 + * @throws DateTimeParseException 当日期格式不正确时抛出 + */ + public static long getAbsoluteDaysDifference(String dateStr) { + return Math.abs(calculateDaysDifference(dateStr)); + } + + public static void main(String[] args) { + // 示例用法 + try { + System.out.println(calculateDaysDifference("2025-05-28")); // 输出 0(同一天) + System.out.println(calculateDaysDifference("2025-05-30")); // 输出 2(未来日期) + System.out.println(calculateDaysDifference("2025-05-25")); // 输出 -3(过去日期) + System.out.println(getAbsoluteDaysDifference("2025-05-25")); // 输出 3(绝对值) + } catch (DateTimeParseException e) { + System.err.println("日期格式错误: " + e.getMessage()); + } + } +} \ No newline at end of file diff --git a/src/main/resources/application-lanproxy.yml b/src/main/resources/application-lanproxy.yml index 26b6cd6..55fe36c 100644 --- a/src/main/resources/application-lanproxy.yml +++ b/src/main/resources/application-lanproxy.yml @@ -139,9 +139,6 @@ logging: root: error ink.wgink: debug cn.com.tenlion.*: debug - # 开启JDBC和MyBatis日志(显示SQL执行详情) - org.springframework.jdbc: DEBUG - org.mybatis.spring: DEBUG aishop: # 账户系统地址 diff --git a/src/main/resources/mybatis/mapper/apporder/app-order-mapper.xml b/src/main/resources/mybatis/mapper/apporder/app-order-mapper.xml index 3707920..140b920 100644 --- a/src/main/resources/mybatis/mapper/apporder/app-order-mapper.xml +++ b/src/main/resources/mybatis/mapper/apporder/app-order-mapper.xml @@ -350,9 +350,6 @@ scope_of_power = #{scopeOfPower}, - - get_file = #{getFile}, - source_code_doc_file = #{sourceCodeDocFile}, @@ -413,6 +410,7 @@ check_time = #{checkTime}, + get_file = #{getFile}, app_order_id = app_order_id WHERE app_order_id = #{appOrderId} diff --git a/src/main/resources/templates/apporder/list.html b/src/main/resources/templates/apporder/list.html index 7233c50..e16ea90 100644 --- a/src/main/resources/templates/apporder/list.html +++ b/src/main/resources/templates/apporder/list.html @@ -164,10 +164,13 @@ {field: 'appOrderPayDay', width: 280, title: '处理时效', align:'center', templet: function(row) { var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + /* if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { return '-'; + }*/ + if(rowData == 0) { + return "当天下证【截止" + row["appOrderPayEndTime"] + "】"; } - return rowData + "个工作日【需在" + row["appOrderPayEndTime"] + "前下证】"; + return rowData + "个工作日【截止" + row["appOrderPayEndTime"] + "前下证】"; } } ] diff --git a/src/main/resources/templates/goods/check.html b/src/main/resources/templates/goods/check.html index 4505d76..f013b62 100644 --- a/src/main/resources/templates/goods/check.html +++ b/src/main/resources/templates/goods/check.html @@ -48,7 +48,7 @@
- 点击查看 上架软著电子版 + 点击编辑 上架软著电子版 @@ -333,14 +333,15 @@ }); $('#logoImage').on('click', function() { - top.dialog.dialogData.uploadImage = ""; + localStorage.setItem('uploadImage', ''); top.dialog.open({ - url: 'route/goods/image?fileId='+ $('#goodsPhoto').val(), + url: 'route/goods/image2?fileId='+ $('#goodsPhoto').val(), title: '上传软著上架电子版', - width: '850px', - height: '500px', + width: '950px', + height: '600px', onClose: function() { - var uploadImage = top.dialog.dialogData.uploadImage; + var uploadImage = localStorage.getItem('uploadImage'); + console.log('uploadImage', uploadImage); if(typeof(uploadImage) != 'undefined' && null != uploadImage && '' != uploadImage) { $('#logoImage').attr('src', 'route/file/download/false/' + uploadImage); $('#goodsPhoto').val(uploadImage); diff --git a/src/main/resources/templates/goods/image2.html b/src/main/resources/templates/goods/image2.html new file mode 100644 index 0000000..155384a --- /dev/null +++ b/src/main/resources/templates/goods/image2.html @@ -0,0 +1,578 @@ + + + + + + + + + + + +
+
+
+ + +
+ +
+
+
+
+ + + + + + + +
+
+
+ +
+
+ +
+
+
+
+ + +
+
+ +
+
+
+
+ + + 10px +
+
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/src/main/resources/templates/goods/list-system.html b/src/main/resources/templates/goods/list-system.html index 89cfd1f..4c3889e 100644 --- a/src/main/resources/templates/goods/list-system.html +++ b/src/main/resources/templates/goods/list-system.html @@ -25,9 +25,9 @@
-
+ +
+ +
-
+ +
+ +