瀏覽代碼

生成二维码

liujiankang 7 年之前
父節點
當前提交
fbaaf5fd02

+ 6 - 0
watero-rst-interface/src/main/java/com/iamberry/rst/faces/pts/ProduceService.java

@@ -75,4 +75,10 @@ public interface ProduceService {
      * @return
      */
     WechatMp getWechatMpById(Integer wechatMpId);
+
+    /**
+     * 获取公众号信息
+     * @return
+     */
+    List<WechatMp> listWechatMp();
 }

+ 5 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/pts/ProduceServiceImpl.java

@@ -286,4 +286,9 @@ public class ProduceServiceImpl implements ProduceService {
     public WechatMp getWechatMpById(Integer wechatMpId) {
         return produceMapper.getWechatMpById(wechatMpId);
     }
+
+    @Override
+    public List<WechatMp> listWechatMp() {
+        return produceMapper.listWechatMp();
+    }
 }

+ 8 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/pts/mapper/ProduceMapper.java

@@ -94,4 +94,12 @@ public interface ProduceMapper {
      * @return
      */
     WechatMp getWechatMpById(Integer wechatMpId);
+
+    /**
+     * 获取公众号信息
+     * @return
+     */
+    List<WechatMp> listWechatMp();
+
+
 }

+ 16 - 3
watero-rst-service/src/main/java/com/iamberry/rst/service/pts/mapper/produceMapper.xml

@@ -197,8 +197,8 @@
 
 
     <insert id="saveProduce" parameterType="Produce" useGeneratedKeys="true"  keyProperty="produceId">
-        insert into tb_rst_pts_produce (produce_id,produce_no,produce_name,produce_status,produce_remake,produce_type,produce_pattern,produce_model,produce_feature)
-        values (#{produceId},#{produceNo},#{produceName},#{produceStatus},#{produceRemake},#{produceType},#{producePattern},#{produceModel},#{produceFeature})
+        insert into tb_rst_pts_produce (produce_id,produce_no,produce_name,produce_status,produce_remake,produce_type,produce_pattern,produce_model,produce_feature,wechat_mp_id)
+        values (#{produceId},#{produceNo},#{produceName},#{produceStatus},#{produceRemake},#{produceType},#{producePattern},#{produceModel},#{produceFeature},#{wechatMpId})
     </insert>
 
     <update id="updateProduce" parameterType="Produce" >
@@ -226,7 +226,10 @@
                 produce_feature = #{produceFeature},
             </if>
             <if test="produceRemake !=null and produceRemake !=''">
-                produce_remake = #{produceRemake}
+                produce_remake = #{produceRemake},
+            </if>
+            <if test="wechatMpId !=null and wechatMpId !=''">
+                wechat_mp_id = #{wechatMpId}
             </if>
         </set>
         WHERE
@@ -492,4 +495,14 @@
         wechat_mp_pubno AS wechatMpPubno
          from tb_rst_pts_wechat_mp where wechat_mp_id = #{0}
     </select>
+
+    <select id="listWechatMp" resultType="WechatMp">
+        SELECT
+        wechat_mp_id AS wechatMpId,
+        wechat_mp_appid AS wechatMpAppid,
+        wechat_mp_appsecret AS wechatMpAppsecret,
+        wechat_mp_name AS wechatMpName,
+        wechat_mp_pubno AS wechatMpPubno
+        from tb_rst_pts_wechat_mp
+    </select>
 </mapper>

+ 7 - 0
watero-rst-web/src/main/java/com/iamberry/rst/controllers/pts/AdminProduceController.java

@@ -3,6 +3,7 @@ package com.iamberry.rst.controllers.pts;
 import com.iamberry.rst.core.pts.ProcessNode;
 import com.iamberry.rst.core.pts.Produce;
 import com.iamberry.rst.core.pts.ProduceProcess;
+import com.iamberry.rst.core.pts.WechatMp;
 import com.iamberry.rst.faces.pts.ProduceService;
 import com.iamberry.wechat.tools.ResponseJson;
 import net.sf.json.JSONArray;
@@ -62,6 +63,8 @@ public class AdminProduceController {
     @RequestMapping("/to_save_produce")
     public ModelAndView goSaveProduce(HttpServletRequest request) {
         ModelAndView mv = new ModelAndView("pts/produce/save_produce");
+        List<WechatMp> listWechatMp = produceService.listWechatMp();
+        mv.addObject("listWechatMp",listWechatMp);
         return mv;
     }
 
@@ -118,6 +121,10 @@ public class AdminProduceController {
             producePro.setNodes(processNodeList);
         }
         produce.setProcess(produceProcessList);
+
+        List<WechatMp> listWechatMp = produceService.listWechatMp();
+        mv.addObject("listWechatMp",listWechatMp);
+
         mv.addObject("produce", produce);
         return mv;
     }

+ 10 - 0
watero-rst-web/src/main/webapp/WEB-INF/views/pts/produce/save_produce.ftl

@@ -50,6 +50,15 @@
                         <option value="D">其他(D)</option>
                     </select>
                 </div>
+                <div class="input-box "><span class="input-dic">所属公众号</span>
+                    <select class="" style="width: 290px;" id="wechatMpId" name="wechatMpId">
+                    <#if (listWechatMp?size > 0)>
+                        <#list listWechatMp as list>
+                        <option value="${list.wechatMpId!''}">${list.wechatMpName!''}</option>
+                        </#list>
+                    </#if>
+                    </select>
+                </div>
                 <div class="input-box"><span class="input-dic">产品型号</span><input class="my-input" style="width: 120px;" type="text" name="producePattern" id="producePattern" value="" placeholder="1-3位英文、数字组合" required  maxlength="3" minlength="1"/>-<input class="my-input" style="width: 120px;" type="text" name="produceModel" id="produceModel" value="" placeholder="1-3位英文、数字组合" required  maxlength="3" minlength="1"/>  </div>
 
                 <div class="input-box"><span class="input-dic">产品类型</span>
@@ -214,6 +223,7 @@
         produce.produceFeature = $("[name='produceFeature']").val();//获取产品特性
         produce.producePattern = $("[name='producePattern']").val();//产品型号
         produce.produceModel = $("[name='produceModel']").val();//产品型号
+        produce.wechatMpId = $("[name='wechatMpId']").val();//公众号id
         return produce;
     }
 

+ 12 - 0
watero-rst-web/src/main/webapp/WEB-INF/views/pts/produce/update_produce.ftl

@@ -50,6 +50,17 @@
                     <option value ="D" <#if produce.produceFeature??><#if produce.produceFeature == 'D'>selected="selected"</#if></#if>>其他(D)</option>
                 </select>
             </div>
+
+            <div class="input-box "><span class="input-dic">所属公众号</span>
+                <select class="" style="width: 290px;" id="wechatMpId" name="wechatMpId">
+                <#if (listWechatMp?size > 0)>
+                    <#list listWechatMp as list>
+                        <option value="${list.wechatMpId!''}" <#if produce.wechatMpId??><#if produce.wechatMpId == list.wechatMpId>selected="selected"</#if></#if> >${list.wechatMpName!''}</option>
+                    </#list>
+                </#if>
+                </select>
+            </div>
+
             <div class="input-box"><span class="input-dic">产品型号</span><input class="my-input" style="width: 120px;" type="text" name="producePattern" id="producePattern" placeholder="1-3位英文、数字组合" value="${produce.producePattern!}" placeholder="" required  maxlength="3" minlength="1"/>-
                 <input class="my-input" style="width: 120px;" type="text" name="produceModel" id="produceModel" value="${produce.produceModel!}" placeholder="1-3位英文、数字组合" required  maxlength="3" minlength="1"/>  </div>
 
@@ -234,6 +245,7 @@
         produce.produceFeature = $("[name='produceFeature']").val();//获取产品特性
         produce.producePattern = $("[name='producePattern']").val();//产品型号
         produce.produceModel = $("[name='produceModel']").val();//产品型号
+        produce.wechatMpId = $("[name='wechatMpId']").val();//公众号id
 
         produce.delProcessIds = delProcessIds;    //需要删除的工序id
         produce.delNodeIds = delNodeIds;           //需要删除的工序操作id