Commit 8e858eb8 authored by 谢希宇's avatar 谢希宇

Submit by Strive

Submit Date 2021/03/09
parent b852f6c2
...@@ -91,7 +91,7 @@ ...@@ -91,7 +91,7 @@
id="sendCheckNo" name="sendCheckNo" id="sendCheckNo" name="sendCheckNo"
placeholder="送检编号" placeholder="送检编号"
value="$!{data.sendCheckNo}" value="$!{data.sendCheckNo}"
#if($!{pageType} == 'true') readonly="readonly" #end /> #if($!{pageType} == 'true') readonly="readonly" #elseif($!{edit} == 'true') readonly="readonly" #end />
</div> </div>
<div class="form-group form-md-line-input col-xs-6"> <div class="form-group form-md-line-input col-xs-6">
...@@ -196,7 +196,7 @@ ...@@ -196,7 +196,7 @@
<label for="result">检测结果</label> <label for="result">检测结果</label>
<textarea class="form-control" rows="3" id="result" name="result" <textarea class="form-control" rows="3" id="result" name="result"
value="$!{data.result}" #if($!{pageType}== 'true') value="$!{data.result}" #if($!{pageType}== 'true')
readonly="readonly" #end></textarea> readonly="readonly" #end>$!{data.result}</textarea>
</div> </div>
<div class="form-group form-md-line-input col-md-12" id="img"> <div class="form-group form-md-line-input col-md-12" id="img">
...@@ -370,6 +370,14 @@ ...@@ -370,6 +370,14 @@
location.href = "#springUrl('/a/checkresult/list')"; location.href = "#springUrl('/a/checkresult/list')";
} }
}); });
} else if (returnobj.errorNo == 3) {
Cfapp.alert({
message: "送检编码已存在",
btntext: "确定",
success: function () {
location.href = "#springUrl('/a/checkresult/list')";
}
});
} else { } else {
Cfapp.alert({ Cfapp.alert({
message: "创建失败", message: "创建失败",
......
...@@ -69,7 +69,6 @@ ...@@ -69,7 +69,6 @@
</ol> </ol>
</section> </section>
<!-- Main content --> <!-- Main content -->
<section class="content"> <section class="content">
<div class="row"> <div class="row">
...@@ -90,7 +89,8 @@ ...@@ -90,7 +89,8 @@
<div class="col-xs-5"> <div class="col-xs-5">
<button type="button" class="search btn btn-primary">搜索</button> <button type="button" class="search btn btn-primary">搜索</button>
#if($shiro.hasPermission("qy:checkresult:edit")) #if($shiro.hasPermission("qy:checkresult:edit"))
<a href="#springUrl('/a/checkresult/form')?pageType=Edit" class="btn btn-primary">新增</a> <a href="#springUrl('/a/checkresult/form')?pageType=Edit"
class="btn btn-primary">新增</a>
<a href="#springUrl('/a/checkresult/exportExcel')" class="btn btn-primary">导出</a> <a href="#springUrl('/a/checkresult/exportExcel')" class="btn btn-primary">导出</a>
<a onclick="importExcel();" class="btn btn-primary">导入</a> <a onclick="importExcel();" class="btn btn-primary">导入</a>
#end #end
...@@ -247,21 +247,21 @@ ...@@ -247,21 +247,21 @@
"aTargets": [4], "aTargets": [4],
"mData": "checkDate", "mData": "checkDate",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
return formatDates(a, "yyyy-MM-dd HH:mm:ss"); return formatDates(a, "yyyy-MM-dd HH:mm:ss");
} }
}, },
{ {
"aTargets": [5], "aTargets": [5],
"mData": "reagentVerifDate", "mData": "reagentVerifDate",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
return formatDates(a, "yyyy-MM-dd HH:mm:ss"); return formatDates(a, "yyyy-MM-dd HH:mm:ss");
} }
}, },
{ {
"aTargets": [6], "aTargets": [6],
"mData": "createTime", "mData": "createTime",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
return formatDates(a, "yyyy-MM-dd HH:mm:ss"); return formatDates(a, "yyyy-MM-dd HH:mm:ss");
} }
}, },
{ {
...@@ -276,8 +276,8 @@ ...@@ -276,8 +276,8 @@
'</button>' + '</button>' +
'<ul class="dropdown-menu" role="menu" style="min-width: 100px;">'; '<ul class="dropdown-menu" role="menu" style="min-width: 100px;">';
html += '<li>#if($shiro.hasPermission("qy:checkresult:view"))<a href="#springUrl("/a/checkresult/form?pageType=View&id=' + a + '")" class="btn green">查看</a>#end</li>'; html += '<li>#if($shiro.hasPermission("qy:checkresult:view"))<a href="#springUrl("/a/checkresult/form?pageType=View&id=' + a + '")" class="btn green">查看</a>#end</li>';
html += '<li>#if($shiro.hasPermission("qy:checkresult:edit"))<a href="#springUrl("/a/checkresult/form?pageType=Edit&id=' + a + '")" class="btn green">修改</a>#end</li>'; html += '<li>#if($shiro.hasPermission("qy:checkresult:edit"))<a href="#springUrl("/a/checkresult/form?pageType=Edit&edit=Edit&id=' + a + '")" class="btn green">修改</a>#end</li>';
html += '<li>#if($shiro.hasPermission("qy:checkresult:edit"))<a href="javascript:void(0)" onclick="removeData('+a+')" class="btn green">删除</a>#end</li>'; html += '<li>#if($shiro.hasPermission("qy:checkresult:edit"))<a href="javascript:void(0)" onclick="removeData(' + a + ')" class="btn green">删除</a>#end</li>';
html += '</ul></div>'; html += '</ul></div>';
return html; return html;
} }
...@@ -313,9 +313,11 @@ ...@@ -313,9 +313,11 @@
$.ajax({ $.ajax({
type: "POST", type: "POST",
url: "#springUrl('/a/checkresult/delete')", url: "#springUrl('/a/checkresult/delete')",
data: {id: data, data: {
id: data,
_csrfheader: csrfheader.value, _csrfheader: csrfheader.value,
_csrf: csrftoken.value}, _csrf: csrftoken.value
},
dataType: "json", dataType: "json",
success: function (data) { success: function (data) {
if (data.errorNo == 0) { if (data.errorNo == 0) {
...@@ -354,8 +356,6 @@ ...@@ -354,8 +356,6 @@
}); });
} }
</script> </script>
</body> </body>
</html> </html>
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
<result column="create_by" property="createBy"/> <result column="create_by" property="createBy"/>
<result column="update_by" property="updateBy"/> <result column="update_by" property="updateBy"/>
<result column="name" property="name"/> <result column="name" property="name"/>
<result column="verifDate" property="verifDate"/>
</resultMap> </resultMap>
<sql id="sqlWhere"> <sql id="sqlWhere">
...@@ -165,9 +166,10 @@ ...@@ -165,9 +166,10 @@
<select id="fetchSearchByPage" parameterType="java.util.Map" resultMap="resultMap"> <select id="fetchSearchByPage" parameterType="java.util.Map" resultMap="resultMap">
SELECT SELECT
<include refid="sqlColumns"/>, f.nickname name <include refid="sqlColumns"/>, CONVERT(AES_DECRYPT(f.nickname,'aideakey') USING UTF8) name, cr.verif_date verifDate
FROM t_aidea_check_result t FROM t_aidea_check_result t
LEFT JOIN wx_mp_fanss f ON t.openid = f.openid AND f.delflag = '0' LEFT JOIN wx_mp_fanss f ON t.openid = f.openid AND f.delflag = '0'
LEFT JOIN t_aidea_coupon_record cr ON t.send_check_no = cr.number
<include refid="sqlWhere"/> <include refid="sqlWhere"/>
<if test="sort!=null">ORDER BY ${sort.param} ${sort.type}</if> <if test="sort!=null">ORDER BY ${sort.param} ${sort.type}</if>
<if test="limit>0">limit #{offset},#{limit}</if> <if test="limit>0">limit #{offset},#{limit}</if>
...@@ -274,10 +276,12 @@ ...@@ -274,10 +276,12 @@
limit #{page}, #{pageSize} limit #{page}, #{pageSize}
</if> </if>
</select> </select>
<select id="checkCouponByNumber" parameterType="java.lang.String" resultMap="resultMap"> <select id="checkCouponByNumber" parameterType="java.lang.String" resultMap="resultMap">
SELECT SELECT
<include refid="sqlColumns"/> <include refid="sqlColumns"/>
FROM t_aidea_check_result t FROM t_aidea_check_result t
WHERE t.send_Check_No=#{number} AND t.del_flag = 0 WHERE t.send_Check_No=#{number} AND t.del_flag = 0
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -88,6 +88,9 @@ public class Checkresult implements Serializable { ...@@ -88,6 +88,9 @@ public class Checkresult implements Serializable {
private String checkDateStr; private String checkDateStr;
private String reagentVerifDateStr; private String reagentVerifDateStr;
private Date verifDate;//核销时间、检测时间
public Checkresult() { public Checkresult() {
this.delFlag = false; this.delFlag = false;
this.status = "0"; this.status = "0";
......
...@@ -39,4 +39,11 @@ public interface CheckresultService extends GenericService<Checkresult> { ...@@ -39,4 +39,11 @@ public interface CheckresultService extends GenericService<Checkresult> {
* @return * @return
**/ **/
JSONObject checkCouponByNumber(CouponrecordVo vo); JSONObject checkCouponByNumber(CouponrecordVo vo);
/**
* @Author Strive 推送患者检测结果
* @param checkresult
* @return
*/
boolean sendCheckResultMsg(Checkresult checkresult);
} }
package com.cftech.checkresult.service.impl; package com.cftech.checkresult.service.impl;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.cftech.accounts.model.MpAccountsEntity;
import com.cftech.accounts.service.MpAccountsService; import com.cftech.accounts.service.MpAccountsService;
import com.cftech.checkresult.model.Checkresult; import com.cftech.checkresult.model.Checkresult;
import com.cftech.checkresult.dao.CheckresultMapper; import com.cftech.checkresult.dao.CheckresultMapper;
...@@ -10,7 +9,15 @@ import com.cftech.checkresult.service.CheckresultService; ...@@ -10,7 +9,15 @@ import com.cftech.checkresult.service.CheckresultService;
import com.cftech.core.generic.GenericDao; import com.cftech.core.generic.GenericDao;
import com.cftech.core.generic.GenericServiceImpl; import com.cftech.core.generic.GenericServiceImpl;
import com.cftech.core.sql.Conds; import com.cftech.core.sql.Conds;
import com.cftech.core.util.Constants;
import com.cftech.core.util.DateFormatUtils;
import com.cftech.core.util.MpTokenUtil;
import com.cftech.core.util.SystemConfig;
import com.cftech.couponrecord.model.CouponrecordVo; import com.cftech.couponrecord.model.CouponrecordVo;
import com.google.gson.Gson;
import org.mp.api.core.req.model.message.IndustryTemplateMessageSend;
import org.mp.api.core.req.model.message.TemplateData;
import org.mp.api.wxsendmsg.JwTemplateMessageAPI;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -19,31 +26,34 @@ import java.util.List; ...@@ -19,31 +26,34 @@ import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
* 检测结果管理ServiceImpl * 检测结果管理ServiceImpl
* *
* @author Strive * @author Strive
* @date: 2021-01-27 17:19 * @date: 2021-01-27 17:19
*/ */
@Service("checkresultService") @Service("checkresultService")
public class CheckresultServiceImpl extends GenericServiceImpl<Checkresult> implements CheckresultService { public class CheckresultServiceImpl extends GenericServiceImpl<Checkresult> implements CheckresultService {
@Autowired @Autowired
@Qualifier("checkresultMapper") @Qualifier("checkresultMapper")
private CheckresultMapper checkresultMapper; private CheckresultMapper checkresultMapper;
@Autowired @Autowired
private MpAccountsService mpAccountsService; private MpAccountsService mpAccountsService;
@Override @Autowired
public GenericDao<Checkresult> getGenericMapper() { private MpTokenUtil mpTokenUtil;
return checkresultMapper;
}
public JSONObject checkResultsList(CheckresultVo vo){ @Override
public GenericDao<Checkresult> getGenericMapper() {
return checkresultMapper;
}
public JSONObject checkResultsList(CheckresultVo vo) {
JSONObject rtnJson = new JSONObject(); JSONObject rtnJson = new JSONObject();
try { try {
List<Map<String,Object>> consultResult = checkresultMapper.checkResultsList(vo); List<Map<String, Object>> consultResult = checkresultMapper.checkResultsList(vo);
if (consultResult != null&&consultResult.size()>0) { if (consultResult != null && consultResult.size() > 0) {
rtnJson.put("errorNo", 0); rtnJson.put("errorNo", 0);
rtnJson.put("data", consultResult); rtnJson.put("data", consultResult);
} else { } else {
...@@ -57,7 +67,8 @@ return checkresultMapper; ...@@ -57,7 +67,8 @@ return checkresultMapper;
} }
return rtnJson; return rtnJson;
} }
public JSONObject fetchById(CheckresultVo vo){
public JSONObject fetchById(CheckresultVo vo) {
JSONObject rtnJson = new JSONObject(); JSONObject rtnJson = new JSONObject();
try { try {
Checkresult info = checkresultMapper.fetchById(vo.getId()); Checkresult info = checkresultMapper.fetchById(vo.getId());
...@@ -76,10 +87,10 @@ return checkresultMapper; ...@@ -76,10 +87,10 @@ return checkresultMapper;
return rtnJson; return rtnJson;
} }
public JSONObject checkCouponByNumber(CouponrecordVo vo){ public JSONObject checkCouponByNumber(CouponrecordVo vo) {
JSONObject rtnJson = new JSONObject(); JSONObject rtnJson = new JSONObject();
try { try {
com.cftech.checkresult.model.Checkresult info =checkresultMapper.checkCouponByNumber(vo.getNumber()); com.cftech.checkresult.model.Checkresult info = checkresultMapper.checkCouponByNumber(vo.getNumber());
if (info != null) { if (info != null) {
rtnJson.put("errorCode", 0); rtnJson.put("errorCode", 0);
rtnJson.put("data", info); rtnJson.put("data", info);
...@@ -95,4 +106,68 @@ return checkresultMapper; ...@@ -95,4 +106,68 @@ return checkresultMapper;
return rtnJson; return rtnJson;
} }
@Override
public boolean sendCheckResultMsg(Checkresult result) {
try {
Conds conds = new Conds();
conds.equal("t.del_flag", Constants.DEL_FLAG_0);
conds.equal("t.id", result.getId());
Checkresult checkresult = this.fetchSearchByConds(conds);
String appid = SystemConfig.p.getProperty("WX_MP_SERVER_APPID");
String token = mpTokenUtil.getToken(mpAccountsService.getMpAccountsAppid(appid));
String refuseTmpId = SystemConfig.p.getProperty("CHECK_RESULT_TEMPLATE_MSG");
String first = "您好,您的检测已出结果。";
String remark = "点击“详情”查看详细报告";
String[] keywords = { checkresult.getCheckProject(),//检测项目
checkresult.getCheckMethod(),//检测类型
DateFormatUtils.getDateFormat(checkresult.getVerifDate(), "yyyy年MM月dd日"),//检测券核销时间
remark};//检测结果
String url = SystemConfig.p.getProperty("MOBILE_MP_DOMAIN_NAME") + "/bzgldetails?appid="+appid+"&tokenId=1&id="+checkresult.getId();
sendMessage(refuseTmpId, token, checkresult.getOpenid(), first, remark, keywords, url);
} catch (Exception e) {
e.printStackTrace();
return false;
}
return true;
}
private void sendMessage(String templateId, String token, String openId, String first, String remark, String [] keywords, String url){
IndustryTemplateMessageSend mc = new IndustryTemplateMessageSend();
mc.setTemplate_id(templateId);
mc.setTouser(openId);
mc.setAccess_token(token);
mc.setUrl(url);
StringBuffer json = new StringBuffer();
Gson gson = new Gson();
String objJson = gson.toJson(mc);
json.append(objJson);
json.setLength(json.length()-1);
json.append(",");
json.append("\"data\":{");
TemplateData template = new TemplateData();
template.setValue(first);
//template.setColor("#ffAADD");
objJson = gson.toJson(template);
json.append(" \"first\":");
json.append(objJson);
json.append(",");
if(keywords!=null && keywords.length>0){
for(int i=0;i<keywords.length;i++){
template.setValue(keywords[i]);
objJson = gson.toJson(template);
json.append(" \"keyword"+(i+1)+"\":");
json.append(objJson);
json.append(",");
}
}
template.setValue(remark);
objJson = gson.toJson(template);
json.append(" \"remark\":");
json.append(objJson);
json.append("}}");
JwTemplateMessageAPI.sendTemplateMsgJson(json.toString(),token);
}
} }
\ No newline at end of file
...@@ -69,12 +69,13 @@ public class CheckresultController { ...@@ -69,12 +69,13 @@ public class CheckresultController {
//编辑页面(新增、修改) //编辑页面(新增、修改)
@RequiresPermissions(value = CHECKRESULT_VIEW) @RequiresPermissions(value = CHECKRESULT_VIEW)
@RequestMapping("/form") @RequestMapping("/form")
public String form(HttpServletRequest request, String id, Model model, String pageType) { public String form(HttpServletRequest request, String id, Model model, String pageType, String edit) {
if (!StringUtils.isEmpty(id)) { if (!StringUtils.isEmpty(id)) {
Checkresult checkresult = checkresultService.fetchById(id); Checkresult checkresult = checkresultService.fetchById(id);
model.addAttribute("data", checkresult); model.addAttribute("data", checkresult);
} }
model.addAttribute("pageType", pageType.equals("View") ? true : false);//是否查看页面 model.addAttribute("pageType", pageType.equals("View") ? true : false);//是否查看页面
model.addAttribute("edit", StringUtils.equals(edit, "Edit") ? true : false);
return "checkresult/checkresultform"; return "checkresult/checkresultform";
} }
...@@ -107,6 +108,17 @@ public class CheckresultController { ...@@ -107,6 +108,17 @@ public class CheckresultController {
checkresultService.update(checkresult); checkresultService.update(checkresult);
rtnJson.put("errorNo", 0); rtnJson.put("errorNo", 0);
} else { } else {
//新增验证送检编码不可重复
Conds conds = new Conds();
conds.equal("t.del_flag", Constants.DEL_FLAG_0);
conds.equal("t.send_check_no", checkresult.getSendCheckNo());
List<Checkresult> checkresultList = checkresultService.fetchSearchByPage(conds, null, 0, 0);
if (checkresultList != null && checkresultList.size() > 0) {
rtnJson.put("errorNo", 3);
rtnJson.put("errorMsg", "送检编码已存在!");
return rtnJson;
}
//设置检测结果系统编码 //设置检测结果系统编码
checkresult.setNumber(codingruleUtils.getNumber(accountsId, Checkresult.class.getName())); checkresult.setNumber(codingruleUtils.getNumber(accountsId, Checkresult.class.getName()));
checkresult.setAccountsId(accountsId); checkresult.setAccountsId(accountsId);
...@@ -114,7 +126,11 @@ public class CheckresultController { ...@@ -114,7 +126,11 @@ public class CheckresultController {
checkresult.setAccountsId(UserUtils.getmpaccounts(request)); checkresult.setAccountsId(UserUtils.getmpaccounts(request));
checkresult.setCreateBy(UserUtils.getUser().getId()); checkresult.setCreateBy(UserUtils.getUser().getId());
checkresult.setUpdateBy(UserUtils.getUser().getId()); checkresult.setUpdateBy(UserUtils.getUser().getId());
checkresultService.save(checkresult); if (checkresultService.save(checkresult)) {
//推送检测结果
checkresultService.sendCheckResultMsg(checkresult);
}
rtnJson.put("errorNo", 2); rtnJson.put("errorNo", 2);
} }
} catch (Exception e) { } catch (Exception e) {
...@@ -135,8 +151,8 @@ public class CheckresultController { ...@@ -135,8 +151,8 @@ public class CheckresultController {
if (StringUtils.isNoneBlank(checkresult.getName())) { if (StringUtils.isNoneBlank(checkresult.getName())) {
conds.like("t.name", checkresult.getName()); conds.like("t.name", checkresult.getName());
} }
if (StringUtils.isNoneBlank(checkresult.getCheckNo())) { if (StringUtils.isNoneBlank(checkresult.getSendCheckNo())) {
conds.like("t.chech_no", checkresult.getCheckNo()); conds.like("t.send_check_no", checkresult.getSendCheckNo());
} }
Sort sort = new Sort("t.create_time", OrderType.DESC); Sort sort = new Sort("t.create_time", OrderType.DESC);
...@@ -166,12 +182,18 @@ public class CheckresultController { ...@@ -166,12 +182,18 @@ public class CheckresultController {
@RequestMapping("/exportExcel") @RequestMapping("/exportExcel")
@RequiresPermissions(value = CHECKRESULT_VIEW) @RequiresPermissions(value = CHECKRESULT_VIEW)
public void exportExcel(HttpServletRequest request, HttpServletResponse response) { public void exportExcel(HttpServletRequest request, HttpServletResponse response, Checkresult checkresult) {
Long accountId = UserUtils.getmpaccounts(request); Long accountId = UserUtils.getmpaccounts(request);
Sort sort = new Sort("t.create_time", OrderType.ASC); Sort sort = new Sort("t.create_time", OrderType.ASC);
Conds conds = new Conds(); Conds conds = new Conds();
conds.equal("t.del_flag", 0); conds.equal("t.del_flag", 0);
conds.equal("t.accounts_id", accountId); conds.equal("t.accounts_id", accountId);
if (StringUtils.isNoneBlank(checkresult.getName())) {
conds.like("t.name", checkresult.getName());
}
if (StringUtils.isNoneBlank(checkresult.getSendCheckNo())) {
conds.like("t.send_check_no", checkresult.getSendCheckNo());
}
List<Checkresult> list = checkresultService.fetchSearchByPage(conds, sort, 0, 0); List<Checkresult> list = checkresultService.fetchSearchByPage(conds, sort, 0, 0);
ExcelKit.$Export(Checkresult.class, response).toExcel(list, "检测结果管理信息"); ExcelKit.$Export(Checkresult.class, response).toExcel(list, "检测结果管理信息");
} }
...@@ -202,14 +224,23 @@ public class CheckresultController { ...@@ -202,14 +224,23 @@ public class CheckresultController {
file.transferTo(storeFile); file.transferTo(storeFile);
ExcelKit.$Import().setEmptyCellValue("").readExcel(storeFile, rowData -> { ExcelKit.$Import().setEmptyCellValue("").readExcel(storeFile, rowData -> {
if (StringUtils.isNoneBlank(rowData.get(0))) { if (StringUtils.isNoneBlank(rowData.get(0))) {
Checkresult checkresult = new Checkresult();
Conds resultConds = new Conds();
resultConds.equal("t.del_flag", Constants.DEL_FLAG_0);
resultConds.equal("t.send_check_no", rowData.get(0));
Checkresult checkresult = checkresultService.fetchSearchByConds(resultConds);
if (checkresult == null) {
checkresult = new Checkresult();
checkresult.setNumber(codingruleUtils.getNumber(accountId, Checkresult.class.getName()));
}
checkresult.setAccountsId(accountId); checkresult.setAccountsId(accountId);
checkresult.setNumber(codingruleUtils.getNumber(accountId, Checkresult.class.getName()));
//设置检测人员 //设置检测人员
Conds conds = new Conds(); Conds conds = new Conds();
conds.equal("del_flag", Constants.DEL_FLAG_0); conds.equal("t.del_flag", Constants.DEL_FLAG_0);
conds.equal("number", checkresult.getSendCheckNo()); conds.equal("t.number", checkresult.getSendCheckNo());
Couponrecord couponrecord = couponrecordService.fetchSearchByConds(conds); Couponrecord couponrecord = couponrecordService.fetchSearchByConds(conds);
if (couponrecord != null) { if (couponrecord != null) {
checkresult.setOpenid(couponrecord.getOpenid()); checkresult.setOpenid(couponrecord.getOpenid());
...@@ -231,7 +262,12 @@ public class CheckresultController { ...@@ -231,7 +262,12 @@ public class CheckresultController {
checkresult.setUnit(rowData.get(9)); checkresult.setUnit(rowData.get(9));
checkresult.setInstrument(rowData.get(10)); checkresult.setInstrument(rowData.get(10));
checkresult.setResult(rowData.get(11)); checkresult.setResult(rowData.get(11));
checkresultService.save(checkresult);
if (checkresult.getId() == null) {
checkresultService.save(checkresult);
} else {
checkresultService.update(checkresult);
}
} }
}); });
} catch (IOException e) { } catch (IOException e) {
......
...@@ -88,14 +88,15 @@ ...@@ -88,14 +88,15 @@
</div> </div>
<div class="col-xs-2"> <div class="col-xs-2">
<select id="isThree" name="isThree" class="form-control required"> <select id="isThree" name="isThree" class="form-control required">
<option value="">请选择患者类型</option> <option value="">请选择患者类型</option>
<option value="3">三期患者</option> <option value="3">三期患者</option>
<option value="4">四期患者</option>
</select> </select>
</div> </div>
<div class="col-xs-2"> <div class="col-xs-2">
<select id="status" name="status" class="form-control required"> <select id="status" name="status" class="form-control required">
<option value="">请选择审核状态</option> <option value="">请选择审核状态</option>
<option value="0" selected>待审核</option> <option value="0" selected>待审核</option>
<option value="1">已通过</option> <option value="1">已通过</option>
...@@ -104,10 +105,10 @@ ...@@ -104,10 +105,10 @@
</div> </div>
<div class="col-xs-2"> <div class="col-xs-2">
<select id="serviceId" name="serviceId" class="form-control required"> <select id="serviceId" name="serviceId" class="form-control required">
<option value="">请选择客服</option> <option value="">请选择客服</option>
#foreach($qyuser in $cusServices) #foreach($qyuser in $cusServices)
<option value="$!{qyuser.id}">$!{qyuser.name}</option> <option value="$!{qyuser.id}">$!{qyuser.name}</option>
#end #end
</select> </select>
</div> </div>
...@@ -175,7 +176,7 @@ ...@@ -175,7 +176,7 @@
<th>订单编码</th> <th>订单编码</th>
<th>用药人姓名</th> <th>用药人姓名</th>
<th>别名</th> <th>别名</th>
<!-- <th>性别</th>--> <!-- <th>性别</th>-->
<!-- <th>联系电话</th>--> <!-- <th>联系电话</th>-->
<th>是否购药</th> <th>是否购药</th>
<th>三期患者</th> <th>三期患者</th>
...@@ -240,7 +241,7 @@ ...@@ -240,7 +241,7 @@
var hour = now.getHours(); var hour = now.getHours();
var minute = now.getMinutes(); var minute = now.getMinutes();
var second = now.getSeconds(); var second = now.getSeconds();
return year + "-" + month + "-" + date + " " + hour + ":" + minute + ":" + second; return year + "-" + month + "-" + date + " " + hour + ":" + minute + ":" + second;
} }
function seachTable() { function seachTable() {
...@@ -422,9 +423,9 @@ ...@@ -422,9 +423,9 @@
"aTargets": [5], "aTargets": [5],
"mData": "isSales", "mData": "isSales",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
if (a == '1') { if (a == '4') {
return '是'; return '是';
} else if (a == '0') { } else {
return '否'; return '否';
} }
} }
...@@ -437,7 +438,7 @@ ...@@ -437,7 +438,7 @@
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
if (a == '0') { if (a == '0') {
return '三期'; return '三期';
} else if (a == '1') { } else if (a == '1') {
return '四期'; return '四期';
} else { } else {
return ''; return '';
...@@ -501,7 +502,8 @@ ...@@ -501,7 +502,8 @@
"mData": "createTime", "mData": "createTime",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
if (a) { if (a) {
return moment(a).format('YYYY-MM-DD HH:mm:ss');; return moment(a).format('YYYY-MM-DD HH:mm:ss');
;
} else { } else {
return null; return null;
} }
...@@ -611,10 +613,10 @@ ...@@ -611,10 +613,10 @@
} }
function clearSearch() { function clearSearch() {
$("#seachTableForm input").each(function() { $("#seachTableForm input").each(function () {
$(this).val(''); $(this).val('');
}); });
$("select").each(function() { $("select").each(function () {
$(this).find("option[value='']").prop("selected", true); $(this).find("option[value='']").prop("selected", true);
}); });
$("#table").dataTable().fnClearTable(); $("#table").dataTable().fnClearTable();
......
...@@ -217,7 +217,7 @@ ...@@ -217,7 +217,7 @@
SELECT SELECT
<include refid="sqlColumns"/>, <include refid="sqlColumns"/>,
o.number orderCode, au.status isThree, o.number orderCode, au.status isThree,
CASE WHEN o.status = '2' OR o.status = '3' OR o.status = '4' THEN 1 ELSE 0 END isSales, (SELECT status FROM t_order sales WHERE sales.del_flag = '0' AND sales.status = '4' AND sales.openid = a.open_id LIMIT 1) isSales,
f.store fansAlias f.store fansAlias
FROM t_aidea_consult_sheet a FROM t_aidea_consult_sheet a
LEFT JOIN t_order o ON a.order_id = o.id LEFT JOIN t_order o ON a.order_id = o.id
......
...@@ -141,8 +141,11 @@ public class ConsultSheetServiceImpl extends GenericServiceImpl<ConsultSheet> im ...@@ -141,8 +141,11 @@ public class ConsultSheetServiceImpl extends GenericServiceImpl<ConsultSheet> im
//展示客服二维码 //展示客服二维码
Qyuser serviceCus = qyuserService.fetchById(consultSheet.getServiceId()); Qyuser serviceCus = qyuserService.fetchById(consultSheet.getServiceId());
JSONObject serviceCusObj = new JSONObject();
serviceCusObj.put("qrcode", serviceCus.getQrcode());
serviceCusObj.put("alias", serviceCus.getStoreName());
retObj.put("errorNo", 0); retObj.put("errorNo", 0);
retObj.put("data", serviceCus.getDescription()); retObj.put("data", serviceCusObj);
retObj.put("errorMsg", "咨询单提交成功,请等待药师审核"); retObj.put("errorMsg", "咨询单提交成功,请等待药师审核");
} else { } else {
retObj.put("errorNo", 1); retObj.put("errorNo", 1);
...@@ -190,7 +193,7 @@ public class ConsultSheetServiceImpl extends GenericServiceImpl<ConsultSheet> im ...@@ -190,7 +193,7 @@ public class ConsultSheetServiceImpl extends GenericServiceImpl<ConsultSheet> im
conds.equal("o.openid", openid); conds.equal("o.openid", openid);
conds.in("o.status", new String[]{"4"});// 4:已成交 conds.in("o.status", new String[]{"4"});// 4:已成交
Sort sort = new Sort("o.create_time", OrderType.DESC); Sort sort = new Sort("o.create_time", OrderType.DESC);
List<Order> orders = orderService.fetchSearchBy(conds, sort, 0, 0, null, "0", "0"); List<Order> orders = orderService.fetchSearchBy(conds, sort, 0, 0, null, null, null);
if (orders != null && orders.size() > 0 && orders.get(0) != null) { //复购 if (orders != null && orders.size() > 0 && orders.get(0) != null) { //复购
Order order = orders.get(0); Order order = orders.get(0);
......
...@@ -198,6 +198,8 @@ public class ConsultSheetController { ...@@ -198,6 +198,8 @@ public class ConsultSheetController {
} }
if (StringUtils.equals(consultSheet.getIsThree(), "3")) { if (StringUtils.equals(consultSheet.getIsThree(), "3")) {
conds.equal("au.status", "0"); conds.equal("au.status", "0");
} else if (StringUtils.equals(consultSheet.getIsThree(), "4")) {
conds.equal("au.status", "1");
} }
if (StringUtils.isNoneBlank(consultSheet.getStatus())) { if (StringUtils.isNoneBlank(consultSheet.getStatus())) {
conds.equal("a.status", consultSheet.getStatus()); conds.equal("a.status", consultSheet.getStatus());
...@@ -253,8 +255,18 @@ public class ConsultSheetController { ...@@ -253,8 +255,18 @@ public class ConsultSheetController {
Long accountId = UserUtils.getmpaccounts(request); Long accountId = UserUtils.getmpaccounts(request);
Sort sort = new Sort("a.create_time", OrderType.ASC); Sort sort = new Sort("a.create_time", OrderType.ASC);
Conds conds = new Conds(); Conds conds = new Conds();
conds.equal("a.del_flag", Constants.DEL_FLAG_0);
conds.equal("a.accounts_id", accountId);
if (StringUtils.isNoneBlank(consultSheet.getConsultId())) { if (StringUtils.isNoneBlank(consultSheet.getConsultId())) {
conds.like("a.consult_id", "%" + consultSheet.getConsultId() + "%"); conds.like("a.consult_id", consultSheet.getConsultId());
}
if (StringUtils.isNoneBlank(consultSheet.getFansAlias())) {
conds.like("f.store", consultSheet.getFansAlias());
}
if (StringUtils.equals(consultSheet.getIsThree(), "3")) {
conds.equal("au.status", "0");
} else if (StringUtils.equals(consultSheet.getIsThree(), "4")) {
conds.equal("au.status", "1");
} }
if (StringUtils.isNoneBlank(consultSheet.getStatus())) { if (StringUtils.isNoneBlank(consultSheet.getStatus())) {
conds.equal("a.status", consultSheet.getStatus()); conds.equal("a.status", consultSheet.getStatus());
...@@ -274,8 +286,9 @@ public class ConsultSheetController { ...@@ -274,8 +286,9 @@ public class ConsultSheetController {
if (StringUtils.isNoneBlank(consultSheet.getEndAuditTime())) { if (StringUtils.isNoneBlank(consultSheet.getEndAuditTime())) {
conds.lessEqual("DATE_FORMAT(a.audit_time, '%Y-%m-%d')", consultSheet.getEndAuditTime()); conds.lessEqual("DATE_FORMAT(a.audit_time, '%Y-%m-%d')", consultSheet.getEndAuditTime());
} }
conds.equal("a.del_flag", Constants.DEL_FLAG_0); if (StringUtils.isNoneBlank(consultSheet.getOpenId())) {
conds.equal("a.accounts_id", accountId); conds.equal("a.open_id", consultSheet.getOpenId());
}
List<ConsultSheet> list = consultSheetService.fetchSearchByPage(conds, sort, 0, 0); List<ConsultSheet> list = consultSheetService.fetchSearchByPage(conds, sort, 0, 0);
List<ConsultSheetVO> consultSheetVOS = new LinkedList<>(); List<ConsultSheetVO> consultSheetVOS = new LinkedList<>();
......
...@@ -123,7 +123,7 @@ ...@@ -123,7 +123,7 @@
<select id="fetchById" parameterType="java.lang.Long" resultMap="resultMap"> <select id="fetchById" parameterType="java.lang.Long" resultMap="resultMap">
SELECT SELECT
<include refid="sqlColumns"/>, c.name couponName, f.nickname nickName, h.name hospitalName <include refid="sqlColumns"/>, c.name couponName, CONVERT(AES_DECRYPT(f.nickname,'aideakey') USING UTF8) nickName, h.name hospitalName
FROM t_aidea_coupon_record t FROM t_aidea_coupon_record t
LEFT JOIN t_aidea_check_coupon c ON t.coupon_id = c.id LEFT JOIN t_aidea_check_coupon c ON t.coupon_id = c.id
LEFT JOIN wx_mp_fanss f ON f.openid = t.openid AND f.delflag = '0' LEFT JOIN wx_mp_fanss f ON f.openid = t.openid AND f.delflag = '0'
...@@ -140,7 +140,7 @@ ...@@ -140,7 +140,7 @@
<select id="fetchSearchByPage" parameterType="java.util.Map" resultMap="resultMap"> <select id="fetchSearchByPage" parameterType="java.util.Map" resultMap="resultMap">
SELECT SELECT
<include refid="sqlColumns"/>, c.name couponName, f.nickname nickName <include refid="sqlColumns"/>, c.name couponName, CONVERT(AES_DECRYPT(f.nickname,'aideakey') USING UTF8) nickName
FROM t_aidea_coupon_record t FROM t_aidea_coupon_record t
LEFT JOIN t_aidea_check_coupon c ON t.coupon_id = c.id LEFT JOIN t_aidea_check_coupon c ON t.coupon_id = c.id
LEFT JOIN wx_mp_fanss f ON f.openid = t.openid AND f.delflag = '0' LEFT JOIN wx_mp_fanss f ON f.openid = t.openid AND f.delflag = '0'
...@@ -308,17 +308,20 @@ ...@@ -308,17 +308,20 @@
update_time = now() update_time = now()
where id = #{id,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR}
</update> </update>
<insert id="insertPdaLog" parameterType="java.util.Map" useGeneratedKeys="true" <insert id="insertPdaLog" parameterType="java.util.Map" useGeneratedKeys="true"
keyProperty="id"> keyProperty="id">
insert into t_aidea_PdaLog (id, content, create_time) insert into t_aidea_PdaLog (id, content, create_time)
values (#{id, jdbcType=VARCHAR}, #{content, jdbcType=VARCHAR}, now()) values (#{id, jdbcType=VARCHAR}, #{content, jdbcType=VARCHAR}, now())
</insert> </insert>
<select id="isWriteOff" resultMap="resultMap"> <select id="isWriteOff" resultMap="resultMap">
SELECT id, SELECT id,
status status
FROM t_aidea_coupon_record FROM t_aidea_coupon_record
where number = #{number} AND del_flag = 0 where number = #{number} AND del_flag = 0
</select> </select>
<select id="getHospitalIdByfaNo" resultType="map"> <select id="getHospitalIdByfaNo" resultType="map">
SELECT id SELECT id
FROM t_aidea_hospital t FROM t_aidea_hospital t
......
package com.cftech.couponrecord.job;
import com.cftech.accounts.model.SysJob;
import com.cftech.accounts.service.JobService;
import com.cftech.core.util.SpringContextHolder;
import com.cftech.core.util.SystemConfig;
import lombok.extern.slf4j.Slf4j;
import org.quartz.Job;
import org.quartz.JobDataMap;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import java.text.SimpleDateFormat;
@Slf4j
public class CouponRecordJob implements Job {
@Override
public void execute(JobExecutionContext context) throws JobExecutionException {
boolean isCluster = Boolean.valueOf(SystemConfig.p.getProperty("quartz.isCluster"));
if (!isCluster) {
return;
}
//获得明细数据
JobDataMap jobInfo = context.getJobDetail().getJobDataMap();
String id = jobInfo.get("uid") == null ? "" : jobInfo.getString("uid");//这个也是ID主键
log.info("任务ID:" + id);
//执行更新操作
if (context.getNextFireTime() != null) {
log.info("同步检测券时间定时任务:下次执行时间=====" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(context.getNextFireTime()) + "==============");
} else {
JobService jobService = SpringContextHolder.getBean(JobService.class);
SysJob sysJob = new SysJob();
sysJob.setJobuid(id);
sysJob.setStatus("0");
jobService.updateStatus(sysJob);
log.info("同步检测券时间定时任务,已执行完成!");
}
}
}
...@@ -17,7 +17,6 @@ import com.cftech.core.generic.GenericDao; ...@@ -17,7 +17,6 @@ import com.cftech.core.generic.GenericDao;
import com.cftech.core.generic.GenericServiceImpl; import com.cftech.core.generic.GenericServiceImpl;
import com.cftech.core.sql.Conds; import com.cftech.core.sql.Conds;
import com.google.zxing.WriterException; import com.google.zxing.WriterException;
import javafx.scene.control.TableColumn;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Qualifier;
...@@ -57,7 +56,7 @@ public class CouponrecordServiceImpl extends GenericServiceImpl<Couponrecord> im ...@@ -57,7 +56,7 @@ public class CouponrecordServiceImpl extends GenericServiceImpl<Couponrecord> im
//卡券基础信息 //卡券基础信息
Checkcoupon checkcoupon = this.findCheckCoupon(); Checkcoupon checkcoupon = this.findCheckCoupon();
List<Couponrecord> couponrecordList = findCouponrecordBySort(null); List<Couponrecord> couponrecordList = findCouponrecordBySort(null, openid);
int number = 0; int number = 0;
...@@ -85,7 +84,7 @@ public class CouponrecordServiceImpl extends GenericServiceImpl<Couponrecord> im ...@@ -85,7 +84,7 @@ public class CouponrecordServiceImpl extends GenericServiceImpl<Couponrecord> im
if (number >= 6) {//赠送第二张 if (number >= 6) {//赠送第二张
String no = codingruleUtils.getNumber(accountId, Couponrecord.class.getName()); String no = codingruleUtils.getNumber(accountId, Couponrecord.class.getName());
//获取张券 //获取张券
Couponrecord couponrecord_one = findCouponrecordBySort("1").get(0); Couponrecord couponrecord_one = findCouponrecordBySort("1", openid).get(0);
Couponrecord couponrecord = new Couponrecord(); Couponrecord couponrecord = new Couponrecord();
couponrecord.setNumber(no); couponrecord.setNumber(no);
...@@ -103,7 +102,7 @@ public class CouponrecordServiceImpl extends GenericServiceImpl<Couponrecord> im ...@@ -103,7 +102,7 @@ public class CouponrecordServiceImpl extends GenericServiceImpl<Couponrecord> im
couponrecordMapper.save(couponrecord); couponrecordMapper.save(couponrecord);
} }
} else { } else {
Couponrecord couponrecordMax = findCouponrecordBySort("1").get(0); Couponrecord couponrecordMax = findCouponrecordBySort("1", openid).get(0);
if (couponrecordMax.getType().equals("2")) {//获取第二张结束时间购买数量 if (couponrecordMax.getType().equals("2")) {//获取第二张结束时间购买数量
number = buyingMedicineNumber(openid, couponrecordMax.getTakeEffectDate());//获取最后一张券购买数量 number = buyingMedicineNumber(openid, couponrecordMax.getTakeEffectDate());//获取最后一张券购买数量
...@@ -126,7 +125,7 @@ public class CouponrecordServiceImpl extends GenericServiceImpl<Couponrecord> im ...@@ -126,7 +125,7 @@ public class CouponrecordServiceImpl extends GenericServiceImpl<Couponrecord> im
} }
if (number >= 6) {//赠送第二张 if (number >= 6) {//赠送第二张
//获取第一张券 //获取第一张券
Couponrecord couponrecord_one = findCouponrecordBySort("1").get(0); Couponrecord couponrecord_one = findCouponrecordBySort("1", openid).get(0);
String no = codingruleUtils.getNumber(accountId, Couponrecord.class.getName()); String no = codingruleUtils.getNumber(accountId, Couponrecord.class.getName());
Couponrecord couponrecord = new Couponrecord(); Couponrecord couponrecord = new Couponrecord();
...@@ -145,13 +144,13 @@ public class CouponrecordServiceImpl extends GenericServiceImpl<Couponrecord> im ...@@ -145,13 +144,13 @@ public class CouponrecordServiceImpl extends GenericServiceImpl<Couponrecord> im
couponrecordMapper.save(couponrecord); couponrecordMapper.save(couponrecord);
} }
} else if (couponrecordMax.getType().equals("1")) {//通过第一张开始时间获取购买数量 } else if (couponrecordMax.getType().equals("1")) {//通过第一张开始时间获取购买数量
List<Couponrecord> couponrecordTwoMaxList = findCouponrecordBySort("2"); List<Couponrecord> couponrecordTwoMaxList = findCouponrecordBySort("2", openid);
number = buyingMedicineNumber(openid, couponrecordTwoMaxList.size() == 0 ? null: couponrecordTwoMaxList.get(0).getTakeEffectDate());//获取最后一张券购买数量 number = buyingMedicineNumber(openid, couponrecordTwoMaxList.size() == 0 ? null: couponrecordTwoMaxList.get(0).getTakeEffectDate());//获取最后一张券购买数量
//通过第一张最后购买数量,所以只需赠送第二章 //通过第一张最后购买数量,所以只需赠送第二章
if (number >= 6) {//赠送第二张 if (number >= 6) {//赠送第二张
//获取第一张券 //获取第一张券
Couponrecord couponrecord_one = findCouponrecordBySort("1").get(0); Couponrecord couponrecord_one = findCouponrecordBySort("1", openid).get(0);
String no = codingruleUtils.getNumber(accountId, Couponrecord.class.getName()); String no = codingruleUtils.getNumber(accountId, Couponrecord.class.getName());
...@@ -205,11 +204,13 @@ public class CouponrecordServiceImpl extends GenericServiceImpl<Couponrecord> im ...@@ -205,11 +204,13 @@ public class CouponrecordServiceImpl extends GenericServiceImpl<Couponrecord> im
* @param type 1:第一张;2:第二张 * @param type 1:第一张;2:第二张
* @return * @return
*/ */
public List<Couponrecord> findCouponrecordBySort(String type) { public List<Couponrecord> findCouponrecordBySort(String type, String openid) {
Conds conds = new Conds(); Conds conds = new Conds();
conds.equal("t.del_flag", Constants.DEL_FLAG_0); conds.equal("t.del_flag", Constants.DEL_FLAG_0);
if (StringUtils.isNoneBlank(type)) if (StringUtils.isNoneBlank(type))
conds.equal("t.type", type); conds.equal("t.type", type);
if (StringUtils.isNoneBlank(openid))
conds.equal("t.openid", openid);
Sort sort = new Sort("t.take_effect_date", OrderType.DESC); Sort sort = new Sort("t.take_effect_date", OrderType.DESC);
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
params.put("conds", conds); params.put("conds", conds);
......
...@@ -28,6 +28,9 @@ ...@@ -28,6 +28,9 @@
<result column="number" property="number"/> <result column="number" property="number"/>
<result column="invoice_code" property="invoiceCode"/> <result column="invoice_code" property="invoiceCode"/>
<result column="invoice_num" property="invoiceNum"/> <result column="invoice_num" property="invoiceNum"/>
<result column="order_amount" property="orderAmount"/>
<result column="image_url" property="imageUrl"/>
<result column="pdf_url" property="imageUrl"/>
<result column="aliasName" property="aliasName"/> <result column="aliasName" property="aliasName"/>
</resultMap> </resultMap>
...@@ -51,6 +54,9 @@ ...@@ -51,6 +54,9 @@
<result column="invoiceCreateTime" property="invoiceCreateTime"/> <result column="invoiceCreateTime" property="invoiceCreateTime"/>
<result column="invoice_code" property="invoiceCode"/> <result column="invoice_code" property="invoiceCode"/>
<result column="invoice_num" property="invoiceNum"/> <result column="invoice_num" property="invoiceNum"/>
<result column="order_amount" property="orderAmount"/>
<result column="image_url" property="imageUrl"/>
<result column="pdf_url" property="imageUrl"/>
</resultMap> </resultMap>
<sql id="sqlWhere"> <sql id="sqlWhere">
...@@ -83,29 +89,32 @@ ...@@ -83,29 +89,32 @@
<sql id="sqlColumns"> <sql id="sqlColumns">
id, id,
number, number,
invoice_title, invoice_title,
invoice_content, invoice_content,
unit_tax_number, unit_tax_number,
invoice_type, invoice_type,
invoice_form, invoice_form,
clerk_id, clerk_id,
order_id, order_id,
push_mode, push_mode,
email, email,
invoice_serial_num, invoice_serial_num,
product_id, product_id,
accounts_id, accounts_id,
del_flag, del_flag,
status, status,
create_time, create_time,
update_time, update_time,
description, description,
create_by, create_by,
update_by, update_by,
operator, operator,
open_id, open_id,
invoice_code, invoice_code,
invoice_num invoice_num,
order_amount,
image_url,
pdf_url
</sql> </sql>
...@@ -141,7 +150,10 @@ ...@@ -141,7 +150,10 @@
#{operator, jdbcType=VARCHAR}, #{operator, jdbcType=VARCHAR},
#{openId, jdbcType=VARCHAR}, #{openId, jdbcType=VARCHAR},
#{invoiceCode, jdbcType=VARCHAR}, #{invoiceCode, jdbcType=VARCHAR},
#{invoiceNum, jdbcType=VARCHAR} #{invoiceNum, jdbcType=VARCHAR},
#{orderAmount, jdbcType=VARCHAR},
#{imageUrl, jdbcType=VARCHAR},
#{pdfUrl, jdbcType=VARCHAR}
) )
</insert> </insert>
...@@ -185,6 +197,9 @@ ...@@ -185,6 +197,9 @@
t.open_id, t.open_id,
t.invoice_code, t.invoice_code,
t.invoice_num, t.invoice_num,
t.order_amount,
t.image_url,
t.pdf_url,
f.store aliasName f.store aliasName
FROM t_aidea_invoice t FROM t_aidea_invoice t
LEFT JOIN wx_mp_fanss f ON t.open_id = f.openid AND f. delflag = '0' LEFT JOIN wx_mp_fanss f ON t.open_id = f.openid AND f. delflag = '0'
...@@ -213,7 +228,10 @@ ...@@ -213,7 +228,10 @@
i.`status` invoiceStatus, i.`status` invoiceStatus,
i.create_time invoiceCreateTime, i.create_time invoiceCreateTime,
i.invoice_code invoiceCode, i.invoice_code invoiceCode,
i.invoice_num invoiceNum i.invoice_num invoiceNum,
t.order_amount orderAmount,
t.image_url imageUrl,
t.pdf_url pdfUrl
FROM FROM
t_order o t_order o
LEFT JOIN t_order_details d ON d.order_id = o.id LEFT JOIN t_order_details d ON d.order_id = o.id
...@@ -299,13 +317,22 @@ ...@@ -299,13 +317,22 @@
invoice_code = #{invoiceCode,jdbcType=VARCHAR}, invoice_code = #{invoiceCode,jdbcType=VARCHAR},
</if> </if>
<if test="invoiceNum != null"> <if test="invoiceNum != null">
invoice_num = #{invoiceNum,jdbcType=VARCHAR} invoice_num = #{invoiceNum,jdbcType=VARCHAR},
</if>
<if test="orderAmount != null">
order_amount = #{orderAmount,jdbcType=VARCHAR},
</if>
<if test="imageUrl != null">
image_url = #{imageUrl,jdbcType=VARCHAR},
</if>
<if test="pdfUrl != null">
pdf_url = #{pdfUrl,jdbcType=VARCHAR}
</if> </if>
</set> </set>
where id=#{id,jdbcType=BIGINT} where id=#{id,jdbcType=BIGINT}
</update> </update>
<update id="delete" parameterType="java.lang.Long"> <update id="delete" parameterType="java.lang.Long">
update t_aidea_invoice set del_flag=1 where id=#{id,jdbcType=BIGINT} update t_aidea_invoice set del_flag = 1 where id=#{id,jdbcType=BIGINT}
</update> </update>
</mapper> </mapper>
\ No newline at end of file
...@@ -85,6 +85,16 @@ public class Invoice implements Serializable { ...@@ -85,6 +85,16 @@ public class Invoice implements Serializable {
//发票号码 //发票号码
private String invoiceNum; private String invoiceNum;
//含税金额
private String orderAmount;
//图片路径
private String imageUrl;
//pdf路径
private String pdfUrl;
//别名
private String aliasName; private String aliasName;
public Invoice() { public Invoice() {
......
...@@ -132,6 +132,9 @@ public class InvoiceServiceImpl extends GenericServiceImpl<Invoice> implements I ...@@ -132,6 +132,9 @@ public class InvoiceServiceImpl extends GenericServiceImpl<Invoice> implements I
if (invoice.getInvoiceSerialNum().equals(invoiceObj.getString("serialNo")) && invoiceObj.getString("status").equals("2")) { if (invoice.getInvoiceSerialNum().equals(invoiceObj.getString("serialNo")) && invoiceObj.getString("status").equals("2")) {
invoice.setInvoiceCode(invoiceObj.getString("invoiceCode")); invoice.setInvoiceCode(invoiceObj.getString("invoiceCode"));
invoice.setInvoiceNum(invoiceObj.getString("invoiceNo")); invoice.setInvoiceNum(invoiceObj.getString("invoiceNo"));
invoice.setOrderAmount(invoiceObj.getString("orderAmount"));
invoice.setImageUrl(invoiceObj.getString("pictureUrl"));
invoice.setPdfUrl(invoiceObj.getString("pdfUrl"));
invoice.setDescription(result); invoice.setDescription(result);
invoiceMapper.update(invoice); invoiceMapper.update(invoice);
} else if (invoice.getInvoiceSerialNum().equals(invoiceObj.getString("serialNo")) && !invoiceObj.getString("status").equals("2")) { } else if (invoice.getInvoiceSerialNum().equals(invoiceObj.getString("serialNo")) && !invoiceObj.getString("status").equals("2")) {
......
...@@ -57,7 +57,19 @@ public class InvoiceHttpUtil { ...@@ -57,7 +57,19 @@ public class InvoiceHttpUtil {
String method = SystemConfig.p.getProperty("INVOICE_SEND_EMAIL_API"); String method = SystemConfig.p.getProperty("INVOICE_SEND_EMAIL_API");
NNOpenSDK sdk = NNOpenSDK.getIntance(); NNOpenSDK sdk = NNOpenSDK.getIntance();
String result = sdk.sendPostSyncRequest(url, genarateUUID(), appKey, appSecret, token, taxNum, method, params.toString()); String result = sdk.sendPostSyncRequest(url, genarateUUID(), appKey, appSecret, token, taxNum, method, params.toString());
log.info("发票结果查询" + result); log.info("发票推送邮箱结果" + result);
return result;
}
public static String openInvoicePdf(Invoice invoice) {
JSONObject params = new JSONObject();
params.put("invoiceCode", invoice.getInvoiceCode());
params.put("invoiceNo", invoice.getInvoiceNum());
String method = SystemConfig.p.getProperty("INVOICE_OPEN_PDF_API");
NNOpenSDK sdk = NNOpenSDK.getIntance();
String result = sdk.sendPostSyncRequest(url, genarateUUID(), appKey, appSecret, token, taxNum, method, params.toString());
log.info("发票查询pdf结果" + result);
return result; return result;
} }
} }
package com.cftech.invoice.web; package com.cftech.invoice.web;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.cftech.core.sql.Conds;
import com.cftech.core.util.Constants;
import com.cftech.invoice.model.Invoice;
import com.cftech.invoice.model.InvoiceDetail; import com.cftech.invoice.model.InvoiceDetail;
import com.cftech.invoice.service.InvoiceService; import com.cftech.invoice.service.InvoiceService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.aspectj.apache.bcel.classfile.Constant;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
...@@ -51,4 +55,18 @@ public class MobileInvoiceController { ...@@ -51,4 +55,18 @@ public class MobileInvoiceController {
public JSONObject sendEmail(@RequestParam String appId, @RequestParam String invoiceId, @RequestParam String openId, @RequestParam String email) { public JSONObject sendEmail(@RequestParam String appId, @RequestParam String invoiceId, @RequestParam String openId, @RequestParam String email) {
return invoiceService.sendEmail(appId, openId, invoiceId, email); return invoiceService.sendEmail(appId, openId, invoiceId, email);
} }
@RequestMapping(value = "/testFindPdf", method = {RequestMethod.POST}, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public JSONObject testFindPdf(@RequestParam String invoiceCode, @RequestParam String invoiceNo) {
Conds conds = new Conds();
conds.equal("t.del_flag", Constants.DEL_FLAG_0);
conds.equal("t.invoice_code", invoiceCode);
conds.equal("t.invoice_num", invoiceNo);
Invoice invoice = invoiceService.fetchSearchByConds(conds);
String aaa = InvoiceHttpUtil.queryInvoiceResult(invoice);
String pdf = InvoiceHttpUtil.openInvoicePdf(invoice);
return new JSONObject();
}
} }
...@@ -77,6 +77,25 @@ ...@@ -77,6 +77,25 @@
<div class="box"> <div class="box">
<div class="box-header"> <div class="box-header">
<form id="seachTableForm" action="#springUrl('/a/msgrecord/list')" method="get"> <form id="seachTableForm" action="#springUrl('/a/msgrecord/list')" method="get">
<div class="col-xs-2">
<select id="sender" name="sender" class="form-control required">
<option value="">请选择发送人</option>
#foreach($elem in $qyusers)
<option value="$elem.wxuserId">$elem.name</option>
#end
</select>
</div>
<div class="col-xs-2">
<select id="receiver" name="receiver" class="form-control required">
<option value="">请选择接收人</option>
<!-- <option value="0">待审核</option>-->
<!-- <option value="1">已通过</option>-->
<!-- <option value="2">已拒绝</option>-->
</select>
</div>
<div class="col-xs-5"> <div class="col-xs-5">
<button type="button" class="search btn btn-primary">搜索</button> <button type="button" class="search btn btn-primary">搜索</button>
#if($shiro.hasPermission("qy:msgrecord:edit")) #if($shiro.hasPermission("qy:msgrecord:edit"))
...@@ -92,10 +111,11 @@ ...@@ -92,10 +111,11 @@
<thead> <thead>
<tr> <tr>
<td hidden="true">Id</td> <td hidden="true">Id</td>
<th width="15%">发送人</th> <th width="12%">发送人</th>
<th width="15%">消息类型</th> <th width="12%">接收人</th>
<th width="40%">消息内容</th> <th width="12%">消息类型</th>
<th width="15%">发送时间</th> <th width="35%">消息内容</th>
<th width="14%">发送时间</th>
<th width="15%">创建时间</th> <th width="15%">创建时间</th>
<!--<th>操作</th>--> <!--<th>操作</th>-->
</tr> </tr>
...@@ -139,6 +159,10 @@ ...@@ -139,6 +159,10 @@
<script type="text/javascript" <script type="text/javascript"
src="plugins/jquery-validation/js/jquery.validate.min.js"></script> src="plugins/jquery-validation/js/jquery.validate.min.js"></script>
<!-- AdminLTE for demo purposes --> <!-- AdminLTE for demo purposes -->
<script>
var csrfheader = {name: '_csrf_header', value: '${_csrf.headerName}'};
var csrftoken = {name: '_csrf', value: '${_csrf.token}'};
</script>
<script src="common/js/cfapp.js"></script> <script src="common/js/cfapp.js"></script>
<script> <script>
function formatDates(now) { function formatDates(now) {
...@@ -161,7 +185,7 @@ ...@@ -161,7 +185,7 @@
} }
var retrieveData = function (sSource, aoData, fnCallback) { var retrieveData = function (sSource, aoData, fnCallback) {
$("#seachTableForm input").each(function () { $("#seachTableForm select,input").each(function () {
var params = { var params = {
name: $(this).attr("name"), name: $(this).attr("name"),
value: $(this).val() value: $(this).val()
...@@ -196,6 +220,9 @@ ...@@ -196,6 +220,9 @@
{ {
"mData": "tofromName" "mData": "tofromName"
}, },
{
"mData": "tolistName"
},
{ {
"mData": "msgType" "mData": "msgType"
}, },
...@@ -214,8 +241,8 @@ ...@@ -214,8 +241,8 @@
'targets': [0] 'targets': [0]
}, },
{ {
"aTargets": [2], "aTargets": [3],
"mData": "createTime", "mData": "msgType",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
if (a == 'text') { if (a == 'text') {
return '文本'; return '文本';
...@@ -234,7 +261,7 @@ ...@@ -234,7 +261,7 @@
} }
}, },
{ {
"aTargets": [3], "aTargets": [4],
"mData": "content", "mData": "content",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
if (c.msgType == 'text') { if (c.msgType == 'text') {
...@@ -251,14 +278,14 @@ ...@@ -251,14 +278,14 @@
} }
}, },
{ {
"aTargets": [4], "aTargets": [5],
"mData": "msgtime", "mData": "msgtime",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
return formatDates(a, "yyyy-MM-dd HH:mm:ss"); return formatDates(a, "yyyy-MM-dd HH:mm:ss");
} }
}, },
{ {
"aTargets": [5], "aTargets": [6],
"mData": "createTime", "mData": "createTime",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
return formatDates(a, "yyyy-MM-dd HH:mm:ss"); return formatDates(a, "yyyy-MM-dd HH:mm:ss");
...@@ -283,6 +310,9 @@ ...@@ -283,6 +310,9 @@
$('.search').click(function () { $('.search').click(function () {
$("#table").dataTable().fnClearTable(); $("#table").dataTable().fnClearTable();
}); });
//搜索选择框联动加载
initSelectEleChangeEvent();
}); });
Cfapp.init(); Cfapp.init();
...@@ -310,13 +340,14 @@ ...@@ -310,13 +340,14 @@
}, },
error: function () { error: function () {
} }
}) });
}, },
cancel: function () { cancel: function () {
$(".modal-backdrop").fadeOut(); $(".modal-backdrop").fadeOut();
} }
}); });
} }
function importExcel() { function importExcel() {
var templateExcelUrl = "#springUrl('/a/msgrecord/templateExcel')"; var templateExcelUrl = "#springUrl('/a/msgrecord/templateExcel')";
var importExcelUrl = "#springUrl('/a/msgrecord/importExcel')"; var importExcelUrl = "#springUrl('/a/msgrecord/importExcel')";
...@@ -333,6 +364,31 @@ ...@@ -333,6 +364,31 @@
}); });
} }
function initSelectEleChangeEvent() {
$('#sender').on('change', function(e) {
$('#receiver').html('');
let userId = $(this).find("option:selected").val();
if (userId == null || userId == '') {
$('#receiver').html('<option value="">请选择接收人</option>');
} else {
$('#receiver').html('<option value="">请选择接收人</option>');
$.ajax({
type: "POST",
url: "#springUrl('/a/msgrecord/byUserIdFindReceiver')",
data: {userId: userId,
"_csrf": csrftoken.value,
"_csrf_header": csrfheader.value,},
dataType: "json",
success: function (datas) {
let arr = datas.data;
arr.filter(function(val, i, arr) {
$('#receiver').append('<option value="'+val.receiverId+'">'+val.receiver+'</option>');
});
}
})
}
});
}
</script> </script>
......
package com.cftech.msgrecord.dao; package com.cftech.msgrecord.dao;
import com.cftech.msgrecord.model.ExternalContactDto;
import com.cftech.msgrecord.model.Msgrecord; import com.cftech.msgrecord.model.Msgrecord;
import com.cftech.core.generic.GenericDao; import com.cftech.core.generic.GenericDao;
import java.util.List;
import java.util.Map;
/** /**
* 聊天记录Mapper * 聊天记录Mapper
* *
...@@ -11,4 +15,32 @@ import com.cftech.core.generic.GenericDao; ...@@ -11,4 +15,32 @@ import com.cftech.core.generic.GenericDao;
*/ */
public interface MsgrecordMapper extends GenericDao<Msgrecord> { public interface MsgrecordMapper extends GenericDao<Msgrecord> {
/**
* 获取客户名称已存在的记录且去重
* @return
*/
List<ExternalContactDto> findUserExistsRecord();
List<Msgrecord> fetchSearchByMsgRecordList(Map<String, Object> params);
/**
* 通过客服人员获取与其发信息的发送人或接收人
* @param userId
* @return
*/
List<ExternalContactDto> byUserIdFindReceiver(String userId);
/**
* 查询列表
* @param params
* @return
*/
List<Msgrecord> fetchSearchByPageByField(Map<String, Object> params);
/**
* 列表统计
* @param params
* @return
*/
Integer countByField(Map<String, Object> params);
} }
\ No newline at end of file
...@@ -22,7 +22,8 @@ ...@@ -22,7 +22,8 @@
<result column="description" property="description"/> <result column="description" property="description"/>
<result column="create_by" property="createBy"/> <result column="create_by" property="createBy"/>
<result column="update_by" property="updateBy"/> <result column="update_by" property="updateBy"/>
<result column="tofromName" property="tofromName"/> <result column="tofrom_name" property="tofromName"/>
<result column="tolist_name" property="tolistName"/>
</resultMap> </resultMap>
<sql id="sqlWhere"> <sql id="sqlWhere">
...@@ -70,6 +71,8 @@ ...@@ -70,6 +71,8 @@
create_time, create_time,
update_time, update_time,
description, description,
tofrom_name,
tolist_name,
create_by, create_by,
update_by update_by
</sql> </sql>
...@@ -100,6 +103,8 @@ ...@@ -100,6 +103,8 @@
now(), now(),
now(), now(),
#{description, jdbcType=VARCHAR}, #{description, jdbcType=VARCHAR},
#{tofromName, jdbcType=VARCHAR},
#{tolistName, jdbcType=VARCHAR},
#{createBy, jdbcType=BIGINT}, #{createBy, jdbcType=BIGINT},
#{updateBy, jdbcType=BIGINT} #{updateBy, jdbcType=BIGINT}
) )
...@@ -114,10 +119,7 @@ ...@@ -114,10 +119,7 @@
<select id="count" parameterType="java.util.Map" resultType="java.lang.Integer"> <select id="count" parameterType="java.util.Map" resultType="java.lang.Integer">
SELECT COUNT(1) FROM t_aidea_msg_record t SELECT COUNT(1) FROM t_aidea_msg_record t
LEFT JOIN wx_mp_fanss f ON t.tofrom = f.openid AND f.delflag = 0
LEFT JOIN t_qyuser q ON t.tofrom = q.wxuser_id AND q.del_flag = 0
<include refid="sqlWhere"/> <include refid="sqlWhere"/>
</select> </select>
<select id="fetchSearchByPage" parameterType="java.util.Map" resultType="com.cftech.msgrecord.model.Msgrecord"> <select id="fetchSearchByPage" parameterType="java.util.Map" resultType="com.cftech.msgrecord.model.Msgrecord">
...@@ -141,17 +143,54 @@ ...@@ -141,17 +143,54 @@
t.description, t.description,
t.create_by, t.create_by,
t.update_by, t.update_by,
CASE WHEN CONVERT(AES_DECRYPT(f.nickname,'aideakey') USING UTF8) IS NOT NULL THEN CONVERT(AES_DECRYPT(f.nickname,'aideakey') USING UTF8) t.tofrom_name,
WHEN q.name IS NOT NULL THEN q.name t.tolist_name
ELSE t.tofrom END tofromName FROM t_aidea_msg_record t
<include refid="sqlWhere"/>
<if test="receiver!=null and sender != null">
AND (t.tofrom = #{sender} AND INSTR(t.tolist, #{receiver}) > 0 ) OR (t.tofrom = #{receiver} AND INSTR(t.tolist, #{sender}) > 0)
</if>
<if test="sort!=null">ORDER BY ${sort.param} ${sort.type}</if>
<if test="limit>0">limit #{offset},#{limit}</if>
</select>
<select id="fetchSearchByPageByField" parameterType="java.util.Map" resultType="com.cftech.msgrecord.model.Msgrecord">
SELECT
t.id,
t.msg_id,
t.varsion,
t.action,
t.tofrom,
t.tolist,
t.roomid,
t.msgtime,
t.msg_type,
t.content,
t.media_path,
t.accounts_id,
t.del_flag,
t.status,
t.create_time,
t.update_time,
t.description,
t.create_by,
t.update_by,
t.tofrom_name,
t.tolist_name
FROM t_aidea_msg_record t FROM t_aidea_msg_record t
LEFT JOIN wx_mp_fanss f ON t.tofrom = f.openid AND f.delflag = 0
LEFT JOIN t_qyuser q ON t.tofrom = q.wxuser_id AND q.del_flag = 0
<include refid="sqlWhere"/> <include refid="sqlWhere"/>
<if test="receiver!=null and sender != null">
AND (t.tofrom = #{sender} AND INSTR(t.tolist, #{receiver}) > 0 ) OR (t.tofrom = #{receiver} AND INSTR(t.tolist, #{sender}) > 0)
</if>
<if test="sort!=null">ORDER BY ${sort.param} ${sort.type}</if> <if test="sort!=null">ORDER BY ${sort.param} ${sort.type}</if>
<if test="limit>0">limit #{offset},#{limit}</if> <if test="limit>0">limit #{offset},#{limit}</if>
</select> </select>
<select id="countByField" parameterType="java.util.Map" resultType="java.lang.Integer">
SELECT COUNT(1) FROM t_aidea_msg_record t
<include refid="sqlWhere"/>
</select>
<update id="update" parameterType="com.cftech.msgrecord.model.Msgrecord"> <update id="update" parameterType="com.cftech.msgrecord.model.Msgrecord">
update t_aidea_msg_record update t_aidea_msg_record
<set> <set>
...@@ -203,6 +242,12 @@ ...@@ -203,6 +242,12 @@
<if test="description != null"> <if test="description != null">
description = #{description, jdbcType=VARCHAR}, description = #{description, jdbcType=VARCHAR},
</if> </if>
<if test="tofromName != null">
tofrom_name = #{tofromName, jdbcType=VARCHAR},
</if>
<if test="tolistName != null">
tolist_name = #{tolistName, jdbcType=VARCHAR},
</if>
<if test="createBy != null"> <if test="createBy != null">
create_by = #{createBy, jdbcType=BIGINT}, create_by = #{createBy, jdbcType=BIGINT},
</if> </if>
...@@ -216,4 +261,84 @@ ...@@ -216,4 +261,84 @@
<update id="delete" parameterType="java.lang.Long"> <update id="delete" parameterType="java.lang.Long">
update t_aidea_msg_record set del_flag=1 where id=#{id,jdbcType=BIGINT} update t_aidea_msg_record set del_flag=1 where id=#{id,jdbcType=BIGINT}
</update> </update>
<!-- 获取已存在用户信息且去重 -->
<select id="findUserExistsRecord" resultType="com.cftech.msgrecord.model.ExternalContactDto">
SELECT tmp.userid, tmp.description result FROM
( SELECT
a.tofrom AS userid,
a.description
FROM
t_aidea_msg_record a
WHERE
a.tofrom IS NOT NULL
AND INSTR(a.tofrom, 'wml') > 0
AND a.description IS NOT NULL
UNION ALL
SELECT
substring(
a.tolist,
3,
LENGTH(a.tolist) - 4
) AS userid,
a.description
FROM
t_aidea_msg_record a
WHERE
a.tolist IS NOT NULL
AND INSTR(a.tolist, 'wml') > 0
AND a.description IS NOT NULL ) tmp
GROUP BY
tmp.userid
</select>
<select id="fetchSearchByMsgRecordList" parameterType="java.util.Map" resultType="com.cftech.msgrecord.model.Msgrecord">
SELECT
t.id,
t.msg_id,
t.varsion,
t.action,
t.tofrom,
t.tolist,
t.roomid,
t.msgtime,
t.msg_type,
t.content,
t.media_path,
t.accounts_id,
t.del_flag,
t.status,
t.create_time,
t.update_time,
t.description,
t.create_by,
t.update_by,
t.tofrom_name,
t.tolist_name
FROM t_aidea_msg_record t
<include refid="sqlWhere"/>
AND (t.tofrom_name IS NULL OR t.tolist_name IS NULL)
<if test="sort!=null">ORDER BY ${sort.param} ${sort.type}</if>
</select>
<!-- 通过客服人员获取与其发信息的发送人或接收人 -->
<select id="byUserIdFindReceiver" parameterType="java.lang.String" resultType="com.cftech.msgrecord.model.ExternalContactDto">
SELECT * FROM (
SELECT
CASE WHEN t.tofrom = #{userId} AND t.tolist_name IS NOT NULL THEN t.tolist_name
WHEN t.tofrom = #{userId} AND t.tolist_name IS NULL THEN SUBSTR(t.tolist, 3, LENGTH(t.tolist) -4)
WHEN t.tolist = #{userId} AND t.tofrom_name IS NOT NULL THEN t.tofrom_name
WHEN t.tolist = #{userId} AND t.tofrom_name IS NULL THEN t.tofrom
ELSE NULL END receiver,
CASE WHEN t.tofrom = #{userId} AND t.tolist_name IS NOT NULL THEN SUBSTR(t.tolist, 3, LENGTH(t.tolist) -4)
WHEN t.tofrom = #{userId} AND t.tolist_name IS NULL THEN SUBSTR(t.tolist, 3, LENGTH(t.tolist) -4)
WHEN t.tolist = #{userId} AND t.tofrom_name IS NOT NULL THEN t.tofrom
WHEN t.tolist = #{userId} AND t.tofrom_name IS NULL THEN t.tofrom
ELSE NULL END receiverId
FROM t_aidea_msg_record t
WHERE t.tofrom = #{userId} OR INSTR(t.tolist, #{userId}) > 0
) duals
WHERE duals.receiver IS NOT NULL AND duals.receiverId IS NOT NULL
GROUP BY duals.receiverId
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -220,7 +220,7 @@ public class SynWechatMsg implements Job { ...@@ -220,7 +220,7 @@ public class SynWechatMsg implements Job {
return; return;
} }
System.out.printf("getmediadata outindex len:%d, data_len:%d, is_finis:%d\n",Finance.GetIndexLen(media_data),Finance.GetDataLen(media_data), Finance.IsMediaDataFinish(media_data)); System.out.printf("getmediadata outindex len:%d, data_len:%d, is_finis:%d",Finance.GetIndexLen(media_data), Finance.GetDataLen(media_data), Finance.IsMediaDataFinish(media_data));
try { try {
//大于512k的文件会分片拉取,此处需要使用追加写,避免后面的分片覆盖之前的数据。 //大于512k的文件会分片拉取,此处需要使用追加写,避免后面的分片覆盖之前的数据。
......
package com.cftech.msgrecord.model;
import lombok.Data;
@Data
public class ExternalContactDto {
private String userid;
private String result;
private String receiver;
private String receiverId;
}
...@@ -66,6 +66,14 @@ public class Msgrecord implements Serializable { ...@@ -66,6 +66,14 @@ public class Msgrecord implements Serializable {
private String tofromName; private String tofromName;
private String tolistName;
/**
* 查询字段
*/
private String sender;
private String receiver;
public Msgrecord() { public Msgrecord() {
this.delFlag = false; this.delFlag = false;
this.status = "0"; this.status = "0";
......
package com.cftech.msgrecord.service; package com.cftech.msgrecord.service;
import com.cftech.core.sql.Conds;
import com.cftech.core.sql.Sort;
import com.cftech.msgrecord.model.ExternalContactDto;
import com.cftech.msgrecord.model.Msgrecord; import com.cftech.msgrecord.model.Msgrecord;
import com.cftech.core.generic.GenericService; import com.cftech.core.generic.GenericService;
import java.util.List;
import java.util.Map;
/** /**
* 聊天记录Service * 聊天记录Service
* *
* @author Strive * @author Strive
* @date: 2021-01-05 15:28 * @date: 2021-01-05 15:28
*/ */
public interface MsgrecordService extends GenericService<Msgrecord> { public interface MsgrecordService extends GenericService<Msgrecord> {
/**
* 获取客户名称已存在的记录且去重
* @return
*/
List<ExternalContactDto> findUserExistsRecord();
List<Msgrecord> fetchSearchByMsgRecordList(Conds conds);
/**
* 通过客服人员获取与其发信息的发送人或接收人
* @param userId
* @return
*/
List<ExternalContactDto> byUserIdFindReceiver(String userId);
/**
* 列表查询
* @param conds
* @param sort
* @param iDisplayStart
* @param iDisplayLength
* @return
*/
List<Msgrecord> fetchSearchByPageByField(Conds conds, Sort sort, int iDisplayStart, int iDisplayLength, String sender, String receiver);
/**
* 列表统计
* @param conds
* @return
*/
Integer countByField(Conds conds, String sender, String receiver);
} }
package com.cftech.msgrecord.service.impl; package com.cftech.msgrecord.service.impl;
import com.cftech.core.sql.Conds;
import com.cftech.core.sql.Sort;
import com.cftech.core.util.StringUtils;
import com.cftech.msgrecord.model.ExternalContactDto;
import com.cftech.msgrecord.model.Msgrecord; import com.cftech.msgrecord.model.Msgrecord;
import com.cftech.msgrecord.dao.MsgrecordMapper; import com.cftech.msgrecord.dao.MsgrecordMapper;
import com.cftech.msgrecord.service.MsgrecordService; import com.cftech.msgrecord.service.MsgrecordService;
import com.cftech.core.generic.GenericDao; import com.cftech.core.generic.GenericDao;
import com.cftech.core.generic.GenericServiceImpl; import com.cftech.core.generic.GenericServiceImpl;
import com.cftech.core.sql.Conds;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/** /**
* 聊天记录ServiceImpl * 聊天记录ServiceImpl
* *
* @author Strive * @author Strive
* @date: 2021-01-05 15:28 * @date: 2021-01-05 15:28
*/ */
@Service("msgrecordService") @Service("msgrecordService")
public class MsgrecordServiceImpl extends GenericServiceImpl<Msgrecord> implements MsgrecordService { public class MsgrecordServiceImpl extends GenericServiceImpl<Msgrecord> implements MsgrecordService {
@Autowired @Autowired
@Qualifier("msgrecordMapper") @Qualifier("msgrecordMapper")
private MsgrecordMapper msgrecordMapper; private MsgrecordMapper msgrecordMapper;
@Override
public GenericDao<Msgrecord> getGenericMapper() {
return msgrecordMapper;
}
@Override
public List<ExternalContactDto> findUserExistsRecord() {
return msgrecordMapper.findUserExistsRecord();
}
@Override
public List<Msgrecord> fetchSearchByMsgRecordList(Conds conds) {
Map<String, Object> params = new HashMap<>();
params.put("conds", conds);
return msgrecordMapper.fetchSearchByMsgRecordList(params);
}
@Override
public List<ExternalContactDto> byUserIdFindReceiver(String userId) {
return msgrecordMapper.byUserIdFindReceiver(userId);
}
@Override @Override
public GenericDao<Msgrecord> getGenericMapper() { public List<Msgrecord> fetchSearchByPageByField(Conds conds, Sort sort, int page, int pageSize, String sender, String receiver) {
return msgrecordMapper; Map<String, Object> params = new HashMap<String, Object>();
} params.put("conds", conds);
params.put("offset", page > 0 ? page : 0);
params.put("limit", pageSize > 0 ? pageSize : 0);
params.put("sort", sort);
if (StringUtils.isNoneBlank(sender)) {
params.put("sender", sender);
}
if (StringUtils.isNoneBlank(receiver)) {
params.put("receiver", receiver);
}
return msgrecordMapper.fetchSearchByPageByField(params);
}
@Override
public Integer countByField(Conds conds, String sender, String receiver) {
Map<String, Object> params = new HashMap<String, Object>();
params.put("conds", conds);
if (StringUtils.isNoneBlank(sender)) {
params.put("sender", sender);
}
if (StringUtils.isNoneBlank(receiver)) {
params.put("receiver", receiver);
}
return msgrecordMapper.countByField(params);
}
} }
\ No newline at end of file
...@@ -2,7 +2,9 @@ package com.cftech.msgrecord.web; ...@@ -2,7 +2,9 @@ package com.cftech.msgrecord.web;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.cftech.accounts.model.SysJob; import com.cftech.accounts.model.SysJob;
import com.cftech.accounts.service.JobService; import com.cftech.base.org.model.Qyuser;
import com.cftech.base.org.service.QyuserService;
import com.cftech.msgrecord.model.ExternalContactDto;
import com.cftech.msgrecord.model.Msgrecord; import com.cftech.msgrecord.model.Msgrecord;
import com.cftech.msgrecord.service.MsgrecordService; import com.cftech.msgrecord.service.MsgrecordService;
import com.cftech.core.poi.ExcelKit; import com.cftech.core.poi.ExcelKit;
...@@ -20,6 +22,7 @@ import org.springframework.stereotype.Controller; ...@@ -20,6 +22,7 @@ import org.springframework.stereotype.Controller;
import org.springframework.ui.Model; import org.springframework.ui.Model;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
...@@ -58,13 +61,19 @@ public class MsgrecordController { ...@@ -58,13 +61,19 @@ public class MsgrecordController {
private MsgrecordService msgrecordService; private MsgrecordService msgrecordService;
@Autowired @Autowired
private JobService jobService; private QyuserService qyuserService;
//列表页面 //列表页面
@RequiresPermissions(value = MSGRECORD_VIEW) @RequiresPermissions(value = MSGRECORD_VIEW)
@RequestMapping("/list") @RequestMapping("/list")
public String list(HttpServletRequest request, Model model) { public String list(HttpServletRequest request, Model model) {
Long accountId = UserUtils.getmpaccounts(request); Long accountId = UserUtils.getmpaccounts(request);
//获取企业号客服
Conds conds = new Conds();
conds.equal("t.del_flag", Constants.DEL_FLAG_0);
conds.equal("t.user_type", "2");//客服
List<Qyuser> qyusers = qyuserService.fetchSearchByPage(conds, null, 0, 0);
model.addAttribute("qyusers", qyusers);
model.addAttribute("accountId", accountId); model.addAttribute("accountId", accountId);
return "msgrecord/msgrecordlist"; return "msgrecord/msgrecordlist";
} }
...@@ -117,9 +126,14 @@ public class MsgrecordController { ...@@ -117,9 +126,14 @@ public class MsgrecordController {
conds.equal("t.del_flag", Constants.DEL_FLAG_0); conds.equal("t.del_flag", Constants.DEL_FLAG_0);
conds.equal("t.accounts_id", accountsId); conds.equal("t.accounts_id", accountsId);
Sort sort = new Sort("t.create_time", OrderType.DESC); Sort sort = new Sort("t.create_time", OrderType.DESC);
if (!StringUtils.isEmpty(msgrecord.getSender()) && StringUtils.isEmpty(msgrecord.getReceiver())) {
List<Msgrecord> list = msgrecordService.fetchSearchByPage(conds, sort, iDisplayStart, iDisplayLength); conds.equal("t.tofrom", msgrecord.getSender());
Integer counts = msgrecordService.count(conds); } else if (StringUtils.isEmpty(msgrecord.getSender()) && !StringUtils.isEmpty(msgrecord.getReceiver())) {
conds.like("t.tolist", msgrecord.getReceiver());
}
List<Msgrecord> list = msgrecordService.fetchSearchByPageByField(conds, sort, iDisplayStart, iDisplayLength, //
msgrecord.getSender(), msgrecord.getReceiver());
Integer counts = msgrecordService.countByField(conds, msgrecord.getSender(), msgrecord.getReceiver());
JSONObject rtnJson = new JSONObject(); JSONObject rtnJson = new JSONObject();
rtnJson.put("iTotalRecords", counts); rtnJson.put("iTotalRecords", counts);
rtnJson.put("iTotalDisplayRecords", counts); rtnJson.put("iTotalDisplayRecords", counts);
...@@ -192,4 +206,18 @@ public class MsgrecordController { ...@@ -192,4 +206,18 @@ public class MsgrecordController {
return list(request, model); return list(request, model);
} }
@RequestMapping("byUserIdFindReceiver")
@ResponseBody
public JSONObject byUserIdFindReceiver(@RequestParam String userId) {
JSONObject retObj = new JSONObject();
try {
List<ExternalContactDto> externalContactDtos = msgrecordService.byUserIdFindReceiver(userId);
retObj.put("errorNo", 0);
retObj.put("data", externalContactDtos);
} catch (Exception e) {
retObj.put("errorNo", 1);
e.printStackTrace();
}
return retObj;
}
} }
...@@ -4,6 +4,7 @@ import com.cftech.orderdetail.model.OrderDetails; ...@@ -4,6 +4,7 @@ import com.cftech.orderdetail.model.OrderDetails;
import com.cftech.core.generic.GenericDao; import com.cftech.core.generic.GenericDao;
import com.cftech.orderdetail.model.OrderSplitBatchDto; import com.cftech.orderdetail.model.OrderSplitBatchDto;
import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
...@@ -27,4 +28,11 @@ public interface OrderDetailsMapper extends GenericDao<OrderDetails> { ...@@ -27,4 +28,11 @@ public interface OrderDetailsMapper extends GenericDao<OrderDetails> {
* @return * @return
*/ */
Long saveDrugBatchNo(OrderSplitBatchDto orderSplitBatchDto); Long saveDrugBatchNo(OrderSplitBatchDto orderSplitBatchDto);
/**
* 查询订单批次明细
* @param params
* @return
*/
List<OrderSplitBatchDto> fetchSearchByBatchDrug(Map<String, Object> params);
} }
\ No newline at end of file
...@@ -135,10 +135,18 @@ ...@@ -135,10 +135,18 @@
</select> </select>
<select id="fetchMemberByYearGoodsNum" parameterType="java.util.Map" resultType="java.lang.Integer"> <select id="fetchMemberByYearGoodsNum" parameterType="java.util.Map" resultType="java.lang.Integer">
<!-- SELECT-->
<!-- IFNULL(SUM(d.drugs_num), 0)-->
<!-- FROM t_order_details d-->
<!-- LEFT JOIN t_order o ON o.id = d.order_id-->
<!-- <include refid="sqlWhere"/>-->
<!-- AND o.create_time >=-->
<!-- (SELECT a.create_time FROM wx_mp_fanss f-->
<!-- INNER JOIN wx_mp_member m ON f.openid = m.open_id AND f.delflag = '0' AND m.del_flag = '0'-->
<!-- INNER JOIN t_aidea_authentication a ON m.cardid = id_card AND a.del_flag = '0' WHERE f.openid = o.openid)-->
SELECT SELECT
IFNULL(SUM(d.drugs_num), 0) IFNULL(SUM(t.remind_type), 0)
FROM t_order_details d FROM t_order t
LEFT JOIN t_order o ON o.id = d.order_id
<include refid="sqlWhere"/> <include refid="sqlWhere"/>
</select> </select>
...@@ -256,4 +264,31 @@ ...@@ -256,4 +264,31 @@
#{drugsName, jdbcType=VARCHAR} #{drugsName, jdbcType=VARCHAR}
) )
</insert> </insert>
<!-- 查询订单明细批次号 -->
<select id="fetchSearchByBatchDrug" parameterType="java.util.Map" resultType="com.cftech.orderdetail.model.OrderSplitBatchDto">
SELECT
t.id,
t.order_id orderId,
t.order_code orderCode,
t.drugs_id drugsId,
t.drugs_name drugsName,
t.drugs_num drugsNum,
t.openid,
t.drugs_code drugsCode,
t.drugs_sku drugsSku,
t.drugs_batchno drugsBatchNo,
t.accounts_id accountsId,
t.del_flag delFlag,
t.STATUS,
t.create_time createTime,
t.update_time updateTime,
t.description,
t.create_by createBy,
t.update_by updateBy
FROM t_order_split_batch t
<include refid="sqlWhere"/>
ORDER BY t.drugs_id DESC, t.create_time DESC
<if test="limit>0">limit #{offset},#{limit}</if>
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -7,6 +7,7 @@ import com.cftech.core.generic.GenericService; ...@@ -7,6 +7,7 @@ import com.cftech.core.generic.GenericService;
import com.cftech.orderdetail.model.OrderSplitBatchDto; import com.cftech.orderdetail.model.OrderSplitBatchDto;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 订单管理Service * 订单管理Service
...@@ -39,4 +40,11 @@ public interface OrderDetailsService extends GenericService<OrderDetails> { ...@@ -39,4 +40,11 @@ public interface OrderDetailsService extends GenericService<OrderDetails> {
* @return * @return
*/ */
Long saveDrugBatchNo(OrderSplitBatchDto orderSplitBatchDto); Long saveDrugBatchNo(OrderSplitBatchDto orderSplitBatchDto);
/**
* 查询订单批次明细
* @param
* @return
*/
List<OrderSplitBatchDto> fetchSearchByBatchDrug(Conds conds, Sort sort, int page, int pageSize);
} }
...@@ -60,4 +60,14 @@ public class OrderDetailsServiceImpl extends GenericServiceImpl<OrderDetails> im ...@@ -60,4 +60,14 @@ public class OrderDetailsServiceImpl extends GenericServiceImpl<OrderDetails> im
public Long saveDrugBatchNo(OrderSplitBatchDto orderSplitBatchDto) { public Long saveDrugBatchNo(OrderSplitBatchDto orderSplitBatchDto) {
return orderDetailsMapper.saveDrugBatchNo(orderSplitBatchDto); return orderDetailsMapper.saveDrugBatchNo(orderSplitBatchDto);
} }
@Override
public List<OrderSplitBatchDto> fetchSearchByBatchDrug(Conds conds, Sort sort, int page, int pageSize) {
Map<String, Object> params = new HashMap<>();
params.put("conds", conds);
params.put("offset", page > 0 ? page : 0);
params.put("limit", pageSize > 0 ? pageSize : 0);
params.put("sort", sort);
return orderDetailsMapper.fetchSearchByBatchDrug(params);
}
} }
\ No newline at end of file
...@@ -177,6 +177,11 @@ ...@@ -177,6 +177,11 @@
name="courierNumber" placeholder="顺丰运单号"> name="courierNumber" placeholder="顺丰运单号">
</div> </div>
<div class="col-xs-2">
<input type="text" class="form-control"
name="fansAlias" placeholder="别名">
</div>
<div class="col-xs-2"> <div class="col-xs-2">
<select id="startOrderAmount" name="startOrderAmount" class="form-control required"> <select id="startOrderAmount" name="startOrderAmount" class="form-control required">
<option value="">请选择订单金额</option> <option value="">请选择订单金额</option>
...@@ -197,29 +202,11 @@ ...@@ -197,29 +202,11 @@
</select> </select>
</div> </div>
<!-- <div class="col-xs-2">-->
<!-- <input type="text" class="form-control"-->
<!-- name="startOrderAmount" placeholder="订单金额开始区间">-->
<!-- </div>-->
<!-- <div class="col-xs-2">-->
<!-- <input type="text" class="form-control"-->
<!-- name="endOrderAmount" placeholder="订单金额结束区间">-->
<!-- </div>-->
<!-- <div class="col-xs-2">-->
<!-- <input type="text" class="form-control"-->
<!-- name="startPayAmount" placeholder="付款金额开始区间">-->
<!-- </div>-->
<!-- <div class="col-xs-2">-->
<!-- <input type="text" class="form-control"-->
<!-- name="endPayAmount" placeholder="付款金额结束区间">-->
<!-- </div>-->
<div class="col-xs-2"> <div class="col-xs-2">
<select id="status" name="status" class="form-control required"> <select id="status" name="status" class="form-control required">
<option value="">请选择订单状态</option> <option value="-1">请选择订单状态</option>
<option value="0" selected>待确认</option> <option value="all">全部</option>
<option value="0">待确认</option>
<option value="1">待付款</option> <option value="1">待付款</option>
<option value="2">待发货</option> <option value="2">待发货</option>
<option value="3">待收货</option> <option value="3">待收货</option>
...@@ -228,6 +215,14 @@ ...@@ -228,6 +215,14 @@
</select> </select>
</div> </div>
<div class="col-xs-2">
<select id="isThree" name="isThree" class="form-control required">
<option value="">请选择患者类型</option>
<option value="3">三期患者</option>
<option value="4">四期患者</option>
</select>
</div>
<div class="col-xs-2"> <div class="col-xs-2">
<select id="isBill" name="isBill" class="form-control required"> <select id="isBill" name="isBill" class="form-control required">
<option value="">请选择是否开票</option> <option value="">请选择是否开票</option>
...@@ -290,6 +285,7 @@ ...@@ -290,6 +285,7 @@
<!--<th>支付交易号</th>--> <!--<th>支付交易号</th>-->
<th>是否开票</th> <th>是否开票</th>
<th>三期患者</th> <th>三期患者</th>
<th>是否购药</th>
<th>创建时间</th> <th>创建时间</th>
<!-- <th>确认时间</th>--> <!-- <th>确认时间</th>-->
<!-- <th>付款时间</th>--> <!-- <th>付款时间</th>-->
...@@ -430,7 +426,7 @@ ...@@ -430,7 +426,7 @@
"mData": "consultCode" "mData": "consultCode"
}, },
{ {
"mData": "productName" "mData": "commonName"
}, },
{ {
"mData": "orderAmount" "mData": "orderAmount"
...@@ -473,6 +469,10 @@ ...@@ -473,6 +469,10 @@
"mData": "isThree" "mData": "isThree"
} }
, ,
{
"mData": "isSales"
}
,
{ {
"mData": "createTime" "mData": "createTime"
} }
...@@ -669,6 +669,19 @@ ...@@ -669,6 +669,19 @@
, ,
{ {
"aTargets": [12], "aTargets": [12],
"mData": "isSales",
"mRender": function (a, b, c, d) {
console.log(a);
if (a == '4') {
return '是';
} else {
return '否';
}
}
}
,
{
"aTargets": [13],
"mData": "createTime", "mData": "createTime",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
let time = formatDates(a); let time = formatDates(a);
...@@ -732,7 +745,7 @@ ...@@ -732,7 +745,7 @@
// } // }
//, //,
{ {
"aTargets": [13], "aTargets": [14],
"mData": "id", "mData": "id",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
var html = '#if($shiro.hasPermission("qy:order:edit"))'; var html = '#if($shiro.hasPermission("qy:order:edit"))';
......
...@@ -519,7 +519,10 @@ ...@@ -519,7 +519,10 @@
// html += '<li><a onclick="showModal(' + a + ')">订单关闭</a></li>'; // html += '<li><a onclick="showModal(' + a + ')">订单关闭</a></li>';
// } // }
if (c.status == '2') {//待发货才可以出库操作 if (c.status == '2') {//待发货才可以出库操作
html += '<li><a href="#springUrl("/a/order/sendOut?id=' + a + '")">订单出库</a></li>'; html += '<li><a href="#springUrl("/a/order/sendOut?pageType=Edit&id=' + a + '")">订单出库</a></li>';
}
if (c.status == '3' || c.status == '4') {//
html += '<li><a href="#springUrl("/a/order/sendOut?pageType=View&id=' + a + '")">订单出库详情</a></li>';
} }
html += '</ul>'; html += '</ul>';
html += '#end'; html += '#end';
......
...@@ -68,6 +68,7 @@ ...@@ -68,6 +68,7 @@
<result column="drugs_num" property="drugsNum"/> <result column="drugs_num" property="drugsNum"/>
<result column="product_number" property="productNumber"/> <result column="product_number" property="productNumber"/>
<result column="product_name" property="productName"/> <result column="product_name" property="productName"/>
<result column="common_name" property="commonName"/>
<result column="address_id" property="addressId"/> <result column="address_id" property="addressId"/>
<result column="courier_number" property="courierNumber"/> <result column="courier_number" property="courierNumber"/>
<result column="address_des" property="addressDes"/> <result column="address_des" property="addressDes"/>
...@@ -87,6 +88,7 @@ ...@@ -87,6 +88,7 @@
<result column="takeFrequency" property="takeFrequency"/> <result column="takeFrequency" property="takeFrequency"/>
<result column="fansAlias" property="fansAlias"/> <result column="fansAlias" property="fansAlias"/>
<result column="isThree" property="isThree"/> <result column="isThree" property="isThree"/>
<result column="isSales" property="isSales"/>
<collection property="list" ofType="com.cftech.order.model.ProductVO"> <collection property="list" ofType="com.cftech.order.model.ProductVO">
<result column="product_name" property="productName"/> <result column="product_name" property="productName"/>
</collection> </collection>
...@@ -263,11 +265,14 @@ ...@@ -263,11 +265,14 @@
o.cancel_time cancelTime, o.cancel_time cancelTime,
DATE_FORMAT(aw.create_time, '%Y-%m-%d %H:%i:%s') sendExpressDateStr, DATE_FORMAT(aw.create_time, '%Y-%m-%d %H:%i:%s') sendExpressDateStr,
DATE_FORMAT(aw.accept_express_date, '%Y-%m-%d %H:%i:%s') acceptExpressDateStr, DATE_FORMAT(aw.accept_express_date, '%Y-%m-%d %H:%i:%s') acceptExpressDateStr,
o.pay_time payTime o.pay_time payTime,
qyu.name storageManageName
from from
t_order o t_order o
LEFT JOIN t_shipping_address s ON o.address_id = s.id LEFT JOIN t_shipping_address s ON o.address_id = s.id
LEFT JOIN t_aidea_waybill aw ON o.id = aw.order_id LEFT JOIN t_aidea_waybill aw ON o.id = aw.order_id
LEFT JOIN user u ON u.id = aw.storage_manage
LEFT JOIN t_qyuser qyu ON qyu.id = u.userid
LEFT JOIN area a ON s.province_id = a.areaid LEFT JOIN area a ON s.province_id = a.areaid
LEFT JOIN area b ON s.city_id = b.areaid LEFT JOIN area b ON s.city_id = b.areaid
LEFT JOIN area c ON s.area_id = c.areaid LEFT JOIN area c ON s.area_id = c.areaid
...@@ -301,9 +306,33 @@ ...@@ -301,9 +306,33 @@
LEFT JOIN t_shipping_address s ON o.address_id = s.id LEFT JOIN t_shipping_address s ON o.address_id = s.id
LEFT JOIN t_order_details d ON o.id = d.order_id LEFT JOIN t_order_details d ON o.id = d.order_id
LEFT JOIN t_aidea_product t ON d.drugs_id = t.id LEFT JOIN t_aidea_product t ON d.drugs_id = t.id
LEFT JOIN wx_mp_fanss f ON f.openid = o.openid and f.delflag = '0'
LEFT JOIN wx_mp_member m on m.open_id = o.openid
LEFT JOIN t_aidea_authentication au ON m.cardid = au.id_card AND au.del_flag = '0'
LEFT JOIN t_shipping_address a on a.id = o.address_id
LEFT JOIN t_aidea_waybill aw ON o.id = aw.order_id
<include refid="sqlWhere"/> <include refid="sqlWhere"/>
<if test="userid != null"> AND (o.service_id = ${userid} or o.doctor_id =${userid} or o.clerk_id = ${userid}) </if> <if test="userid != null"> AND (o.service_id = ${userid} or o.doctor_id =${userid} or o.clerk_id = ${userid}) </if>
GROUP BY o.id ) duals <if test="userid != null"> AND (o.service_id = ${userid} or o.doctor_id =${userid} or o.clerk_id = ${userid}) </if>
GROUP BY o.id
<if test="orderAmount != null or payAmount != null">
HAVING 1=1
<choose>
<when test="orderAmount == 6">
AND drugsNum >= ${orderAmount}
</when>
<when test="payAmount == 6">
AND drugsNum >= ${payAmount}
</when>
<when test="orderAmount != 6">
AND drugsNum = ${orderAmount}
</when>
<when test="payAmount != 6">
AND drugsNum = ${payAmount}
</when>
</choose>
</if>
) duals
</select> </select>
<select id="fetchSearchByPage" parameterType="java.util.Map" resultMap="resultMapList"> <select id="fetchSearchByPage" parameterType="java.util.Map" resultMap="resultMapList">
...@@ -347,7 +376,8 @@ ...@@ -347,7 +376,8 @@
f.store fansAlias, f.store fansAlias,
au.status isThree, au.status isThree,
o.remarks, o.remarks,
SUM(d.drugs_num) drugsNum SUM(d.drugs_num) drugsNum,
(SELECT status FROM t_order sales WHERE sales.del_flag = '0' AND sales.status = '4' AND sales.openid = o.openid LIMIT 1) isSales
FROM t_order o FROM t_order o
LEFT JOIN t_aidea_consult_sheet cs ON o.consult_id = cs.id LEFT JOIN t_aidea_consult_sheet cs ON o.consult_id = cs.id
LEFT JOIN t_shipping_address s ON o.address_id = s.id LEFT JOIN t_shipping_address s ON o.address_id = s.id
...@@ -568,7 +598,7 @@ ...@@ -568,7 +598,7 @@
pay_time = now(), pay_amount = order_amount * 100, pay_time = now(), pay_amount = order_amount * 100,
</if> </if>
<if test="status != null and status == 5 and orderCancel!=null and orderCancel != ''"> <if test="status != null and status == 5 and orderCancel!=null and orderCancel != ''">
cancel_time = now(), cancel_time = now(), remind_type = null,
</if> </if>
<if test="orderCancel!=null and orderCancel != ''"> <if test="orderCancel!=null and orderCancel != ''">
order_cancel = #{orderCancel} order_cancel = #{orderCancel}
...@@ -597,11 +627,14 @@ ...@@ -597,11 +627,14 @@
c.areaname AS area, c.areaname AS area,
s.phone, s.phone,
s.address, s.address,
t.confirm t.confirm,
f.nickname,
f.sex
FROM FROM
t_order t t_order t
LEFT JOIN t_order_details d ON t.id =d.order_id LEFT JOIN t_order_details d ON t.id =d.order_id
LEFT JOIN t_aidea_product p ON d.drugs_id = p.id LEFT JOIN t_aidea_product p ON d.drugs_id = p.id
LEFT JOIN wx_mp_fanss f ON f.openid = t.openid
LEFT JOIN t_shipping_address s ON t.address_id = s.id LEFT JOIN t_shipping_address s ON t.address_id = s.id
LEFT JOIN area a ON s.province_id = a.areaid LEFT JOIN area a ON s.province_id = a.areaid
LEFT JOIN area b ON s.city_id = b.areaid LEFT JOIN area b ON s.city_id = b.areaid
...@@ -639,7 +672,8 @@ ...@@ -639,7 +672,8 @@
p.is_rs AS isrs, p.is_rs AS isrs,
p.product_img AS productImg, p.product_img AS productImg,
p.format, p.format,
t.drugs_num drugsNum t.drugs_num drugsNum,
p.unit
FROM t_order_details t LEFT JOIN t_aidea_product p ON t.drugs_id = p.id FROM t_order_details t LEFT JOIN t_aidea_product p ON t.drugs_id = p.id
WHERE t.del_flag = 0 WHERE t.del_flag = 0
<if test="orderId!=null"> <if test="orderId!=null">
......
...@@ -7,4 +7,8 @@ public class DrugVo { ...@@ -7,4 +7,8 @@ public class DrugVo {
private String drugs; private String drugs;
private String orderId;
private String pageType;
} }
...@@ -36,7 +36,7 @@ public class Order extends OrderDetail implements Serializable { ...@@ -36,7 +36,7 @@ public class Order extends OrderDetail implements Serializable {
@ExportConfig(value = "订单金额", width = 100, showLevel = 1) @ExportConfig(value = "订单金额", width = 100, showLevel = 1)
private Double orderAmount; private Double orderAmount;
/* 商品最终金额 */ /* 商品最终金额 */
@ExportConfig(value = "商品最终金额", width = 100, showLevel = 1) @ExportConfig(value = "订单原价", width = 100, showLevel = 1)
private Double totalAmount; private Double totalAmount;
/* 付款时间 */ /* 付款时间 */
@ExportConfig(value = "付款时间", width = 100, showLevel = 1) @ExportConfig(value = "付款时间", width = 100, showLevel = 1)
...@@ -166,6 +166,8 @@ public class Order extends OrderDetail implements Serializable { ...@@ -166,6 +166,8 @@ public class Order extends OrderDetail implements Serializable {
private String fansAlias;//粉丝别名 private String fansAlias;//粉丝别名
private String isThree;//是否三期用户 private String isThree;//是否三期用户
private String payUrl;//支付链接 private String payUrl;//支付链接
private String commonName;//产品全名称
private String isSales;//是否购买
public Order() { public Order() {
...@@ -596,4 +598,20 @@ public class Order extends OrderDetail implements Serializable { ...@@ -596,4 +598,20 @@ public class Order extends OrderDetail implements Serializable {
public void setIsFirst(boolean first) { public void setIsFirst(boolean first) {
isFirst = first; isFirst = first;
} }
public String getCommonName() {
return commonName;
}
public void setCommonName(String commonName) {
this.commonName = commonName;
}
public String getIsSales() {
return isSales;
}
public void setIsSales(String isSales) {
this.isSales = isSales;
}
} }
\ No newline at end of file
...@@ -43,6 +43,7 @@ public class OrderFromVO { ...@@ -43,6 +43,7 @@ public class OrderFromVO {
private String sendExpressDateStr; private String sendExpressDateStr;
private String acceptExpressDateStr; private String acceptExpressDateStr;
private String payTime; private String payTime;
private String storageManageName;
} }
...@@ -54,6 +54,10 @@ public class OrderMobile { ...@@ -54,6 +54,10 @@ public class OrderMobile {
private long time; private long time;
private String nickname;
private String sex;
private List<ProductMobile> ProductMobile; private List<ProductMobile> ProductMobile;
} }
...@@ -19,8 +19,10 @@ public class ProductMobile { ...@@ -19,8 +19,10 @@ public class ProductMobile {
private String productImg; private String productImg;
/*商品规格*/ /*商品规格*/
private String format; private String format;
/*商品规格*/ /*商品数量*/
private Long drugsNum; private Long drugsNum;
/*商品单位*/
private String unit;
} }
...@@ -111,10 +111,10 @@ public class WechatPayUtils { ...@@ -111,10 +111,10 @@ public class WechatPayUtils {
params.put("sign", sign); params.put("sign", sign);
String xmlObj = parseXML(params); String xmlObj = parseXML(params);
System.out.print(xmlObj); log.info("商户号请求参数="+xmlObj + "===========end");
try { try {
String result = sendPost(HttpClients.createDefault(), "https://api.mch.weixin.qq.com/pay/unifiedorder", xmlObj); String result = sendPost(HttpClients.createDefault(), "https://api.mch.weixin.qq.com/pay/unifiedorder", xmlObj);
log.info("商户号订单:" + result); log.info("商户号订单:" + result + "===========end");
return xmlToStr(result); return xmlToStr(result);
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
......
...@@ -169,7 +169,7 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order ...@@ -169,7 +169,7 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
Order order = this.fetchSearchByConds(orderConds); Order order = this.fetchSearchByConds(orderConds);
//当前订单所购艾邦德数量,金额 //当前订单所购艾邦德数量,金额
String drugsId = SystemConfig.p.getProperty("THREE_GRUGS_ID"); String drugsId = SystemConfig.p.getProperty("THREE_DRUGS_ID");
Long drugNum = 0L; Long drugNum = 0L;
Double price = null; Double price = null;
...@@ -204,6 +204,7 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order ...@@ -204,6 +204,7 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
orderDetailDto.setAccountsId(accountsId); orderDetailDto.setAccountsId(accountsId);
this.saveDetill(orderDetailDto); this.saveDetill(orderDetailDto);
//获取艾邦德药品
if (Long.parseLong(drugsId) == obj.getLong("productId")) { if (Long.parseLong(drugsId) == obj.getLong("productId")) {
drugNum = obj.getLong("drugsNum"); drugNum = obj.getLong("drugsNum");
price = obj.getDouble("price"); price = obj.getDouble("price");
...@@ -217,22 +218,32 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order ...@@ -217,22 +218,32 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
return rtnJson; return rtnJson;
} }
//获取商户号订单内容 //订单金额为0,不调用商户号
JSONObject mchObj = WechatPayUtils.genenatePay(order); if ((new BigDecimal(order.getOrderAmount()).compareTo(new BigDecimal(0))) == 0) {
if (mchObj != null) {
order.setStatus("1"); order.setStatus("1");
order.setOrderTime(new Date()); order.setOrderTime(new Date());
order.setOrderAmount(orderAmount); boolean bool = update(order);
order.setRemarks(mchObj.toString());
boolean bool = this.update(order);
if (bool) { if (bool) {
rtnJson.put("errorNo", "0"); rtnJson.put("errorNo", "0");
rtnJson.put("errorMsg", "确认成功!"); rtnJson.put("errorMsg", "确认成功!");
return rtnJson; return rtnJson;
} }
} else { } else {//获取商户号订单内容
//商户号调用失败抛出异常回滚 JSONObject mchObj = WechatPayUtils.genenatePay(order);
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); if (mchObj != null) {
order.setStatus("1");
order.setOrderTime(new Date());
order.setRemarks(mchObj.toString());
boolean bool = update(order);
if (bool) {
rtnJson.put("errorNo", "0");
rtnJson.put("errorMsg", "确认成功!");
return rtnJson;
}
} else {
//商户号调用失败抛出异常回滚
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
}
} }
rtnJson.put("errorNo", "1"); rtnJson.put("errorNo", "1");
...@@ -251,16 +262,15 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order ...@@ -251,16 +262,15 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
BigDecimal nums = null;//折扣数量 BigDecimal nums = null;//折扣数量
//三期用户 //三期用户
Conds conds = new Conds(); Conds conds = new Conds();
conds.equal("d.del_flag", Constants.DEL_FLAG_0); conds.equal("t.del_flag", Constants.DEL_FLAG_0);
conds.equal("o.del_flag", Constants.DEL_FLAG_0); conds.equal("t.openid", order.getOpenid());
conds.equal("d.openid", order.getOpenid()); Calendar cal = Calendar.getInstance();
conds.equal("o.openid", order.getOpenid()); int year = cal.get(Calendar.YEAR);
conds.equal("YEAR(d.create_time)", new Date().getYear()); conds.equal("YEAR(t.create_time)", year);
conds.equal("d.drugs_id", SystemConfig.p.getProperty("THREE_GRUGS_ID"));
conds.notEqual("d.order_id", order.getId());
Integer number = orderDetailsService.fetchMemberByYearGoodsNum(conds);//已购药品数据 Integer number = orderDetailsService.fetchMemberByYearGoodsNum(conds);//已购药品数据
if (number >= 12) { if (number >= 12) {
order.setOrderAmount(orderAmount); order.setTotalAmount(orderAmount * 100);//订单原价
order.setOrderAmount(orderAmount);//实际需支付价格
} else { } else {
int realNum = (12 - number);//剩余每年免费盒数 int realNum = (12 - number);//剩余每年免费盒数
if (num.intValue() < realNum) { if (num.intValue() < realNum) {
...@@ -271,11 +281,14 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order ...@@ -271,11 +281,14 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
BigDecimal saleAmount = unitP.multiply(nums);//三期患者折扣价格 BigDecimal saleAmount = unitP.multiply(nums);//三期患者折扣价格
BigDecimal sumAmount = new BigDecimal(orderAmount);//订单总价 BigDecimal sumAmount = new BigDecimal(orderAmount);//订单总价
BigDecimal realAmount = sumAmount.subtract(saleAmount);//实际需支付价格 BigDecimal realAmount = sumAmount.subtract(saleAmount);//实际需支付价格
order.setOrderAmount(realAmount.doubleValue()); order.setTotalAmount(sumAmount.doubleValue() * 100);//订单原价
order.setOrderAmount(realAmount.doubleValue());//实际需支付价格
order.setRemindType(nums.toString());//三期患者本单免费数量
} }
} else { } else {
//非三期用户 //非三期用户
order.setOrderAmount(orderAmount); order.setTotalAmount(orderAmount * 100);//订单原价
order.setOrderAmount(orderAmount);//实际需支付价格
} }
} }
...@@ -422,7 +435,7 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order ...@@ -422,7 +435,7 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
Conds conds = new Conds(); Conds conds = new Conds();
conds.equal("o.id", invoiceDto.getId()); conds.equal("o.id", invoiceDto.getId());
conds.equal("o.del_flag", Constants.DEL_FLAG_0); conds.equal("o.del_flag", Constants.DEL_FLAG_0);
List<Order> list = this.fetchSearchBy(conds, null, 0, 0, null, "0", "0"); List<Order> list = this.fetchSearchBy(conds, null, 0, 0, null, null, null);
if (list.size() > 0) { if (list.size() > 0) {
for (Order order : list) { for (Order order : list) {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
......
...@@ -22,6 +22,8 @@ import com.cftech.core.sql.Sort; ...@@ -22,6 +22,8 @@ import com.cftech.core.sql.Sort;
import com.cftech.core.util.Constants; import com.cftech.core.util.Constants;
import com.cftech.order.utils.DoubleJSONFilter; import com.cftech.order.utils.DoubleJSONFilter;
import com.cftech.order.utils.InvoiceUtil; import com.cftech.order.utils.InvoiceUtil;
import com.cftech.orderdetail.model.OrderSplitBatchDto;
import com.cftech.orderdetail.service.OrderDetailsService;
import com.cftech.orderdetail.web.OrderDetailsController; import com.cftech.orderdetail.web.OrderDetailsController;
import com.cftech.sys.model.User; import com.cftech.sys.model.User;
import com.cftech.sys.model.UserRole; import com.cftech.sys.model.UserRole;
...@@ -46,6 +48,7 @@ import javax.servlet.http.HttpServletRequest; ...@@ -46,6 +48,7 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.math.BigDecimal;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
...@@ -103,6 +106,9 @@ public class OrderController { ...@@ -103,6 +106,9 @@ public class OrderController {
@Autowired @Autowired
private RoleService roleService; private RoleService roleService;
@Autowired
private OrderDetailsService orderDetailsService;
//列表页面 //列表页面
@RequiresPermissions(value = ORDER_VIEW) @RequiresPermissions(value = ORDER_VIEW)
@RequestMapping("/list") @RequestMapping("/list")
...@@ -173,7 +179,7 @@ public class OrderController { ...@@ -173,7 +179,7 @@ public class OrderController {
//订单出货页面 //订单出货页面
@RequiresPermissions(value = ORDER_VIEW) @RequiresPermissions(value = ORDER_VIEW)
@RequestMapping("/sendOut") @RequestMapping("/sendOut")
public String sendOut(HttpServletRequest request, String id, Model model) { public String sendOut(HttpServletRequest request, String id, Model model, String pageType) {
if (StringUtils.isNoneBlank(id)) { if (StringUtils.isNoneBlank(id)) {
OrderFromVO orderFromVO = orderService.fetchId(id); OrderFromVO orderFromVO = orderService.fetchId(id);
List<OrderFromVO> fromVO = orderService.fetchProductId(id); List<OrderFromVO> fromVO = orderService.fetchProductId(id);
...@@ -182,6 +188,7 @@ public class OrderController { ...@@ -182,6 +188,7 @@ public class OrderController {
model.addAttribute("data", jsonObject); model.addAttribute("data", jsonObject);
model.addAttribute("list", jsonArray); model.addAttribute("list", jsonArray);
} }
model.addAttribute("pageType", StringUtils.equals(pageType, "View") ? true : false);
return "order/orderSendOut"; return "order/orderSendOut";
} }
...@@ -258,28 +265,27 @@ public class OrderController { ...@@ -258,28 +265,27 @@ public class OrderController {
if (StringUtils.isNoneBlank(order.getCourierNumber())) { if (StringUtils.isNoneBlank(order.getCourierNumber())) {
conds.like("o.courier_number", order.getCourierNumber()); conds.like("o.courier_number", order.getCourierNumber());
} }
// //订单开始金额
// if (StringUtils.isNoneBlank(order.getStartOrderAmount())) {
// conds.greatEqual("o.order_amount", order.getStartOrderAmount());
// }
// //订单结束金额
// if (StringUtils.isNoneBlank(order.getEndOrderAmount())) {
// conds.lessEqual("o.order_amount", order.getEndOrderAmount());
// }
// //最终开始金额
// if (StringUtils.isNoneBlank(order.getStartPayAmount())) {
// conds.greatEqual("o.total_amount", Integer.parseInt(order.getStartPayAmount()) * 100);
// }
// //最终结束金额
// if (StringUtils.isNoneBlank(order.getEndPayAmount())) {
// conds.lessEqual("o.total_amount", Integer.parseInt(order.getEndPayAmount()) * 100);
// }
//别ing
if (StringUtils.isNoneBlank(order.getFansAlias())) {
conds.like("f.store", order.getFansAlias());
}
//订单状态 if (StringUtils.equals("-1", order.getStatus())) {
if (StringUtils.isNoneBlank(order.getStatus())) { conds.in("o.status", new String[]{"0", "1"});
} else if (StringUtils.isNoneBlank(order.getStatus())) {
conds.equal("o.status", order.getStatus()); conds.equal("o.status", order.getStatus());
} else if (StringUtils.equals("all", order.getStatus())) {
}
//三期患者
if (StringUtils.equals("3", order.getIsThree())) {
conds.equal("au.status", "0");
} else if (StringUtils.equals("4", order.getIsThree())) {
conds.equal("au.status", "1");
} }
//是否开票 //是否开票
if (StringUtils.isNoneBlank(order.getIsBill()) && StringUtils.equals(order.getIsBill(), "1")) {//未开票 if (StringUtils.isNoneBlank(order.getIsBill()) && StringUtils.equals(order.getIsBill(), "1")) {//未开票
conds.isNull("o.confirm"); conds.isNull("o.confirm");
...@@ -335,9 +341,14 @@ public class OrderController { ...@@ -335,9 +341,14 @@ public class OrderController {
conds.in("o.id", id.split(",")); conds.in("o.id", id.split(","));
conds.equal("o.del_flag", Constants.DEL_FLAG_0); conds.equal("o.del_flag", Constants.DEL_FLAG_0);
conds.equal("o.accounts_id", accountsId); conds.equal("o.accounts_id", accountsId);
List<Order> list = orderService.fetchSearchBy(conds, null, 0, 0, userid, "0", "0"); List<Order> list = orderService.fetchSearchBy(conds, null, 0, 0, userid, null, null);
if (list.size() > 0) { if (list.size() > 0) {
for (Order order : list) { for (Order order : list) {
//订单为0无法开票
if (new BigDecimal(0).compareTo(new BigDecimal(order.getOrderAmount())) == 0) {
continue;
}
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
order.setCreateTimeStr(format.format(order.getCreateTime())); order.setCreateTimeStr(format.format(order.getCreateTime()));
String str = invoiceUtil.startInvoice(order, String.valueOf(userid), email, "0", "1", null, null); String str = invoiceUtil.startInvoice(order, String.valueOf(userid), email, "0", "1", null, null);
...@@ -434,22 +445,6 @@ public class OrderController { ...@@ -434,22 +445,6 @@ public class OrderController {
if (StringUtils.isNoneBlank(order.getCourierNumber())) { if (StringUtils.isNoneBlank(order.getCourierNumber())) {
conds.like("o.courier_number", order.getCourierNumber()); conds.like("o.courier_number", order.getCourierNumber());
} }
// //订单开始金额
// if (StringUtils.isNoneBlank(order.getStartOrderAmount())) {
// conds.greatEqual("o.order_amount", order.getStartOrderAmount());
// }
// //订单结束金额
// if (StringUtils.isNoneBlank(order.getEndOrderAmount())) {
// conds.lessEqual("o.order_amount", order.getEndOrderAmount());
// }
// //最终开始金额
// if (StringUtils.isNoneBlank(order.getStartPayAmount())) {
// conds.greatEqual("o.total_amount", Integer.parseInt(order.getStartPayAmount()) * 100);
// }
// //最终结束金额
// if (StringUtils.isNoneBlank(order.getEndPayAmount())) {
// conds.lessEqual("o.total_amount", Integer.parseInt(order.getEndPayAmount()) * 100);
// }
//订单状态 //订单状态
if (StringUtils.isNoneBlank(order.getStatus())) { if (StringUtils.isNoneBlank(order.getStatus())) {
conds.equal("o.status", order.getStatus()); conds.equal("o.status", order.getStatus());
...@@ -653,24 +648,46 @@ public class OrderController { ...@@ -653,24 +648,46 @@ public class OrderController {
return rtnJson; return rtnJson;
} }
String drugs = StringEscapeUtils.unescapeHtml4(drugVo.getDrugs()); if (StringUtils.isNoneBlank(drugVo.getOrderId()) && StringUtils.equals(drugVo.getPageType(), "true")) {
List<Map<String, Object>> list = new ArrayList<>(); Conds conds = new Conds();
JSONArray drugArr = JSONArray.parseArray(drugs); conds.equal("t.del_flag", Constants.DEL_FLAG_0);
for (int i=0; i<drugArr.size(); i++) { conds.equal("t.order_id", drugVo.getOrderId());
JSONObject drugObj = drugArr.getJSONObject(i); List<OrderSplitBatchDto> dtos = orderDetailsService.fetchSearchByBatchDrug(conds, null, 0, 0);
for (int y=0; y<drugObj.getInteger("orderNum"); y++) { List<Map<String, Object>> list = new ArrayList<>();
for (int i=0; i<dtos.size(); i++) {
OrderSplitBatchDto orderSplitBatchDto = dtos.get(i);
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put("drugCode", drugObj.getString("productCode")); map.put("drugId", orderSplitBatchDto.getDrugsId());
map.put("drugName", drugObj.getString("productName")); map.put("drugCode", orderSplitBatchDto.getDrugsCode());
map.put("drugName", orderSplitBatchDto.getDrugsName());
map.put("num", 1); map.put("num", 1);
map.put("batchNO", ""); map.put("batchNO", orderSplitBatchDto.getDrugsBatchNo());
list.add(map); list.add(map);
} }
} rtnJson.put("iTotalRecords", 0);
rtnJson.put("iTotalDisplayRecords", 0);
rtnJson.put("aaData", list);
} else {
String drugs = StringEscapeUtils.unescapeHtml4(drugVo.getDrugs());
List<Map<String, Object>> list = new ArrayList<>();
JSONArray drugArr = JSONArray.parseArray(drugs);
for (int i=0; i<drugArr.size(); i++) {
JSONObject drugObj = drugArr.getJSONObject(i);
for (int y=0; y<drugObj.getInteger("orderNum"); y++) {
Map<String, Object> map = new HashMap<>();
map.put("drugId", drugObj.getString("productId"));
map.put("drugCode", drugObj.getString("productCode"));
map.put("drugName", drugObj.getString("productName"));
map.put("num", 1);
map.put("batchNO", "");
list.add(map);
}
}
rtnJson.put("iTotalRecords", 100); rtnJson.put("iTotalRecords", 0);
rtnJson.put("iTotalDisplayRecords", 100); rtnJson.put("iTotalDisplayRecords", 0);
rtnJson.put("aaData", list); rtnJson.put("aaData", list);
}
return rtnJson; return rtnJson;
} }
} }
...@@ -353,13 +353,19 @@ ...@@ -353,13 +353,19 @@
<select id="countOutReport" parameterType="java.util.Map" resultType="java.lang.Integer"> <select id="countOutReport" parameterType="java.util.Map" resultType="java.lang.Integer">
SELECT COUNT(1) FROM t_aidea_report SELECT
COUNT(1)
FROM t_order_split_batch sb
LEFT JOIN t_order o ON sb.order_id = o.id AND o.del_flag = '0'
LEFT JOIN t_aidea_consult_sheet cs ON cs.order_id = o.id AND cs.del_flag = '0'
LEFT JOIN t_aidea_product p ON p.id = sb.drugs_id AND p.del_flag = '0'
LEFT JOIN t_aidea_waybill w ON o.id = w.order_id AND w.del_flag = '0'
<include refid="sqlWhere"/> <include refid="sqlWhere"/>
</select> </select>
<select id="fetchSearchByPageOutReport" parameterType="java.util.Map" resultType="com.cftech.report.model.OutStoreReport"> <select id="fetchSearchByPageOutReport" parameterType="java.util.Map" resultType="com.cftech.report.model.OutStoreReport">
SELECT SELECT
sb.id,
cs.consult_id consultCode, cs.consult_id consultCode,
o.number orderCode, o.number orderCode,
p.common_name drugName, p.common_name drugName,
......
...@@ -8,6 +8,8 @@ import lombok.Data; ...@@ -8,6 +8,8 @@ import lombok.Data;
@Data @Data
public class OutStoreReport { public class OutStoreReport {
private String id;
/* 咨询单编码 */ /* 咨询单编码 */
private String consultCode; private String consultCode;
......
...@@ -102,9 +102,9 @@ public class OutStoreReportController { ...@@ -102,9 +102,9 @@ public class OutStoreReportController {
public JSONObject listData(int iDisplayStart, int iDisplayLength, Report report, HttpServletRequest request,String startPayTime,String endPayTime) { public JSONObject listData(int iDisplayStart, int iDisplayLength, Report report, HttpServletRequest request,String startPayTime,String endPayTime) {
Long accountsId = UserUtils.getmpaccounts(request); Long accountsId = UserUtils.getmpaccounts(request);
Conds conds = new Conds(); Conds conds = new Conds();
conds.equal("del_flag", Constants.DEL_FLAG_0); conds.equal("sb.del_flag", Constants.DEL_FLAG_0);
//conds.equal("accounts_id", accountsId); //conds.equal("accounts_id", accountsId);
Sort sort = new Sort("create_time", OrderType.DESC); Sort sort = new Sort("sb.create_time", OrderType.DESC);
List<Report> list = reportService.fetchSearchByPageOutReport(conds, sort, iDisplayStart, iDisplayLength); List<Report> list = reportService.fetchSearchByPageOutReport(conds, sort, iDisplayStart, iDisplayLength);
......
...@@ -47,11 +47,121 @@ ...@@ -47,11 +47,121 @@
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]--> <![endif]-->
<style>
.invoice {
padding: 20px 10px;
padding-right: 20px;
width: 270px;
}
.describe {
margin-left: 50px;
}
.header span {
margin-left: 10px;
}
.splitline {
border-bottom: 2px dashed #000;
margin-top: 10px;
margin-bottom: 10px;
}
.contents .cont_list {
display: flex;
justify-content: space-between;
}
.product .product_list {
display: flex;
justify-content: space-between;
}
.money span {
margin-left: 20px;
}
.Placeholder {
height: 5px;
}
.think {
text-align: center;
}
</style>
</head> </head>
<!-- END HEAD --> <!-- END HEAD -->
<body class="hold-transition skin-blue sidebar-mini"> <body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper"> <!--startprint-->
<div id="printContent" style="display:none;">
<div class="invoice">
<div class="header">
<div class="storename">诺康大药房咨询平台</div>
<div class="describe">***一切为了百姓***</div>
<div class="orderNumber">订单号 <span>$!{printData.orderCode}</span></div>
<div class="deliverydate">发货日期 <span>$!date.format('yyyy-MM-dd HH:mm:ss',$!printData.printDate)</span></div>
<div class="splitline"></div>
</div>
#foreach($item in $!$!printData.orders)
<div class="contents">
<div class="cont_list">
<div>品名</div>
<div>单位</div>
</div>
<div class="cont_list">
<div>售价</div>
<div>数量</div>
<div>小计</div>
</div>
<div class="cont_list">
<div>编号</div>
<div>规格</div>
</div>
<div class="cont_list">
<div>厂家</div>
</div>
<div class="splitline"></div>
</div>
<div class="product">
<div class="product_list">
<div>$item.drugName</div>
<div>$item.unit</div>
</div>
<div class="product_list">
<div>$item.price</div>
<div>$item.drugNum</div>
<div>$item.amount</div>
</div>
<div class="product_list">
<div>$item.drugCode</div>
<div>$item.format</div>
</div>
<div class="product_list">
<div>$item.factory</div>
</div>
</div>
#end
<div class="splitline"></div>
<div class="money">实收金额: <span>$!{printData.orderAmount}</span></div>
<div class="splitline"></div>
<div class="Placeholder"></div>
<div class="splitline"></div>
<div class="footer">
<div class="think">***谢谢惠顾***</div>
<div class="think">[如非质量问题,概不退换]</div>
<div>门店电话:400-828-4688</div>
<div>门店地址:扬州市运河西路233号</div>
</div>
</div>
</div>
<!--endprint-->
<div id="mainContent" class="wrapper">
<div class="content-wrapper" style="margin-left:0;"> <div class="content-wrapper" style="margin-left:0;">
<section class="content-header"> <section class="content-header">
...@@ -143,32 +253,32 @@ ...@@ -143,32 +253,32 @@
</div> </div>
<!--<div class="form-group form-md-line-input col-xs-5">--> <!--<div class="form-group form-md-line-input col-xs-5">-->
<!--<label>省份</label>--> <!--<label>省份</label>-->
<!--<input type="text"--> <!--<input type="text"-->
<!--class="form-control" id="province" name="province"--> <!--class="form-control" id="province" name="province"-->
<!--maxlength="500" placeholder="省份"--> <!--maxlength="500" placeholder="省份"-->
<!--value="$!{data.province}" readonly>--> <!--value="$!{data.province}" readonly>-->
<!--</div>--> <!--</div>-->
<!--<div class="form-group form-md-line-input col-xs-5">--> <!--<div class="form-group form-md-line-input col-xs-5">-->
<!--<label>城市</label>--> <!--<label>城市</label>-->
<!--<input type="text"--> <!--<input type="text"-->
<!--class="form-control" id="city" name="city"--> <!--class="form-control" id="city" name="city"-->
<!--maxlength="500" placeholder="城市"--> <!--maxlength="500" placeholder="城市"-->
<!--value="$!{data.city}" readonly>--> <!--value="$!{data.city}" readonly>-->
<!--</div>--> <!--</div>-->
<!--<div class="form-group form-md-line-input col-xs-5">--> <!--<div class="form-group form-md-line-input col-xs-5">-->
<!--<label>县/区级行政区名称</label>--> <!--<label>县/区级行政区名称</label>-->
<!--<input type="text"--> <!--<input type="text"-->
<!--class="form-control" id="county" name="county"--> <!--class="form-control" id="county" name="county"-->
<!--maxlength="500" placeholder="县/区级行政区名称"--> <!--maxlength="500" placeholder="县/区级行政区名称"-->
<!--value="$!{data.county}" readonly>--> <!--value="$!{data.county}" readonly>-->
<!--</div>--> <!--</div>-->
<!--<div class="form-group form-md-line-input col-xs-5">--> <!--<div class="form-group form-md-line-input col-xs-5">-->
<!--<label>详细地址</label>--> <!--<label>详细地址</label>-->
<!--<textarea class="form-control" id="address" name="address" rows="3" readonly>$!{data.address}</textarea>--> <!--<textarea class="form-control" id="address" name="address" rows="3" readonly>$!{data.address}</textarea>-->
<!--</div>--> <!--</div>-->
</div> </div>
</div> </div>
...@@ -228,6 +338,7 @@ ...@@ -228,6 +338,7 @@
<div class="box-footer"> <div class="box-footer">
#if($shiro.hasPermission("qy:waybill:edit")) #if($shiro.hasPermission("qy:waybill:edit"))
<input class="btn btn-primary" id="save" value="保存" type="submit"> <input class="btn btn-primary" id="save" value="保存" type="submit">
<input class="btn btn-primary" value="打印随行单" id="printSheet">
#end #end
<a href="#springUrl('/a/waybill/list')" class="btn btn-default">取消</a> <a href="#springUrl('/a/waybill/list')" class="btn btn-default">取消</a>
</div> </div>
...@@ -268,15 +379,25 @@ ...@@ -268,15 +379,25 @@
<script src="js/jquery.form.min.js"></script> <script src="js/jquery.form.min.js"></script>
<script type="text/javascript" charset="utf-8" src="plugins/ueditor-min-1.4.3/ueditor.config.js"></script> <script type="text/javascript" charset="utf-8" src="plugins/ueditor-min-1.4.3/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="plugins/ueditor-min-1.4.3/ueditor.all.js"></script> <script type="text/javascript" charset="utf-8" src="plugins/ueditor-min-1.4.3/ueditor.all.js"></script>
<script type="text/javascript" charset="utf-8" src="plugins/ueditor-min-1.4.3/lang/zh-cn/zh-cn.js"></script>
<script src="common/js/cfapp.js"></script>
<!-- END PAGE LEVEL PLUGINS -->
<script> <script>
$().ready(function () { $().ready(function () {
Cfapp.init(); Cfapp.init();
recdTypeAdd.init(); recdTypeAdd.init();
$('#printSheet').click(function () {
printSheets();
});
}); });
function printSheets() {
document.getElementById("mainContent").style.display = "none";
document.getElementById("printContent").style.display = "block";
window.print();
document.getElementById("printContent").style.display = "none";
document.getElementById("mainContent").style.display = "block";
}
var recdTypeAdd = function () { var recdTypeAdd = function () {
var initForm = function () { var initForm = function () {
...@@ -337,6 +458,9 @@ ...@@ -337,6 +458,9 @@
}; };
}(); }();
</script> </script>
<script type="text/javascript" charset="utf-8" src="plugins/ueditor-min-1.4.3/lang/zh-cn/zh-cn.js"></script>
<script src="common/js/cfapp.js"></script>
<!-- END PAGE LEVEL PLUGINS -->
</body> </body>
<!-- END BODY --> <!-- END BODY -->
</html> </html>
\ No newline at end of file
package com.cftech.waybill.dao; package com.cftech.waybill.dao;
import com.cftech.waybill.model.FollowPrinter;
import com.cftech.waybill.model.OrderPrinter;
import com.cftech.waybill.model.Waybill; import com.cftech.waybill.model.Waybill;
import com.cftech.core.generic.GenericDao; import com.cftech.core.generic.GenericDao;
import java.util.List;
/** /**
* 顺丰物流运单Mapper * 顺丰物流运单Mapper
* *
...@@ -17,4 +21,18 @@ public interface WaybillMapper extends GenericDao<Waybill> { ...@@ -17,4 +21,18 @@ public interface WaybillMapper extends GenericDao<Waybill> {
* @return * @return
*/ */
Waybill fetchByWayBillId(String id); Waybill fetchByWayBillId(String id);
/**
* 获取打印随行单实体
* @param orderId
* @return
*/
FollowPrinter findFollowPrinterData(Long orderId);
/**
* 获取打印订单下所有商品明细
* @param orderId
* @return
*/
List<OrderPrinter> findOrderPrinters(Long orderId);
} }
\ No newline at end of file
...@@ -469,4 +469,33 @@ ...@@ -469,4 +469,33 @@
<update id="delete" parameterType="java.lang.Long"> <update id="delete" parameterType="java.lang.Long">
update t_aidea_waybill set del_flag=1 where id=#{id,jdbcType=BIGINT} update t_aidea_waybill set del_flag=1 where id=#{id,jdbcType=BIGINT}
</update> </update>
<!-- 获取顺丰随行单打印实体 -->
<select id="findFollowPrinterData" parameterType="java.lang.Long" resultType="com.cftech.waybill.model.FollowPrinter">
SELECT
t.id orderId,
t.number orderCode,
now() printDate,
t.order_amount orderAmount,
IFNULL(SUM(d.amount), 0) oldAmount
FROM t_order t
LEFT JOIN t_order_details d ON t.id = d.order_id
WHERE t.id = #{orderId, jdbcType=BIGINT}
</select>
<select id="findOrderPrinters" parameterType="java.lang.Long" resultType="com.cftech.waybill.model.OrderPrinter">
SELECT
t.id detailId,
t.drugs_code drugCode,
p.common_name drugName,
t.drugs_num drugNum,
t.price,
t.amount,
p.unit,
p.format,
p.manufacturer factory
FROM t_order_details t
LEFT JOIN t_aidea_product p ON t.drugs_id = p.id
WHERE t.order_id = #{orderId, jdbcType=BIGINT}
</select>
</mapper> </mapper>
\ No newline at end of file
package com.cftech.waybill.model;
import lombok.Data;
import java.util.List;
@Data
public class FollowPrinter {
private String orderId;
private String orderCode;
private String printDate;
private String orderAmount;
private String oldAmount;
private List<OrderPrinter> orders;
}
package com.cftech.waybill.model;
import lombok.Data;
@Data
public class OrderPrinter {
private String detailId;
private String drugCode;
private String drugName;
private String drugNum;
private String price;
private String amount;
private String unit;
private String format;
private String factory;
}
package com.cftech.waybill.service; package com.cftech.waybill.service;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.cftech.waybill.model.FollowPrinter;
import com.cftech.waybill.model.Waybill; import com.cftech.waybill.model.Waybill;
import com.cftech.core.generic.GenericService; import com.cftech.core.generic.GenericService;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.util.List;
/** /**
* 顺丰物流运单Service * 顺丰物流运单Service
...@@ -34,4 +36,11 @@ public interface WaybillService extends GenericService<Waybill> { ...@@ -34,4 +36,11 @@ public interface WaybillService extends GenericService<Waybill> {
* @return * @return
*/ */
JSONObject orderPrinterBill(HttpServletRequest request, Long orderId); JSONObject orderPrinterBill(HttpServletRequest request, Long orderId);
/**
* 获取打印随行单实体
* @param orderId
* @return
*/
FollowPrinter findFollowPrinterData(Long orderId);
} }
...@@ -15,6 +15,8 @@ import com.cftech.orderdetail.model.OrderSplitBatchDto; ...@@ -15,6 +15,8 @@ import com.cftech.orderdetail.model.OrderSplitBatchDto;
import com.cftech.orderdetail.service.OrderDetailsService; import com.cftech.orderdetail.service.OrderDetailsService;
import com.cftech.sys.model.User; import com.cftech.sys.model.User;
import com.cftech.sys.security.UserUtils; import com.cftech.sys.security.UserUtils;
import com.cftech.waybill.model.FollowPrinter;
import com.cftech.waybill.model.OrderPrinter;
import com.cftech.waybill.model.Waybill; import com.cftech.waybill.model.Waybill;
import com.cftech.waybill.dao.WaybillMapper; import com.cftech.waybill.dao.WaybillMapper;
import com.cftech.waybill.service.WaybillService; import com.cftech.waybill.service.WaybillService;
...@@ -194,6 +196,7 @@ public class WaybillServiceImpl extends GenericServiceImpl<Waybill> implements W ...@@ -194,6 +196,7 @@ public class WaybillServiceImpl extends GenericServiceImpl<Waybill> implements W
orderSplitBatchDto.setOrderId(order.getId()); orderSplitBatchDto.setOrderId(order.getId());
orderSplitBatchDto.setOrderCode(order.getNumber()); orderSplitBatchDto.setOrderCode(order.getNumber());
orderSplitBatchDto.setDrugsBatchNo(drugs.getString("batchNo")); orderSplitBatchDto.setDrugsBatchNo(drugs.getString("batchNo"));
orderSplitBatchDto.setDrugsId(drugs.getLong("drugId"));
orderSplitBatchDto.setDrugsName(drugs.getString("drugName")); orderSplitBatchDto.setDrugsName(drugs.getString("drugName"));
orderSplitBatchDto.setDrugsCode(drugs.getString("drugCode")); orderSplitBatchDto.setDrugsCode(drugs.getString("drugCode"));
orderSplitBatchDto.setDrugsNum(drugs.getLong("num")); orderSplitBatchDto.setDrugsNum(drugs.getLong("num"));
...@@ -312,5 +315,16 @@ public class WaybillServiceImpl extends GenericServiceImpl<Waybill> implements W ...@@ -312,5 +315,16 @@ public class WaybillServiceImpl extends GenericServiceImpl<Waybill> implements W
return retObj; return retObj;
} }
@Override
public FollowPrinter findFollowPrinterData(Long orderId) {
FollowPrinter followPrinter = waybillMapper.findFollowPrinterData(orderId);
if (followPrinter != null) {
List<OrderPrinter> orderPrinters = waybillMapper.findOrderPrinters(orderId);
followPrinter.setOrders(orderPrinters);
return followPrinter;
}
return null;
}
} }
\ No newline at end of file
...@@ -7,6 +7,7 @@ import com.cftech.order.model.Order; ...@@ -7,6 +7,7 @@ import com.cftech.order.model.Order;
import com.cftech.order.service.OrderService; import com.cftech.order.service.OrderService;
import com.cftech.orderdetail.model.OrderDetails; import com.cftech.orderdetail.model.OrderDetails;
import com.cftech.orderdetail.service.OrderDetailsService; import com.cftech.orderdetail.service.OrderDetailsService;
import com.cftech.waybill.model.FollowPrinter;
import com.cftech.waybill.model.Waybill; import com.cftech.waybill.model.Waybill;
import com.cftech.waybill.service.WaybillService; import com.cftech.waybill.service.WaybillService;
import com.cftech.core.poi.ExcelKit; import com.cftech.core.poi.ExcelKit;
...@@ -90,6 +91,9 @@ public class WaybillController { ...@@ -90,6 +91,9 @@ public class WaybillController {
waybill.setAcceptExpressDateStr(DateFormatUtils.getDateFormat(waybill.getAcceptExpressDate(), "yyyy-MM-dd HH:ss")); waybill.setAcceptExpressDateStr(DateFormatUtils.getDateFormat(waybill.getAcceptExpressDate(), "yyyy-MM-dd HH:ss"));
} }
} }
//获取打印随行单
FollowPrinter prints = waybillService.findFollowPrinterData(waybill.getOrderId());
model.addAttribute("printData", prints);
model.addAttribute("data", waybill); model.addAttribute("data", waybill);
} }
return "waybill/waybillform"; return "waybill/waybillform";
......
...@@ -5,12 +5,14 @@ WX_MP_SERVER_APPID=wxc587e8869baec269 ...@@ -5,12 +5,14 @@ WX_MP_SERVER_APPID=wxc587e8869baec269
WX_MP_QRCODE_URI=https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket= WX_MP_QRCODE_URI=https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=
#\u670D\u52A1\u53F7\u6A21\u677F\u6D88\u606F ID LIST #\u670D\u52A1\u53F7\u6A21\u677F\u6D88\u606F ID LIST
#\u54A8\u8BE2\u5355\u5BA1\u6838\u901A\u8FC7\u6A21\u677F\u6D88\u606F #\u54A8\u8BE2\u5355\u5DF2\u5B8C\u6210\u901A\u77E5\u6A21\u677F\u6D88\u606F
CONSULT_SHEET_AUDIT_SUCCESS_TEMPLATE_MSG=AoZzYGqvG5h5wDDDOE_fUrdMOam-QTqTc7wkBO7-VmU CONSULT_SHEET_AUDIT_SUCCESS_TEMPLATE_MSG=AoZzYGqvG5h5wDDDOE_fUrdMOam-QTqTc7wkBO7-VmU
#\u54A8\u8BE2\u5355\u5BA1\u6838\u62D2\u7EDD\u6A21\u677F\u6D88\u606F #\u54A8\u8BE2\u5355\u5BA1\u6838\u4E0D\u901A\u8FC7\u901A\u77E5\u6A21\u677F\u6D88\u606F
CONSULT_SHEET_AUDIT_REFUSE_TEMPLATE_MSG=VSTKsUB_vK8UaiaZplmgk4IvrqIAfIiRD54mUlGR0k0 CONSULT_SHEET_AUDIT_REFUSE_TEMPLATE_MSG=VSTKsUB_vK8UaiaZplmgk4IvrqIAfIiRD54mUlGR0k0
#\u54A8\u8BE2\u4F46\u5BA1\u6838\u5931\u8D25\u6A21\u677F\u6D88\u606F #\u54A8\u8BE2\u5355\u5BA1\u6838\u5931\u8D25\u901A\u77E5\u6A21\u677F\u6D88\u606F
CONSULT_SHEET_AUDIT_FAILED_TEMPLATE_MSG=77tLdRPQx1m8Gg0-t9HCGVOlka0G4ocFPdq8D5UkHwk CONSULT_SHEET_AUDIT_FAILED_TEMPLATE_MSG=77tLdRPQx1m8Gg0-t9HCGVOlka0G4ocFPdq8D5UkHwk
#\u68C0\u6D4B\u7ED3\u679C\u901A\u77E5\u6A21\u677F\u6D88\u606F
CHECK_RESULT_TEMPLATE_MSG=5Fy77DKlvulE4L2vxsQfhOsJuRqQzIoI-LSmDYWCJt0
#\u4F01\u4E1A\u53F7\u914D\u7F6E\u4FE1\u606F #\u4F01\u4E1A\u53F7\u914D\u7F6E\u4FE1\u606F
ROOT_ORG_NAME=\u6C5F\u82CF\u827E\u8FEA\u836F\u4E1A ROOT_ORG_NAME=\u6C5F\u82CF\u827E\u8FEA\u836F\u4E1A
...@@ -55,7 +57,7 @@ THREE_DRUGS_ID=24 ...@@ -55,7 +57,7 @@ THREE_DRUGS_ID=24
#\u56FE\u7247\u8BBF\u95EE\u5730\u5740 #\u56FE\u7247\u8BBF\u95EE\u5730\u5740
IMAGEURL=/aidea/mobile/qybase/showPic?picFileName={PICFILENAME} IMAGEURL=/aidea/mobile/qybase/showPic?picFileName={PICFILENAME}
#\u4E8C\u7EF4\u7801\u8BBF\u95EE\u8DEF\u5F84 #\u4E8C\u7EF4\u7801\u8BBF\u95EE\u5730\u5740
QRCODEURL=/aidea/mobile/qybase/showQrcode?picFileName={PICFILENAME} QRCODEURL=/aidea/mobile/qybase/showQrcode?picFileName={PICFILENAME}
ROOT_MATERIALCATEGORY_NAME=\u7D20\u6750\u7C7B\u578B ROOT_MATERIALCATEGORY_NAME=\u7D20\u6750\u7C7B\u578B
ARTICLEDETAILURL=http://www.changfu-tech.com/schaeffler/static/mp/dc/buy-car/dc-news-detail.html?appid={APPID}&articleId={ID} ARTICLEDETAILURL=http://www.changfu-tech.com/schaeffler/static/mp/dc/buy-car/dc-news-detail.html?appid={APPID}&articleId={ID}
...@@ -65,7 +67,7 @@ LOG_URL=http://www.michang-tech.com.cn:6989/log/addlog ...@@ -65,7 +67,7 @@ LOG_URL=http://www.michang-tech.com.cn:6989/log/addlog
#\u6821\u9A8C\u5151\u6362\u5BC6\u7801KEY #\u6821\u9A8C\u5151\u6362\u5BC6\u7801KEY
MEMBER_PASSWORD_KEY=DONGCHANGINT9527; MEMBER_PASSWORD_KEY=DONGCHANGINT9527;
list.refreshtoken=true list.refreshtoken=true
jwt.domain=localhost jwt.domain=pd.shxrtech.com
#\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD #\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD
jwt.duration=86400000 jwt.duration=86400000
#\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u03AAtrue #\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u03AAtrue
...@@ -82,6 +84,7 @@ sf.checkWord=5Nhuavqk0JG7zTYLtPKq7JpnceuekRcH ...@@ -82,6 +84,7 @@ sf.checkWord=5Nhuavqk0JG7zTYLtPKq7JpnceuekRcH
sf.monthlyCard=7551234567 sf.monthlyCard=7551234567
#\u8BFA\u8BFA\u5F00\u7968\u914D\u7F6E\u4FE1\u606F\u53C2\u6570 #\u8BFA\u8BFA\u5F00\u7968\u914D\u7F6E\u4FE1\u606F\u53C2\u6570
INVOICE_URL=https://sandbox.nuonuocs.cn/open/v1/services
INVOICE_TOKEN=4d02142a23eece11a0407f0sghefntms INVOICE_TOKEN=4d02142a23eece11a0407f0sghefntms
SQ_INVOICE_TAX=91321000MA22HQQ953 SQ_INVOICE_TAX=91321000MA22HQQ953
INVOICE_TAX=339901999999824 INVOICE_TAX=339901999999824
...@@ -99,7 +102,8 @@ INVOICE_API=nuonuo.ElectronInvoice.requestBillingNew ...@@ -99,7 +102,8 @@ INVOICE_API=nuonuo.ElectronInvoice.requestBillingNew
INVOICE_QUERY_API=nuonuo.ElectronInvoice.queryInvoiceResult INVOICE_QUERY_API=nuonuo.ElectronInvoice.queryInvoiceResult
#\u90AE\u7BB1\u63A8\u9001\u63A5\u53E3 #\u90AE\u7BB1\u63A8\u9001\u63A5\u53E3
INVOICE_SEND_EMAIL_API=nuonuo.ElectronInvoice.deliveryInvoice INVOICE_SEND_EMAIL_API=nuonuo.ElectronInvoice.deliveryInvoice
INVOICE_URL=https://sandbox.nuonuocs.cn/open/v1/services #\u83B7\u53D6\u53D1\u7968PDF\u63A5\u53E3
INVOICE_OPEN_PDF_API=nuonuo.ElectronInvoice.getPDF
REGION_LONG_ID=0,1,5, REGION_LONG_ID=0,1,5,
......
...@@ -28,9 +28,9 @@ QY_SEND_APPID=350 ...@@ -28,9 +28,9 @@ QY_SEND_APPID=350
#\u4F01\u4E1A\u53F7\u4F1A\u8BDD\u5185\u5BB9\u5B58\u6863 #\u4F01\u4E1A\u53F7\u4F1A\u8BDD\u5185\u5BB9\u5B58\u6863
QY_CHAT_WORK=351 QY_CHAT_WORK=351
#\u63A8\u9001\u5BA2\u670D\u6D88\u606F\u6DFB\u52A0\u7528\u6237 #\u63A8\u9001\u5BA2\u670D\u6D88\u606F\u6DFB\u52A0\u7528\u6237
QY_SEND_CUSTOMERSERVICE_MSG=\u60A8\u6536\u5230\u4E00\u5F20\u54A8\u8BE2\u5355\uFF0C\u54A8\u8BE2\u5355\u7F16\u7801\uFF1A QY_SEND_CUSTOMERSERVICE_MSG=\u60A8\u6536\u5230\u4E00\u5F20\u54A8\u8BE2\u5355\uFF0C\u54A8\u8BE2\u5355\u7F16\u7801\uFF1A{NUMBER}\uFF0C\u6635\u79F0\uFF1A{NICKNAME}\uFF0C\u522B\u540D\uFF1A{FANSALIAS}
#\u63A8\u9001\u836F\u5E08\u6D88\u606F\u5BA1\u6279\u54A8\u8BE2\u5355 #\u63A8\u9001\u836F\u5E08\u6D88\u606F\u5BA1\u6279\u54A8\u8BE2\u5355
QY_SEND_DOCTOR_MSG=\u60A8\u6536\u5230\u4E00\u5F20\u54A8\u8BE2\u5355\uFF0C\u8BF7\u5BA1\u6279\uFF0C\u54A8\u8BE2\u5355\u7F16\u7801\uFF1A QY_SEND_DOCTOR_MSG=\u60A8\u6536\u5230\u4E00\u5F20\u54A8\u8BE2\u5355\uFF0C\u8BF7\u5BA1\u6279\uFF0C\u54A8\u8BE2\u5355\u7F16\u7801\uFF1A{NUMBER}\uFF0C\u6635\u79F0\uFF1A{NICKNAME}\uFF0C\u522B\u540D\uFF1A{fansAlias}
#\u63A8\u9001\u8BA2\u5355\u5458\u53D1\u8D27\u6D88\u606F #\u63A8\u9001\u8BA2\u5355\u5458\u53D1\u8D27\u6D88\u606F
QY_SEND_ORDERCLERK_MSG=\u60A8\u6536\u5230\u4E00\u5F20\u5F85\u53D1\u8D27\u8BA2\u5355\uFF0C\u8BA2\u5355\u7F16\u7801: QY_SEND_ORDERCLERK_MSG=\u60A8\u6536\u5230\u4E00\u5F20\u5F85\u53D1\u8D27\u8BA2\u5355\uFF0C\u8BA2\u5355\u7F16\u7801:
#\u63A8\u9001\u5BA2\u670D\u8DDF\u8FDB\u63D0\u9192\u6D88\u606F #\u63A8\u9001\u5BA2\u670D\u8DDF\u8FDB\u63D0\u9192\u6D88\u606F
...@@ -46,9 +46,17 @@ userfiles.imgdir=/mydata/fileResource ...@@ -46,9 +46,17 @@ userfiles.imgdir=/mydata/fileResource
#\u4F1A\u8BDD\u5185\u5BB9\u5B58\u6863\u5730\u5740 #\u4F1A\u8BDD\u5185\u5BB9\u5B58\u6863\u5730\u5740
userfiles.msgdir=/mydata/wechatSdk/ userfiles.msgdir=/mydata/wechatSdk/
userfiles.imagedir=/mydata/wechatImage userfiles.imagedir=/mydata/wechatImage
#\u75C5\u8F7D\u6838\u9500\u4E8C\u7EF4\u7801
userfiles.qrcodedir=/mydata/fileQrcode
#\u4E09\u671F\u60A3\u8005\u6298\u6263\u836F\u54C1id
THREE_DRUGS_ID=24
#\u56FE\u7247\u8BBF\u95EE\u5730\u5740 #\u56FE\u7247\u8BBF\u95EE\u5730\u5740
IMAGEURL=/aidea/mobile/qybase/showPic?picFileName={PICFILENAME} IMAGEURL=/aidea/mobile/qybase/showPic?picFileName={PICFILENAME}
#\u4E8C\u7EF4\u7801\u8BBF\u95EE\u5730\u5740
QRCODEURL=/aidea/mobile/qybase/showQrcode?picFileName={PICFILENAME}
ROOT_MATERIALCATEGORY_NAME=\u7D20\u6750\u7C7B\u578B ROOT_MATERIALCATEGORY_NAME=\u7D20\u6750\u7C7B\u578B
ARTICLEDETAILURL=http://www.changfu-tech.com/schaeffler/static/mp/dc/buy-car/dc-news-detail.html?appid={APPID}&articleId={ID} ARTICLEDETAILURL=http://www.changfu-tech.com/schaeffler/static/mp/dc/buy-car/dc-news-detail.html?appid={APPID}&articleId={ID}
ARTICLEDETAILPICURL=http://localhost:8080/schaeffler/static/article/picDetail.html?accountsid={ACCOUNTSID}&id={ID} ARTICLEDETAILPICURL=http://localhost:8080/schaeffler/static/article/picDetail.html?accountsid={ACCOUNTSID}&id={ID}
...@@ -74,6 +82,7 @@ sf.checkWord=ExAMu7ADrjDeUMJCKOAf45Ywgo2q12Sd ...@@ -74,6 +82,7 @@ sf.checkWord=ExAMu7ADrjDeUMJCKOAf45Ywgo2q12Sd
sf.monthlyCard=5141870609 sf.monthlyCard=5141870609
#\u8BFA\u8BFA\u5F00\u7968\u914D\u7F6E\u4FE1\u606F\u53C2\u6570 #\u8BFA\u8BFA\u5F00\u7968\u914D\u7F6E\u4FE1\u606F\u53C2\u6570
INVOICE_URL=https://sdk.nuonuo.com/open/vi/services
INVOICE_TOKEN=4d02142a23eece11a0407f0jge3cbk0s INVOICE_TOKEN=4d02142a23eece11a0407f0jge3cbk0s
#SQ_INVOICE_TAX=91321000MA22HQQ953 #SQ_INVOICE_TAX=91321000MA22HQQ953
INVOICE_TAX=91321000MA22HQQ953 INVOICE_TAX=91321000MA22HQQ953
...@@ -91,7 +100,8 @@ INVOICE_API=nuonuo.ElectronInvoice.requestBillingNew ...@@ -91,7 +100,8 @@ INVOICE_API=nuonuo.ElectronInvoice.requestBillingNew
INVOICE_QUERY_API=nuonuo.ElectronInvoice.queryInvoiceResult INVOICE_QUERY_API=nuonuo.ElectronInvoice.queryInvoiceResult
#\u90AE\u7BB1\u63A8\u9001\u63A5\u53E3 #\u90AE\u7BB1\u63A8\u9001\u63A5\u53E3
INVOICE_SEND_EMAIL_API=nuonuo.ElectronInvoice.deliveryInvoice INVOICE_SEND_EMAIL_API=nuonuo.ElectronInvoice.deliveryInvoice
INVOICE_URL=https://sdk.nuonuo.com/open/vi/services #\u83B7\u53D6\u53D1\u7968PDF\u63A5\u53E3
INVOICE_OPEN_PDF_API=nuonuo.ElectronInvoice.getPDF
REGION_LONG_ID=0,1,5, REGION_LONG_ID=0,1,5,
...@@ -106,3 +116,12 @@ mch.notify_url=https://pe.aidea.com.cn/aidea/mobile/auth/order/wechatCallback ...@@ -106,3 +116,12 @@ mch.notify_url=https://pe.aidea.com.cn/aidea/mobile/auth/order/wechatCallback
#\u4ED8\u6B3E\u754C\u9762\u6807\u9898 #\u4ED8\u6B3E\u754C\u9762\u6807\u9898
mch.title=\u8BFA\u5EB7\u5927\u836F\u623F\u54A8\u8BE2\u5E73\u53F0 mch.title=\u8BFA\u5EB7\u5927\u836F\u623F\u54A8\u8BE2\u5E73\u53F0
#\u817E\u8BAFMAP\u914D\u7F6E\u4FE1\u606F\u53C2\u6570
#\u63A5\u53E3\u5730\u5740\u57DF\u540D
map.domain_name=apis.map.qq.com
#\u5730\u5740\u89E3\u6790\u63A5\u53E3
map.ads_resolve=https://apis.map.qq.com/ws/geocoder/v1/?address=${address}
#\u5F00\u53D1\u8005\u5BC6\u94A5
map.key=OPIBZ-VYIW2-CK7UO-CM4WN-ELY2K-EUFYP
#\u7B7E\u540D\u5BC6\u94A5
map.secret_key=W1je0RfMuDsfxCy73M0b3iEfZRF5cAcU
\ No newline at end of file
...@@ -98,6 +98,10 @@ ...@@ -98,6 +98,10 @@
<input id="gender" name="gender" value="$!{data.gender}" hidden="true"/> <input id="gender" name="gender" value="$!{data.gender}" hidden="true"/>
<input id="isVer" name="isVer" value="$!{data.isVer}" hidden="true"/> <input id="isVer" name="isVer" value="$!{data.isVer}" hidden="true"/>
<input id="role" name="role" value="$!{data.role}" hidden="true"/> <input id="role" name="role" value="$!{data.role}" hidden="true"/>
<input type="text" style="display: none" name="_csrf" value="${_csrf.token}"/>
<input type="text" style="display: none" name="_csrf_header"
value="${_csrf.headerName}"/>
<div class="box-body"> <div class="box-body">
<div class="form-group form-md-line-input col-md-4"> <div class="form-group form-md-line-input col-md-4">
<label>所属组织</label> <label>所属组织</label>
...@@ -131,19 +135,17 @@ ...@@ -131,19 +135,17 @@
<input type="text" <input type="text"
class="form-control" name="loginNameQyUser" id="loginNameQyUser" class="form-control" name="loginNameQyUser" id="loginNameQyUser"
maxlength="50" placeholder="登录账号" maxlength="50" placeholder="登录账号"
value="$!{data.loginName}"> value="$!{data.loginName}" #if ($!{isView}=='true')
readonly="readonly" #end>
</div> </div>
<input type="text" style="display: none" name="_csrf" value="${_csrf.token}"/>
<input type="text" style="display: none" name="_csrf_header"
value="${_csrf.headerName}"/>
<div class="form-group form-md-line-input col-md-4"> <div class="form-group form-md-line-input col-md-4">
<label for="passwordQyUser">密码</label> <label for="passwordQyUser">密码</label>
<input type="password" class="form-control" name="passwordQyUser" <input type="password" class="form-control" name="passwordQyUser"
id="passwordQyUser" id="passwordQyUser"
placeholder="请输入密码" maxlength="50" minlength="3"> placeholder="请输入密码" maxlength="50" minlength="3">
</div> </div>
<div class="form-group form-md-line-input col-md-4"> <div class="form-group form-md-line-input col-md-4">
<label for="email">EMAIL</label> <label for="email">EMAIL</label>
<input type="text" <input type="text"
...@@ -152,6 +154,14 @@ ...@@ -152,6 +154,14 @@
value="$!{data.email}"> value="$!{data.email}">
</div> </div>
<div class="form-group form-md-line-input col-md-4">
<label for="storeName">别名</label>
<input type="text"
class="form-control" name="storeName" id="storeName"
maxlength="50" placeholder="别名"
value="$!{data.storeName}">
</div>
<div class="form-group form-md-line-input col-md-4"> <div class="form-group form-md-line-input col-md-4">
<label>角色</label> <label>角色</label>
<select name="userType" class="form-control pull-right"> <select name="userType" class="form-control pull-right">
...@@ -309,7 +319,7 @@ ...@@ -309,7 +319,7 @@
coverPP = new uePicPicker({ coverPP = new uePicPicker({
tarId: 'img', tarId: 'img',
title: '客服名片', title: '客服名片',
sizeDes: '205*202', sizeDes: '',
max: 1, max: 1,
datas: smallimg=='' ? null : smallimg.split(","), datas: smallimg=='' ? null : smallimg.split(","),
success: null success: null
......
...@@ -342,7 +342,7 @@ ...@@ -342,7 +342,7 @@
"mData": "qrcode", "mData": "qrcode",
"mRender": function (a, b, c, d) {//a表示对应mData的值,c表示当前记录行对象 "mRender": function (a, b, c, d) {//a表示对应mData的值,c表示当前记录行对象
if (a) { if (a) {
return "<img src='https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=" + a + "' style='width: 80px;height: 80px;'>"; return "<img src='"+a+"' style='height: 100px; width: 100px;'>";
} }
return "<font color='red'>未绑定</font>"; return "<font color='red'>未绑定</font>";
} }
...@@ -382,7 +382,7 @@ ...@@ -382,7 +382,7 @@
'<span class="sr-only">Toggle Dropdown</span>\n' + '<span class="sr-only">Toggle Dropdown</span>\n' +
'</button>\n' + '</button>\n' +
'<ul class="dropdown-menu" role="menu">\n'; '<ul class="dropdown-menu" role="menu">\n';
html += "<li><a href=#springUrl('/a/qyuser/form?id=" + a +"') >修改</a></li>"; html += "<li><a href=#springUrl('/a/qyuser/form?pageType=Edit&id=" + a +"') >修改</a></li>";
if (c.userType == '0' || c.userType == '1' || c.userType == '2') { if (c.userType == '0' || c.userType == '1' || c.userType == '2') {
html += "<li><a href='javascript:bindQrCode(" + a + ", "+ c.userType +")' >绑定二维码</a></li>"; html += "<li><a href='javascript:bindQrCode(" + a + ", "+ c.userType +")' >绑定二维码</a></li>";
if (c.qrcode != null) if (c.qrcode != null)
......
...@@ -90,6 +90,7 @@ public class QyUserUtil { ...@@ -90,6 +90,7 @@ public class QyUserUtil {
qyuser.setAvatar(userInfo.getString("avatar")); qyuser.setAvatar(userInfo.getString("avatar"));
qyuser.setStatus(userInfo.getString("status")); qyuser.setStatus(userInfo.getString("status"));
qyuser.setWxno(userInfo.getString("weixinid")); qyuser.setWxno(userInfo.getString("weixinid"));
qyuser.setQrcode(userInfo.getString("qr_code"));
} }
return qyuser; return qyuser;
} }
...@@ -105,45 +106,26 @@ public class QyUserUtil { ...@@ -105,45 +106,26 @@ public class QyUserUtil {
departments.add(orgUnit.getWxorgId()); departments.add(orgUnit.getWxorgId());
postObj.put("department", departments); postObj.put("department", departments);
} }
// if (!StringUtils.isEmpty(qyuser.getPositionId())) {
// Position position = positionService.fetchById(qyuser.getPositionId());
// postObj.put("position", position.getName());
// }
if (!StringUtils.isEmpty(qyuser.getGender())) { if (!StringUtils.isEmpty(qyuser.getGender())) {
postObj.put("gender", qyuser.getGender().equals("男") ? "1" : "2"); postObj.put("gender", qyuser.getGender().equals("男") ? "1" : "2");
} }
//别名
if (!StringUtils.isEmpty(qyuser.getStoreName())) {
postObj.put("alias", qyuser.getStoreName());
postObj.put("external_position", qyuser.getStoreName());
}
if (!StringUtils.isEmpty(qyuser.getEmail())) if (!StringUtils.isEmpty(qyuser.getEmail()))
postObj.put("email", qyuser.getEmail()); postObj.put("email", qyuser.getEmail());
if (!StringUtils.isEmpty(qyuser.getWxno())) if (!StringUtils.isEmpty(qyuser.getWxno()))
postObj.put("weixinid", qyuser.getWxno()); postObj.put("weixinid", qyuser.getWxno());
Position position = positionService.fetchById(qyuser.getPositionId()); if (!StringUtils.isEmpty(qyuser.getPositionId())) {
if (position != null) { Position position = positionService.fetchById(qyuser.getPositionId());
postObj.put("position", position.getName()); if (position != null) {
postObj.put("position", position.getName());
}
} }
postObj.put("to_invite", false);//不推送企业微信 postObj.put("to_invite", false);//不推送企业微信
// if (!StringUtils.isEmpty(qyuser.getUserType())) {
// switch (qyuser.getUserType()) {
// case "0":
// postObj.put("position", "其他");
// break;
// case "1":
// postObj.put("position", "药师");
// break;
// case "2":
// postObj.put("position", "客服");
// break;
// case "3":
// postObj.put("position", "医生");
// break;
// case "4":
// postObj.put("position", "订单员");
// break;
// }
// }
JSONObject retObj = WxApiUtils.userCreate(qyTokenUtil.getToken(qyuser.getAccountsId()), postObj); JSONObject retObj = WxApiUtils.userCreate(qyTokenUtil.getToken(qyuser.getAccountsId()), postObj);
...@@ -161,45 +143,25 @@ public class QyUserUtil { ...@@ -161,45 +143,25 @@ public class QyUserUtil {
departments.add(orgUnit.getWxorgId()); departments.add(orgUnit.getWxorgId());
postObj.put("department", departments); postObj.put("department", departments);
} }
// if (!StringUtils.isEmpty(qyuser.getPositionId())) {
// Position position = positionService.fetchById(qyuser.getPositionId());
// postObj.put("position", position.getName());
// }
if (!StringUtils.isEmpty(qyuser.getGender())) { if (!StringUtils.isEmpty(qyuser.getGender())) {
postObj.put("gender", qyuser.getGender().equals("男") ? "1" : "2"); postObj.put("gender", qyuser.getGender().equals("男") ? "1" : "2");
} }
if (!StringUtils.isEmpty(qyuser.getStoreName())) {
postObj.put("alias", qyuser.getStoreName());
postObj.put("external_position", qyuser.getStoreName());
}
if (!StringUtils.isEmpty(qyuser.getEmail())) if (!StringUtils.isEmpty(qyuser.getEmail()))
postObj.put("email", qyuser.getEmail()); postObj.put("email", qyuser.getEmail());
if (!StringUtils.isEmpty(qyuser.getWxno())) if (!StringUtils.isEmpty(qyuser.getWxno()))
postObj.put("weixinid", qyuser.getWxno()); postObj.put("weixinid", qyuser.getWxno());
Position position = positionService.fetchById(qyuser.getId()); if (!StringUtils.isEmpty(qyuser.getPositionId())) {
if (position != null) { Position position = positionService.fetchById(qyuser.getPositionId());
postObj.put("position", position.getName()); if (position != null) {
postObj.put("position", position.getName());
}
} }
// if (!StringUtils.isEmpty(qyuser.getUserType())) {
// switch (qyuser.getUserType()) {
// case "0":
// postObj.put("position", "其他");
// break;
// case "1":
// postObj.put("position", "药师");
// break;
// case "2":
// postObj.put("position", "客服");
// break;
// case "3":
// postObj.put("position", "医生");
// break;
// case "4":
// postObj.put("position", "订单员");
// break;
// }
// }
JSONObject retObj = WxApiUtils.userUpdate(qyTokenUtil.getToken(qyuser.getAccountsId()), postObj); JSONObject retObj = WxApiUtils.userUpdate(qyTokenUtil.getToken(qyuser.getAccountsId()), postObj);
return retObj.getIntValue("errcode") == 0; return retObj.getIntValue("errcode") == 0;
} }
......
...@@ -88,7 +88,7 @@ public class QyuserController { ...@@ -88,7 +88,7 @@ public class QyuserController {
//返回编辑页面(新增、修改) //返回编辑页面(新增、修改)
@RequiresPermissions(value = PermissionSign.QYUSER_VIEW) @RequiresPermissions(value = PermissionSign.QYUSER_VIEW)
@RequestMapping(value = "/form", method = {RequestMethod.GET, RequestMethod.POST}) @RequestMapping(value = "/form", method = {RequestMethod.GET, RequestMethod.POST})
public String form(HttpServletRequest request, String id, Model model , String orgId) { public String form(HttpServletRequest request, String id, Model model , String orgId, String pageType) {
Long accountId = Long.parseLong(qyAccounts); Long accountId = Long.parseLong(qyAccounts);
if (!StringUtils.isEmpty(id)) { if (!StringUtils.isEmpty(id)) {
Qyuser qyuser = qyuserService.fetchById(id); Qyuser qyuser = qyuserService.fetchById(id);
...@@ -119,6 +119,7 @@ public class QyuserController { ...@@ -119,6 +119,7 @@ public class QyuserController {
Sort sort = new Sort("t.create_time", OrderType.DESC); Sort sort = new Sort("t.create_time", OrderType.DESC);
List<Position> positionList = positionService.fetchSearchByPage(positionConds, sort, 0, 0); List<Position> positionList = positionService.fetchSearchByPage(positionConds, sort, 0, 0);
model.addAttribute("positions", positionList); model.addAttribute("positions", positionList);
model.addAttribute("isView", com.cftech.core.util.StringUtils.equals(pageType, "Edit") ? true : false);
return "managerqyuser/qyuseradd"; return "managerqyuser/qyuseradd";
} }
......
...@@ -145,7 +145,7 @@ public class QyTokenUtil { ...@@ -145,7 +145,7 @@ public class QyTokenUtil {
return getConfig().opsForValue().get(jskey); return getConfig().opsForValue().get(jskey);
} }
/** /**
* 通过主键ID,获取公众号实体 * 通过主键ID,获取公众号实体
*/ */
public MpAccountsEntity searchAccountsById(Long id){ public MpAccountsEntity searchAccountsById(Long id){
......
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