瀏覽代碼

1:供应商修改

wangming 2 年之前
父節點
當前提交
983db93713

+ 11 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/scm/SupplierInfoController.java

@@ -5,6 +5,7 @@ import java.util.Map;
 
 import com.alibaba.druid.util.StringUtils;
 import com.ruoyi.common.utils.uuid.UUID;
+import com.ruoyi.opt.domain.ProcessDetailInfo;
 import com.ruoyi.opt.domain.ProcessInfo;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -171,4 +172,14 @@ public class SupplierInfoController extends BaseController
     {
         return toAjax(supplierInfoService.deleteSupplierInfoByIds(ids));
     }
+
+    @RequiresPermissions("scm:supplier:list")
+    @GetMapping("/detail/{id}")
+    public String detail(@PathVariable("id") String id, ModelMap mmap)
+    {
+//        ProcessInfo processInfo = processInfoService.selectProcessInfoByPId(pId);
+        SupplierInfo supplierInfo = supplierInfoService.selectSupplierInfoById(id);
+        mmap.put("supplierInfo", supplierInfo);
+        return prefix + "/detail";
+    }
 }

+ 8 - 2
ruoyi-admin/src/main/java/com/ruoyi/web/controller/scm/ZSproducController.java

@@ -18,6 +18,7 @@ import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
+import org.springframework.util.ObjectUtils;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -108,7 +109,10 @@ public class ZSproducController {
         productInfo.setId(UUID.randomUUID().toString().replaceAll("-", ""));
         List<Map<String, String>> saleAttributes = product.getSaleAttributes();
         productInfo.setSaleAttributes(JSON.toJSONString(saleAttributes).toString());
-        productInfo.setSupplierName(supplierInfo.getSupplierName());
+        productInfo.setSkuName(product.getCategoryName());
+        if (!ObjectUtils.isEmpty(supplierInfo)){
+            productInfo.setSupplierName(StringUtils.isEmpty(supplierInfo.getSupplierName()) ? "" : supplierInfo.getSupplierName());
+        }
         productInfo.setSellPrice(StringUtils.isEmpty(product.getSellPrice() + "") ? "" : String.valueOf(product.getSellPrice()));
         productInfo.setMarketPrice(StringUtils.isEmpty(product.getMarketPrice() + "") ? "" : String.valueOf(product.getMarketPrice()));
         if (product.isEnergySav()){
@@ -124,7 +128,9 @@ public class ZSproducController {
         productInfo.setTaxRate(StringUtils.isEmpty(product.getTaxRate()+"") ? "" : String.valueOf(product.getTaxRate()));
         productInfo.setSaleUnit(StringUtils.isEmpty(product.getSaleUnit()+"") ? "" : String.valueOf(product.getSaleUnit()));
         productInfo.setWeight(StringUtils.isEmpty(product.getWeight()+"") ? "" : String.valueOf(product.getWeight()));
-        productInfo.setWeightUnit(StringUtils.isEmpty(product.getWeightUnit()+"") ? "" : String.valueOf(product.getWeightUnit()));
+        if (product.getWeight() != 0){
+            productInfo.setWeightUnit(StringUtils.isEmpty(product.getWeightUnit()+"") ? "" : String.valueOf(product.getWeightUnit()));
+        }
         productInfo.setLength(StringUtils.isEmpty(product.getLength()+"") ? "" : String.valueOf(product.getLength()));
         productInfo.setWidth(StringUtils.isEmpty(product.getWidth()+"") ? "" : String.valueOf(product.getWidth()));
         productInfo.setHeight(StringUtils.isEmpty(product.getHeight()+"") ? "" : String.valueOf(product.getHeight()));

+ 1 - 1
ruoyi-admin/src/main/resources/templates/scm/production/production.html

@@ -289,7 +289,7 @@
                             actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="down(\'' + row.id + '\')"><i class="fa fa-edit"></i>下架</a> ');
                         }
                         // actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
-                        // actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
+                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                         return actions.join('');
                     }
                 }]

+ 109 - 0
ruoyi-admin/src/main/resources/templates/scm/supplier/detail.html

@@ -0,0 +1,109 @@
+<!DOCTYPE html>
+<html lang="zh" xmlns:th="http://www.thymeleaf.org">
+<head>
+    <th:block th:include="include :: header('供应商展示行情')"/>
+</head>
+<body class="white-bg">
+<div class="wrapper wrapper-content animated fadeInRight ibox-content">
+    <form class="form-horizontal m-t">
+        <input type="hidden" id="id" name="id" th:value="${supplierInfo.id}">
+        <div class="form-group">
+            <label class="col-sm-4 control-label">供应商名称:</label>
+            <div class="form-control-static" th:text="${supplierInfo.supplierName}"></div>
+        </div>
+        <div class="form-group">
+            <label class="col-sm-4 control-label">供应商简称:</label>
+            <div class="form-control-static" th:text="${supplierInfo.supplierReName}"></div>
+        </div>
+        <div class="form-group">
+            <label class="col-sm-4 control-label">供应商地址:</label>
+            <div class="form-control-static" th:text="${supplierInfo.address}"></div>
+        </div>
+        <div class="form-group">
+            <label class="col-sm-4 control-label">供应商详细地址:</label>
+            <div class="form-control-static" th:text="${supplierInfo.detailAddress}"></div>
+        </div>
+        <div class="form-group">
+            <label class="col-sm-4 control-label">logo:</label>
+            <div class="form-control-static" th:text="${supplierInfo.logo}"></div>
+        </div>
+        <div class="form-group">
+            <label class="col-sm-4 control-label">邮编:</label>
+            <div class="form-control-static" th:text="${supplierInfo.postCode}"></div>
+        </div>
+        <div class="form-group">
+            <label class="col-sm-4 control-label">官网网址:</label>
+            <div class="form-control-static" th:text="${supplierInfo.website}"></div>
+        </div>
+        <div class="form-group">
+            <label class="col-sm-4 control-label">供应商电话:</label>
+            <div class="form-control-static" th:text="${supplierInfo.supplierPhone}"></div>
+        </div>
+        <div class="form-group">
+            <label class="col-sm-4 control-label">传真:</label>
+            <div class="form-control-static" th:text="${supplierInfo.fax}"></div>
+        </div>
+        <div class="form-group">
+            <label class="col-sm-4 control-label">供应商联系人:</label>
+            <div class="form-control-static" th:text="${supplierInfo.supplierMan}"></div>
+        </div>
+        <div class="form-group">
+            <label class="col-sm-4 control-label">联系人电话:</label>
+            <div class="form-control-static" th:text="${supplierInfo.manPhone}"></div>
+        </div>
+        <div class="form-group">
+            <label class="col-sm-4 control-label">供应商性质:</label>
+            <div class="form-control-static" th:text="${supplierInfo.supplierNature}"></div>
+        </div>
+        <div class="form-group">
+            <label class="col-sm-4 control-label">供应商行业:</label>
+            <div class="form-control-static" th:text="${supplierInfo.supplierBusiness}"></div>
+        </div>
+        <div class="form-group">
+            <label class="col-sm-4 control-label">供应商规模:</label>
+            <div class="form-control-static" th:text="${supplierInfo.supplierScale}"></div>
+        </div>
+        <div class="form-group">
+            <label class="col-sm-4 control-label">供应商类型:</label>
+            <div class="form-control-static" th:text="${supplierInfo.supplierType}"></div>
+        </div>
+        <div class="form-group">
+            <div class="text-center">
+<!--            <th:block th:if="${supplierInfo.processStsCd=='01'}" shiro:hasPermission="opt:process:approve"><button type="button" onclick="approve()" class="btn btn-success">审核</button></th:block>-->
+<!--            <th:block th:if="${supplierInfo.processStsCd=='04'}" shiro:hasPermission="opt:process:approve"><button type="button" onclick="confirmPay()" class="btn btn-success">确认支付</button></th:block>-->
+<!--            <th:block th:if="${supplierInfo.processStsCd=='05'}" shiro:hasPermission="opt:process:approve"><button type="button" onclick="policySign()" class="btn btn-success">签署</button></th:block>-->
+            </div>
+        </div>
+    </form>
+</div>
+<th:block th:include="include :: footer"/>
+<script th:inline="javascript">
+    var prefix = ctx + "opt/process";
+
+    // 跳转审核页面
+    function approve() {
+        var pId = $("#pId").val();
+        $.modal.open("审批", "/opt/process/approve/" + pId, '800', '350');
+        $.modal.close();
+    }
+
+    // 确认支付
+    function confirmPay() {
+        $.modal.confirm("已收到此笔保费金额?", function () {
+            $.operate.save(prefix + "/edit", {"pId": $("#pId").val(), "processId":$("#processId").val(), "processStsCd": "05"});
+        })
+    }
+
+    // 签署
+    function policySign(){
+        var policySignUrl = $("#policySignUrl").val();
+        if($.common.isNotEmpty(policySignUrl)) {
+            window.open(policySignUrl);
+            $.modal.close();
+        }else{
+            $.modal.msgError("签署失败,请联系相关人员确认后重试");
+        }
+    }
+</script>
+</body>
+</html>

+ 31 - 1
ruoyi-admin/src/main/resources/templates/scm/supplier/supplier.html

@@ -328,13 +328,21 @@
                 columns: [{
                     checkbox: true
                 },
+                    {
+                        field: 'id',
+                        title: '主键',
+                        visible: false
+                    },
                 // {
                 //     field: 'zsId',
                 //     title: '中盛的id'
                 // },
                 {
                     field: 'supplierName',
-                    title: '供应商名称'
+                    title: '供应商名称',
+                    formatter: function(value, row, index) {
+                        return '<a href="javascript:void(0)" onclick="detail(\'' + row.id + '\')">' + value + '</a>';
+                    }
                 },
                 {
                     field: 'supplierReName',
@@ -667,6 +675,28 @@
         function approve(id) {
             $.modal.open("审核", "/scm/supplier/approve/" + id, '800', '350');
         }
+
+        // 查看订单详情
+        function detail(id) {
+            if($.common.isNotEmpty(id)) {
+                var url = prefix + '/detail/' + id;
+                // $.operate.detail("订单详情", url);
+                var options = {
+                    title: '供应商详情',
+                    width: 800,
+                    height: 600,
+                    url: url,
+                    skin: 'layui-layer-gray',
+                    btn: ['关闭'],
+                    yes: function (index, layero) {
+                        $.modal.close(index);
+                    }
+                };
+                $.modal.openOptions(options);
+            }else{
+                $.modal.msgError("查看失败,请联系相关人员");
+            }
+        }
     </script>
 </body>
 </html>

+ 11 - 9
ruoyi-system/src/main/java/com/ruoyi/scm/service/impl/SupplierInfoServiceImpl.java

@@ -9,7 +9,6 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.ruoyi.common.core.domain.AjaxResult;
-import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.http.HttpUtils;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -20,6 +19,7 @@ import com.ruoyi.scm.domain.SupplierInfo;
 import com.ruoyi.scm.service.ISupplierInfoService;
 import com.ruoyi.common.core.text.Convert;
 import org.springframework.util.CollectionUtils;
+import org.springframework.util.StringUtils;
 
 /**
  * 供应商Service业务层处理
@@ -63,18 +63,20 @@ public class SupplierInfoServiceImpl extends ServiceImpl<SupplierInfoMapper, Sup
             zsParamMap.put("contactPhone", supplierInfoNew.getSupplierPhone());   //联系电话
             zsParamMap.put("email", supplierInfoNew.getEmail());
             zsParamMap.put("address", supplierInfoNew.getDetailAddress());
-            zsParamMap.put("memo", supplierInfoNew.getSupplierDesc());
-            zsParamMap.put("type", supplierInfoNew);
+            zsParamMap.put("memo", StringUtils.isEmpty(supplierInfoNew.getSupplierDesc()) ? "" : supplierInfoNew.getSupplierDesc());
+            zsParamMap.put("type", 10);
             String string = JSON.toJSONString(zsParamMap);
             String resultJson = HttpUtils.sendPost(zsIp, string);
             //解析数据
             Map<String, Object> resultMap = JSON.parseObject(resultJson, Map.class);
-            if (CollectionUtils.isEmpty(resultMap)){
-                SupplierInfo supplierInfoNew1 = supplierInfoMapper.selectSupplierInfoById(supplierInfo.getId());
-                supplierInfoNew1.setStatus("0");
-                supplierInfoNew1.setRefuseMsg(null);
-                //直接进行数据修改
-                supplierInfoMapper.updateSupplierInfo(supplierInfoNew1);
+            if (!CollectionUtils.isEmpty(resultMap)){
+                if (!resultMap.get("resultCode").equals("00")){
+                    SupplierInfo supplierInfoNew1 = supplierInfoMapper.selectSupplierInfoById(supplierInfo.getId());
+                    supplierInfoNew1.setStatus("0");
+//                    supplierInfoNew1.setRefuseMsg(null);
+                    //直接进行数据修改
+                    supplierInfoMapper.updateSupplierInfo(supplierInfoNew1);
+                }
             }
             return resultMap;
         } catch (Exception e) {