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

Submit by Strive

Submit Date 2021/03/09
parent b852f6c2
......@@ -91,7 +91,7 @@
id="sendCheckNo" name="sendCheckNo"
placeholder="送检编号"
value="$!{data.sendCheckNo}"
#if($!{pageType} == 'true') readonly="readonly" #end />
#if($!{pageType} == 'true') readonly="readonly" #elseif($!{edit} == 'true') readonly="readonly" #end />
</div>
<div class="form-group form-md-line-input col-xs-6">
......@@ -196,7 +196,7 @@
<label for="result">检测结果</label>
<textarea class="form-control" rows="3" id="result" name="result"
value="$!{data.result}" #if($!{pageType}== 'true')
readonly="readonly" #end></textarea>
readonly="readonly" #end>$!{data.result}</textarea>
</div>
<div class="form-group form-md-line-input col-md-12" id="img">
......@@ -370,6 +370,14 @@
location.href = "#springUrl('/a/checkresult/list')";
}
});
} else if (returnobj.errorNo == 3) {
Cfapp.alert({
message: "送检编码已存在",
btntext: "确定",
success: function () {
location.href = "#springUrl('/a/checkresult/list')";
}
});
} else {
Cfapp.alert({
message: "创建失败",
......
......@@ -69,7 +69,6 @@
</ol>
</section>
<!-- Main content -->
<section class="content">
<div class="row">
......@@ -90,7 +89,8 @@
<div class="col-xs-5">
<button type="button" class="search btn btn-primary">搜索</button>
#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 onclick="importExcel();" class="btn btn-primary">导入</a>
#end
......@@ -276,8 +276,8 @@
'</button>' +
'<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: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="javascript:void(0)" onclick="removeData('+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 += '</ul></div>';
return html;
}
......@@ -313,9 +313,11 @@
$.ajax({
type: "POST",
url: "#springUrl('/a/checkresult/delete')",
data: {id: data,
data: {
id: data,
_csrfheader: csrfheader.value,
_csrf: csrftoken.value},
_csrf: csrftoken.value
},
dataType: "json",
success: function (data) {
if (data.errorNo == 0) {
......@@ -354,8 +356,6 @@
});
}
</script>
</body>
</html>
......@@ -30,6 +30,7 @@
<result column="create_by" property="createBy"/>
<result column="update_by" property="updateBy"/>
<result column="name" property="name"/>
<result column="verifDate" property="verifDate"/>
</resultMap>
<sql id="sqlWhere">
......@@ -165,9 +166,10 @@
<select id="fetchSearchByPage" parameterType="java.util.Map" resultMap="resultMap">
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
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"/>
<if test="sort!=null">ORDER BY ${sort.param} ${sort.type}</if>
<if test="limit>0">limit #{offset},#{limit}</if>
......@@ -274,10 +276,12 @@
limit #{page}, #{pageSize}
</if>
</select>
<select id="checkCouponByNumber" parameterType="java.lang.String" resultMap="resultMap">
SELECT
<include refid="sqlColumns"/>
FROM t_aidea_check_result t
WHERE t.send_Check_No=#{number} AND t.del_flag = 0
</select>
</mapper>
\ No newline at end of file
......@@ -88,6 +88,9 @@ public class Checkresult implements Serializable {
private String checkDateStr;
private String reagentVerifDateStr;
private Date verifDate;//核销时间、检测时间
public Checkresult() {
this.delFlag = false;
this.status = "0";
......
......@@ -39,4 +39,11 @@ public interface CheckresultService extends GenericService<Checkresult> {
* @return
**/
JSONObject checkCouponByNumber(CouponrecordVo vo);
/**
* @Author Strive 推送患者检测结果
* @param checkresult
* @return
*/
boolean sendCheckResultMsg(Checkresult checkresult);
}
package com.cftech.checkresult.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.cftech.accounts.model.MpAccountsEntity;
import com.cftech.accounts.service.MpAccountsService;
import com.cftech.checkresult.model.Checkresult;
import com.cftech.checkresult.dao.CheckresultMapper;
......@@ -10,7 +9,15 @@ import com.cftech.checkresult.service.CheckresultService;
import com.cftech.core.generic.GenericDao;
import com.cftech.core.generic.GenericServiceImpl;
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.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.Qualifier;
import org.springframework.stereotype.Service;
......@@ -19,31 +26,34 @@ import java.util.List;
import java.util.Map;
/**
* 检测结果管理ServiceImpl
*
* @author Strive
* @date: 2021-01-27 17:19
*/
* 检测结果管理ServiceImpl
*
* @author Strive
* @date: 2021-01-27 17:19
*/
@Service("checkresultService")
public class CheckresultServiceImpl extends GenericServiceImpl<Checkresult> implements CheckresultService {
@Autowired
@Qualifier("checkresultMapper")
private CheckresultMapper checkresultMapper;
@Autowired
@Qualifier("checkresultMapper")
private CheckresultMapper checkresultMapper;
@Autowired
private MpAccountsService mpAccountsService;
@Override
public GenericDao<Checkresult> getGenericMapper() {
return checkresultMapper;
}
@Autowired
private MpTokenUtil mpTokenUtil;
@Override
public GenericDao<Checkresult> getGenericMapper() {
return checkresultMapper;
}
public JSONObject checkResultsList(CheckresultVo vo){
public JSONObject checkResultsList(CheckresultVo vo) {
JSONObject rtnJson = new JSONObject();
try {
List<Map<String,Object>> consultResult = checkresultMapper.checkResultsList(vo);
if (consultResult != null&&consultResult.size()>0) {
List<Map<String, Object>> consultResult = checkresultMapper.checkResultsList(vo);
if (consultResult != null && consultResult.size() > 0) {
rtnJson.put("errorNo", 0);
rtnJson.put("data", consultResult);
} else {
......@@ -57,7 +67,8 @@ return checkresultMapper;
}
return rtnJson;
}
public JSONObject fetchById(CheckresultVo vo){
public JSONObject fetchById(CheckresultVo vo) {
JSONObject rtnJson = new JSONObject();
try {
Checkresult info = checkresultMapper.fetchById(vo.getId());
......@@ -76,10 +87,10 @@ return checkresultMapper;
return rtnJson;
}
public JSONObject checkCouponByNumber(CouponrecordVo vo){
public JSONObject checkCouponByNumber(CouponrecordVo vo) {
JSONObject rtnJson = new JSONObject();
try {
com.cftech.checkresult.model.Checkresult info =checkresultMapper.checkCouponByNumber(vo.getNumber());
com.cftech.checkresult.model.Checkresult info = checkresultMapper.checkCouponByNumber(vo.getNumber());
if (info != null) {
rtnJson.put("errorCode", 0);
rtnJson.put("data", info);
......@@ -95,4 +106,68 @@ return checkresultMapper;
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 {
//编辑页面(新增、修改)
@RequiresPermissions(value = CHECKRESULT_VIEW)
@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)) {
Checkresult checkresult = checkresultService.fetchById(id);
model.addAttribute("data", checkresult);
}
model.addAttribute("pageType", pageType.equals("View") ? true : false);//是否查看页面
model.addAttribute("edit", StringUtils.equals(edit, "Edit") ? true : false);
return "checkresult/checkresultform";
}
......@@ -107,6 +108,17 @@ public class CheckresultController {
checkresultService.update(checkresult);
rtnJson.put("errorNo", 0);
} 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.setAccountsId(accountsId);
......@@ -114,7 +126,11 @@ public class CheckresultController {
checkresult.setAccountsId(UserUtils.getmpaccounts(request));
checkresult.setCreateBy(UserUtils.getUser().getId());
checkresult.setUpdateBy(UserUtils.getUser().getId());
checkresultService.save(checkresult);
if (checkresultService.save(checkresult)) {
//推送检测结果
checkresultService.sendCheckResultMsg(checkresult);
}
rtnJson.put("errorNo", 2);
}
} catch (Exception e) {
......@@ -135,8 +151,8 @@ public class CheckresultController {
if (StringUtils.isNoneBlank(checkresult.getName())) {
conds.like("t.name", checkresult.getName());
}
if (StringUtils.isNoneBlank(checkresult.getCheckNo())) {
conds.like("t.chech_no", checkresult.getCheckNo());
if (StringUtils.isNoneBlank(checkresult.getSendCheckNo())) {
conds.like("t.send_check_no", checkresult.getSendCheckNo());
}
Sort sort = new Sort("t.create_time", OrderType.DESC);
......@@ -166,12 +182,18 @@ public class CheckresultController {
@RequestMapping("/exportExcel")
@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);
Sort sort = new Sort("t.create_time", OrderType.ASC);
Conds conds = new Conds();
conds.equal("t.del_flag", 0);
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);
ExcelKit.$Export(Checkresult.class, response).toExcel(list, "检测结果管理信息");
}
......@@ -202,14 +224,23 @@ public class CheckresultController {
file.transferTo(storeFile);
ExcelKit.$Import().setEmptyCellValue("").readExcel(storeFile, rowData -> {
if (StringUtils.isNoneBlank(rowData.get(0))) {
Checkresult checkresult = new Checkresult();
checkresult.setAccountsId(accountId);
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);
//设置检测人员
Conds conds = new Conds();
conds.equal("del_flag", Constants.DEL_FLAG_0);
conds.equal("number", checkresult.getSendCheckNo());
conds.equal("t.del_flag", Constants.DEL_FLAG_0);
conds.equal("t.number", checkresult.getSendCheckNo());
Couponrecord couponrecord = couponrecordService.fetchSearchByConds(conds);
if (couponrecord != null) {
checkresult.setOpenid(couponrecord.getOpenid());
......@@ -231,7 +262,12 @@ public class CheckresultController {
checkresult.setUnit(rowData.get(9));
checkresult.setInstrument(rowData.get(10));
checkresult.setResult(rowData.get(11));
if (checkresult.getId() == null) {
checkresultService.save(checkresult);
} else {
checkresultService.update(checkresult);
}
}
});
} catch (IOException e) {
......
......@@ -91,6 +91,7 @@
<select id="isThree" name="isThree" class="form-control required">
<option value="">请选择患者类型</option>
<option value="3">三期患者</option>
<option value="4">四期患者</option>
</select>
</div>
......@@ -175,7 +176,7 @@
<th>订单编码</th>
<th>用药人姓名</th>
<th>别名</th>
<!-- <th>性别</th>-->
<!-- <th>性别</th>-->
<!-- <th>联系电话</th>-->
<th>是否购药</th>
<th>三期患者</th>
......@@ -422,9 +423,9 @@
"aTargets": [5],
"mData": "isSales",
"mRender": function (a, b, c, d) {
if (a == '1') {
if (a == '4') {
return '是';
} else if (a == '0') {
} else {
return '否';
}
}
......@@ -501,7 +502,8 @@
"mData": "createTime",
"mRender": function (a, b, c, d) {
if (a) {
return moment(a).format('YYYY-MM-DD HH:mm:ss');;
return moment(a).format('YYYY-MM-DD HH:mm:ss');
;
} else {
return null;
}
......@@ -611,10 +613,10 @@
}
function clearSearch() {
$("#seachTableForm input").each(function() {
$("#seachTableForm input").each(function () {
$(this).val('');
});
$("select").each(function() {
$("select").each(function () {
$(this).find("option[value='']").prop("selected", true);
});
$("#table").dataTable().fnClearTable();
......
......@@ -217,7 +217,7 @@
SELECT
<include refid="sqlColumns"/>,
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
FROM t_aidea_consult_sheet a
LEFT JOIN t_order o ON a.order_id = o.id
......
......@@ -141,8 +141,11 @@ public class ConsultSheetServiceImpl extends GenericServiceImpl<ConsultSheet> im
//展示客服二维码
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("data", serviceCus.getDescription());
retObj.put("data", serviceCusObj);
retObj.put("errorMsg", "咨询单提交成功,请等待药师审核");
} else {
retObj.put("errorNo", 1);
......@@ -190,7 +193,7 @@ public class ConsultSheetServiceImpl extends GenericServiceImpl<ConsultSheet> im
conds.equal("o.openid", openid);
conds.in("o.status", new String[]{"4"});// 4:已成交
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) { //复购
Order order = orders.get(0);
......
......@@ -198,6 +198,8 @@ public class ConsultSheetController {
}
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())) {
conds.equal("a.status", consultSheet.getStatus());
......@@ -253,8 +255,18 @@ public class ConsultSheetController {
Long accountId = UserUtils.getmpaccounts(request);
Sort sort = new Sort("a.create_time", OrderType.ASC);
Conds conds = new Conds();
conds.equal("a.del_flag", Constants.DEL_FLAG_0);
conds.equal("a.accounts_id", accountId);
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())) {
conds.equal("a.status", consultSheet.getStatus());
......@@ -274,8 +286,9 @@ public class ConsultSheetController {
if (StringUtils.isNoneBlank(consultSheet.getEndAuditTime())) {
conds.lessEqual("DATE_FORMAT(a.audit_time, '%Y-%m-%d')", consultSheet.getEndAuditTime());
}
conds.equal("a.del_flag", Constants.DEL_FLAG_0);
conds.equal("a.accounts_id", accountId);
if (StringUtils.isNoneBlank(consultSheet.getOpenId())) {
conds.equal("a.open_id", consultSheet.getOpenId());
}
List<ConsultSheet> list = consultSheetService.fetchSearchByPage(conds, sort, 0, 0);
List<ConsultSheetVO> consultSheetVOS = new LinkedList<>();
......
......@@ -123,7 +123,7 @@
<select id="fetchById" parameterType="java.lang.Long" resultMap="resultMap">
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
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'
......@@ -140,7 +140,7 @@
<select id="fetchSearchByPage" parameterType="java.util.Map" resultMap="resultMap">
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
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'
......@@ -308,17 +308,20 @@
update_time = now()
where id = #{id,jdbcType=VARCHAR}
</update>
<insert id="insertPdaLog" parameterType="java.util.Map" useGeneratedKeys="true"
keyProperty="id">
insert into t_aidea_PdaLog (id, content, create_time)
values (#{id, jdbcType=VARCHAR}, #{content, jdbcType=VARCHAR}, now())
</insert>
<select id="isWriteOff" resultMap="resultMap">
SELECT id,
status
FROM t_aidea_coupon_record
where number = #{number} AND del_flag = 0
</select>
<select id="getHospitalIdByfaNo" resultType="map">
SELECT id
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;
import com.cftech.core.generic.GenericServiceImpl;
import com.cftech.core.sql.Conds;
import com.google.zxing.WriterException;
import javafx.scene.control.TableColumn;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
......@@ -57,7 +56,7 @@ public class CouponrecordServiceImpl extends GenericServiceImpl<Couponrecord> im
//卡券基础信息
Checkcoupon checkcoupon = this.findCheckCoupon();
List<Couponrecord> couponrecordList = findCouponrecordBySort(null);
List<Couponrecord> couponrecordList = findCouponrecordBySort(null, openid);
int number = 0;
......@@ -85,7 +84,7 @@ public class CouponrecordServiceImpl extends GenericServiceImpl<Couponrecord> im
if (number >= 6) {//赠送第二张
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.setNumber(no);
......@@ -103,7 +102,7 @@ public class CouponrecordServiceImpl extends GenericServiceImpl<Couponrecord> im
couponrecordMapper.save(couponrecord);
}
} else {
Couponrecord couponrecordMax = findCouponrecordBySort("1").get(0);
Couponrecord couponrecordMax = findCouponrecordBySort("1", openid).get(0);
if (couponrecordMax.getType().equals("2")) {//获取第二张结束时间购买数量
number = buyingMedicineNumber(openid, couponrecordMax.getTakeEffectDate());//获取最后一张券购买数量
......@@ -126,7 +125,7 @@ public class CouponrecordServiceImpl extends GenericServiceImpl<Couponrecord> im
}
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());
Couponrecord couponrecord = new Couponrecord();
......@@ -145,13 +144,13 @@ public class CouponrecordServiceImpl extends GenericServiceImpl<Couponrecord> im
couponrecordMapper.save(couponrecord);
}
} 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());//获取最后一张券购买数量
//通过第一张最后购买数量,所以只需赠送第二章
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());
......@@ -205,11 +204,13 @@ public class CouponrecordServiceImpl extends GenericServiceImpl<Couponrecord> im
* @param type 1:第一张;2:第二张
* @return
*/
public List<Couponrecord> findCouponrecordBySort(String type) {
public List<Couponrecord> findCouponrecordBySort(String type, String openid) {
Conds conds = new Conds();
conds.equal("t.del_flag", Constants.DEL_FLAG_0);
if (StringUtils.isNoneBlank(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);
Map<String, Object> params = new HashMap<>();
params.put("conds", conds);
......
......@@ -28,6 +28,9 @@
<result column="number" property="number"/>
<result column="invoice_code" property="invoiceCode"/>
<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"/>
</resultMap>
......@@ -51,6 +54,9 @@
<result column="invoiceCreateTime" property="invoiceCreateTime"/>
<result column="invoice_code" property="invoiceCode"/>
<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>
<sql id="sqlWhere">
......@@ -105,7 +111,10 @@
operator,
open_id,
invoice_code,
invoice_num
invoice_num,
order_amount,
image_url,
pdf_url
</sql>
......@@ -141,7 +150,10 @@
#{operator, jdbcType=VARCHAR},
#{openId, jdbcType=VARCHAR},
#{invoiceCode, jdbcType=VARCHAR},
#{invoiceNum, jdbcType=VARCHAR}
#{invoiceNum, jdbcType=VARCHAR},
#{orderAmount, jdbcType=VARCHAR},
#{imageUrl, jdbcType=VARCHAR},
#{pdfUrl, jdbcType=VARCHAR}
)
</insert>
......@@ -185,6 +197,9 @@
t.open_id,
t.invoice_code,
t.invoice_num,
t.order_amount,
t.image_url,
t.pdf_url,
f.store aliasName
FROM t_aidea_invoice t
LEFT JOIN wx_mp_fanss f ON t.open_id = f.openid AND f. delflag = '0'
......@@ -213,7 +228,10 @@
i.`status` invoiceStatus,
i.create_time invoiceCreateTime,
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
t_order o
LEFT JOIN t_order_details d ON d.order_id = o.id
......@@ -299,13 +317,22 @@
invoice_code = #{invoiceCode,jdbcType=VARCHAR},
</if>
<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>
</set>
where id=#{id,jdbcType=BIGINT}
</update>
<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>
</mapper>
\ No newline at end of file
......@@ -85,6 +85,16 @@ public class Invoice implements Serializable {
//发票号码
private String invoiceNum;
//含税金额
private String orderAmount;
//图片路径
private String imageUrl;
//pdf路径
private String pdfUrl;
//别名
private String aliasName;
public Invoice() {
......
......@@ -132,6 +132,9 @@ public class InvoiceServiceImpl extends GenericServiceImpl<Invoice> implements I
if (invoice.getInvoiceSerialNum().equals(invoiceObj.getString("serialNo")) && invoiceObj.getString("status").equals("2")) {
invoice.setInvoiceCode(invoiceObj.getString("invoiceCode"));
invoice.setInvoiceNum(invoiceObj.getString("invoiceNo"));
invoice.setOrderAmount(invoiceObj.getString("orderAmount"));
invoice.setImageUrl(invoiceObj.getString("pictureUrl"));
invoice.setPdfUrl(invoiceObj.getString("pdfUrl"));
invoice.setDescription(result);
invoiceMapper.update(invoice);
} else if (invoice.getInvoiceSerialNum().equals(invoiceObj.getString("serialNo")) && !invoiceObj.getString("status").equals("2")) {
......
......@@ -57,7 +57,19 @@ public class InvoiceHttpUtil {
String method = SystemConfig.p.getProperty("INVOICE_SEND_EMAIL_API");
NNOpenSDK sdk = NNOpenSDK.getIntance();
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;
}
}
package com.cftech.invoice.web;
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.service.InvoiceService;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.apache.bcel.classfile.Constant;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -51,4 +55,18 @@ public class MobileInvoiceController {
public JSONObject sendEmail(@RequestParam String appId, @RequestParam String invoiceId, @RequestParam String openId, @RequestParam String 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 @@
<div class="box">
<div class="box-header">
<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">
<button type="button" class="search btn btn-primary">搜索</button>
#if($shiro.hasPermission("qy:msgrecord:edit"))
......@@ -92,10 +111,11 @@
<thead>
<tr>
<td hidden="true">Id</td>
<th width="15%">发送人</th>
<th width="15%">消息类型</th>
<th width="40%">消息内容</th>
<th width="15%">发送时间</th>
<th width="12%">发送人</th>
<th width="12%">接收人</th>
<th width="12%">消息类型</th>
<th width="35%">消息内容</th>
<th width="14%">发送时间</th>
<th width="15%">创建时间</th>
<!--<th>操作</th>-->
</tr>
......@@ -139,6 +159,10 @@
<script type="text/javascript"
src="plugins/jquery-validation/js/jquery.validate.min.js"></script>
<!-- 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>
function formatDates(now) {
......@@ -161,7 +185,7 @@
}
var retrieveData = function (sSource, aoData, fnCallback) {
$("#seachTableForm input").each(function () {
$("#seachTableForm select,input").each(function () {
var params = {
name: $(this).attr("name"),
value: $(this).val()
......@@ -196,6 +220,9 @@
{
"mData": "tofromName"
},
{
"mData": "tolistName"
},
{
"mData": "msgType"
},
......@@ -214,8 +241,8 @@
'targets': [0]
},
{
"aTargets": [2],
"mData": "createTime",
"aTargets": [3],
"mData": "msgType",
"mRender": function (a, b, c, d) {
if (a == 'text') {
return '文本';
......@@ -234,7 +261,7 @@
}
},
{
"aTargets": [3],
"aTargets": [4],
"mData": "content",
"mRender": function (a, b, c, d) {
if (c.msgType == 'text') {
......@@ -251,14 +278,14 @@
}
},
{
"aTargets": [4],
"aTargets": [5],
"mData": "msgtime",
"mRender": function (a, b, c, d) {
return formatDates(a, "yyyy-MM-dd HH:mm:ss");
}
},
{
"aTargets": [5],
"aTargets": [6],
"mData": "createTime",
"mRender": function (a, b, c, d) {
return formatDates(a, "yyyy-MM-dd HH:mm:ss");
......@@ -283,6 +310,9 @@
$('.search').click(function () {
$("#table").dataTable().fnClearTable();
});
//搜索选择框联动加载
initSelectEleChangeEvent();
});
Cfapp.init();
......@@ -310,13 +340,14 @@
},
error: function () {
}
})
});
},
cancel: function () {
$(".modal-backdrop").fadeOut();
}
});
}
function importExcel() {
var templateExcelUrl = "#springUrl('/a/msgrecord/templateExcel')";
var importExcelUrl = "#springUrl('/a/msgrecord/importExcel')";
......@@ -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>
......
package com.cftech.msgrecord.dao;
import com.cftech.msgrecord.model.ExternalContactDto;
import com.cftech.msgrecord.model.Msgrecord;
import com.cftech.core.generic.GenericDao;
import java.util.List;
import java.util.Map;
/**
* 聊天记录Mapper
*
......@@ -11,4 +15,32 @@ import com.cftech.core.generic.GenericDao;
*/
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 @@
<result column="description" property="description"/>
<result column="create_by" property="createBy"/>
<result column="update_by" property="updateBy"/>
<result column="tofromName" property="tofromName"/>
<result column="tofrom_name" property="tofromName"/>
<result column="tolist_name" property="tolistName"/>
</resultMap>
<sql id="sqlWhere">
......@@ -70,6 +71,8 @@
create_time,
update_time,
description,
tofrom_name,
tolist_name,
create_by,
update_by
</sql>
......@@ -100,6 +103,8 @@
now(),
now(),
#{description, jdbcType=VARCHAR},
#{tofromName, jdbcType=VARCHAR},
#{tolistName, jdbcType=VARCHAR},
#{createBy, jdbcType=BIGINT},
#{updateBy, jdbcType=BIGINT}
)
......@@ -114,10 +119,7 @@
<select id="count" parameterType="java.util.Map" resultType="java.lang.Integer">
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"/>
</select>
<select id="fetchSearchByPage" parameterType="java.util.Map" resultType="com.cftech.msgrecord.model.Msgrecord">
......@@ -141,17 +143,54 @@
t.description,
t.create_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)
WHEN q.name IS NOT NULL THEN q.name
ELSE t.tofrom END tofromName
t.tofrom_name,
t.tolist_name
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
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"/>
<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="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 t_aidea_msg_record
<set>
......@@ -203,6 +242,12 @@
<if test="description != null">
description = #{description, jdbcType=VARCHAR},
</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">
create_by = #{createBy, jdbcType=BIGINT},
</if>
......@@ -216,4 +261,84 @@
<update id="delete" parameterType="java.lang.Long">
update t_aidea_msg_record set del_flag=1 where id=#{id,jdbcType=BIGINT}
</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>
\ No newline at end of file
......@@ -220,7 +220,7 @@ public class SynWechatMsg implements Job {
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 {
//大于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 {
private String tofromName;
private String tolistName;
/**
* 查询字段
*/
private String sender;
private String receiver;
public Msgrecord() {
this.delFlag = false;
this.status = "0";
......
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.core.generic.GenericService;
import java.util.List;
import java.util.Map;
/**
* 聊天记录Service
*
* @author Strive
* @date: 2021-01-05 15:28
*/
* 聊天记录Service
*
* @author Strive
* @date: 2021-01-05 15:28
*/
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;
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.dao.MsgrecordMapper;
import com.cftech.msgrecord.service.MsgrecordService;
import com.cftech.core.generic.GenericDao;
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.Qualifier;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 聊天记录ServiceImpl
*
* @author Strive
* @date: 2021-01-05 15:28
*/
* 聊天记录ServiceImpl
*
* @author Strive
* @date: 2021-01-05 15:28
*/
@Service("msgrecordService")
public class MsgrecordServiceImpl extends GenericServiceImpl<Msgrecord> implements MsgrecordService {
@Autowired
@Qualifier("msgrecordMapper")
private MsgrecordMapper msgrecordMapper;
@Autowired
@Qualifier("msgrecordMapper")
private MsgrecordMapper msgrecordMapper;
@Override
public GenericDao<Msgrecord> getGenericMapper() {
return 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
public List<Msgrecord> fetchSearchByPageByField(Conds conds, Sort sort, int page, int pageSize, String sender, String receiver) {
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;
import com.alibaba.fastjson.JSONObject;
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.service.MsgrecordService;
import com.cftech.core.poi.ExcelKit;
......@@ -20,6 +22,7 @@ import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.util.StringUtils;
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.multipart.MultipartFile;
......@@ -58,13 +61,19 @@ public class MsgrecordController {
private MsgrecordService msgrecordService;
@Autowired
private JobService jobService;
private QyuserService qyuserService;
//列表页面
@RequiresPermissions(value = MSGRECORD_VIEW)
@RequestMapping("/list")
public String list(HttpServletRequest request, Model model) {
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);
return "msgrecord/msgrecordlist";
}
......@@ -117,9 +126,14 @@ public class MsgrecordController {
conds.equal("t.del_flag", Constants.DEL_FLAG_0);
conds.equal("t.accounts_id", accountsId);
Sort sort = new Sort("t.create_time", OrderType.DESC);
List<Msgrecord> list = msgrecordService.fetchSearchByPage(conds, sort, iDisplayStart, iDisplayLength);
Integer counts = msgrecordService.count(conds);
if (!StringUtils.isEmpty(msgrecord.getSender()) && StringUtils.isEmpty(msgrecord.getReceiver())) {
conds.equal("t.tofrom", msgrecord.getSender());
} 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();
rtnJson.put("iTotalRecords", counts);
rtnJson.put("iTotalDisplayRecords", counts);
......@@ -192,4 +206,18 @@ public class MsgrecordController {
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;
import com.cftech.core.generic.GenericDao;
import com.cftech.orderdetail.model.OrderSplitBatchDto;
import java.util.List;
import java.util.Map;
/**
......@@ -27,4 +28,11 @@ public interface OrderDetailsMapper extends GenericDao<OrderDetails> {
* @return
*/
Long saveDrugBatchNo(OrderSplitBatchDto orderSplitBatchDto);
/**
* 查询订单批次明细
* @param params
* @return
*/
List<OrderSplitBatchDto> fetchSearchByBatchDrug(Map<String, Object> params);
}
\ No newline at end of file
......@@ -135,10 +135,18 @@
</select>
<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
IFNULL(SUM(d.drugs_num), 0)
FROM t_order_details d
LEFT JOIN t_order o ON o.id = d.order_id
IFNULL(SUM(t.remind_type), 0)
FROM t_order t
<include refid="sqlWhere"/>
</select>
......@@ -256,4 +264,31 @@
#{drugsName, jdbcType=VARCHAR}
)
</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>
\ No newline at end of file
......@@ -7,6 +7,7 @@ import com.cftech.core.generic.GenericService;
import com.cftech.orderdetail.model.OrderSplitBatchDto;
import java.util.List;
import java.util.Map;
/**
* 订单管理Service
......@@ -39,4 +40,11 @@ public interface OrderDetailsService extends GenericService<OrderDetails> {
* @return
*/
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
public Long saveDrugBatchNo(OrderSplitBatchDto 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 @@
name="courierNumber" placeholder="顺丰运单号">
</div>
<div class="col-xs-2">
<input type="text" class="form-control"
name="fansAlias" placeholder="别名">
</div>
<div class="col-xs-2">
<select id="startOrderAmount" name="startOrderAmount" class="form-control required">
<option value="">请选择订单金额</option>
......@@ -197,29 +202,11 @@
</select>
</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">
<select id="status" name="status" class="form-control required">
<option value="">请选择订单状态</option>
<option value="0" selected>待确认</option>
<option value="-1">请选择订单状态</option>
<option value="all">全部</option>
<option value="0">待确认</option>
<option value="1">待付款</option>
<option value="2">待发货</option>
<option value="3">待收货</option>
......@@ -228,6 +215,14 @@
</select>
</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">
<select id="isBill" name="isBill" class="form-control required">
<option value="">请选择是否开票</option>
......@@ -290,6 +285,7 @@
<!--<th>支付交易号</th>-->
<th>是否开票</th>
<th>三期患者</th>
<th>是否购药</th>
<th>创建时间</th>
<!-- <th>确认时间</th>-->
<!-- <th>付款时间</th>-->
......@@ -430,7 +426,7 @@
"mData": "consultCode"
},
{
"mData": "productName"
"mData": "commonName"
},
{
"mData": "orderAmount"
......@@ -473,6 +469,10 @@
"mData": "isThree"
}
,
{
"mData": "isSales"
}
,
{
"mData": "createTime"
}
......@@ -669,6 +669,19 @@
,
{
"aTargets": [12],
"mData": "isSales",
"mRender": function (a, b, c, d) {
console.log(a);
if (a == '4') {
return '是';
} else {
return '否';
}
}
}
,
{
"aTargets": [13],
"mData": "createTime",
"mRender": function (a, b, c, d) {
let time = formatDates(a);
......@@ -732,7 +745,7 @@
// }
//,
{
"aTargets": [13],
"aTargets": [14],
"mData": "id",
"mRender": function (a, b, c, d) {
var html = '#if($shiro.hasPermission("qy:order:edit"))';
......
......@@ -519,7 +519,10 @@
// html += '<li><a onclick="showModal(' + a + ')">订单关闭</a></li>';
// }
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 += '#end';
......
......@@ -68,6 +68,7 @@
<result column="drugs_num" property="drugsNum"/>
<result column="product_number" property="productNumber"/>
<result column="product_name" property="productName"/>
<result column="common_name" property="commonName"/>
<result column="address_id" property="addressId"/>
<result column="courier_number" property="courierNumber"/>
<result column="address_des" property="addressDes"/>
......@@ -87,6 +88,7 @@
<result column="takeFrequency" property="takeFrequency"/>
<result column="fansAlias" property="fansAlias"/>
<result column="isThree" property="isThree"/>
<result column="isSales" property="isSales"/>
<collection property="list" ofType="com.cftech.order.model.ProductVO">
<result column="product_name" property="productName"/>
</collection>
......@@ -263,11 +265,14 @@
o.cancel_time cancelTime,
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,
o.pay_time payTime
o.pay_time payTime,
qyu.name storageManageName
from
t_order o
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 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 b ON s.city_id = b.areaid
LEFT JOIN area c ON s.area_id = c.areaid
......@@ -301,9 +306,33 @@
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_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"/>
<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 id="fetchSearchByPage" parameterType="java.util.Map" resultMap="resultMapList">
......@@ -347,7 +376,8 @@
f.store fansAlias,
au.status isThree,
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
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
......@@ -568,7 +598,7 @@
pay_time = now(), pay_amount = order_amount * 100,
</if>
<if test="status != null and status == 5 and orderCancel!=null and orderCancel != ''">
cancel_time = now(),
cancel_time = now(), remind_type = null,
</if>
<if test="orderCancel!=null and orderCancel != ''">
order_cancel = #{orderCancel}
......@@ -597,11 +627,14 @@
c.areaname AS area,
s.phone,
s.address,
t.confirm
t.confirm,
f.nickname,
f.sex
FROM
t_order t
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 wx_mp_fanss f ON f.openid = t.openid
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 b ON s.city_id = b.areaid
......@@ -639,7 +672,8 @@
p.is_rs AS isrs,
p.product_img AS productImg,
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
WHERE t.del_flag = 0
<if test="orderId!=null">
......
......@@ -7,4 +7,8 @@ public class DrugVo {
private String drugs;
private String orderId;
private String pageType;
}
......@@ -36,7 +36,7 @@ public class Order extends OrderDetail implements Serializable {
@ExportConfig(value = "订单金额", width = 100, showLevel = 1)
private Double orderAmount;
/* 商品最终金额 */
@ExportConfig(value = "商品最终金额", width = 100, showLevel = 1)
@ExportConfig(value = "订单原价", width = 100, showLevel = 1)
private Double totalAmount;
/* 付款时间 */
@ExportConfig(value = "付款时间", width = 100, showLevel = 1)
......@@ -166,6 +166,8 @@ public class Order extends OrderDetail implements Serializable {
private String fansAlias;//粉丝别名
private String isThree;//是否三期用户
private String payUrl;//支付链接
private String commonName;//产品全名称
private String isSales;//是否购买
public Order() {
......@@ -596,4 +598,20 @@ public class Order extends OrderDetail implements Serializable {
public void setIsFirst(boolean 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 {
private String sendExpressDateStr;
private String acceptExpressDateStr;
private String payTime;
private String storageManageName;
}
......@@ -54,6 +54,10 @@ public class OrderMobile {
private long time;
private String nickname;
private String sex;
private List<ProductMobile> ProductMobile;
}
......@@ -19,8 +19,10 @@ public class ProductMobile {
private String productImg;
/*商品规格*/
private String format;
/*商品规格*/
/*商品数量*/
private Long drugsNum;
/*商品单位*/
private String unit;
}
......@@ -111,10 +111,10 @@ public class WechatPayUtils {
params.put("sign", sign);
String xmlObj = parseXML(params);
System.out.print(xmlObj);
log.info("商户号请求参数="+xmlObj + "===========end");
try {
String result = sendPost(HttpClients.createDefault(), "https://api.mch.weixin.qq.com/pay/unifiedorder", xmlObj);
log.info("商户号订单:" + result);
log.info("商户号订单:" + result + "===========end");
return xmlToStr(result);
} catch (IOException e) {
e.printStackTrace();
......
......@@ -169,7 +169,7 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
Order order = this.fetchSearchByConds(orderConds);
//当前订单所购艾邦德数量,金额
String drugsId = SystemConfig.p.getProperty("THREE_GRUGS_ID");
String drugsId = SystemConfig.p.getProperty("THREE_DRUGS_ID");
Long drugNum = 0L;
Double price = null;
......@@ -204,6 +204,7 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
orderDetailDto.setAccountsId(accountsId);
this.saveDetill(orderDetailDto);
//获取艾邦德药品
if (Long.parseLong(drugsId) == obj.getLong("productId")) {
drugNum = obj.getLong("drugsNum");
price = obj.getDouble("price");
......@@ -217,14 +218,23 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
return rtnJson;
}
//获取商户号订单内容
//订单金额为0,不调用商户号
if ((new BigDecimal(order.getOrderAmount()).compareTo(new BigDecimal(0))) == 0) {
order.setStatus("1");
order.setOrderTime(new Date());
boolean bool = update(order);
if (bool) {
rtnJson.put("errorNo", "0");
rtnJson.put("errorMsg", "确认成功!");
return rtnJson;
}
} else {//获取商户号订单内容
JSONObject mchObj = WechatPayUtils.genenatePay(order);
if (mchObj != null) {
order.setStatus("1");
order.setOrderTime(new Date());
order.setOrderAmount(orderAmount);
order.setRemarks(mchObj.toString());
boolean bool = this.update(order);
boolean bool = update(order);
if (bool) {
rtnJson.put("errorNo", "0");
rtnJson.put("errorMsg", "确认成功!");
......@@ -234,6 +244,7 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
//商户号调用失败抛出异常回滚
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
}
}
rtnJson.put("errorNo", "1");
return rtnJson;
......@@ -251,16 +262,15 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
BigDecimal nums = null;//折扣数量
//三期用户
Conds conds = new Conds();
conds.equal("d.del_flag", Constants.DEL_FLAG_0);
conds.equal("o.del_flag", Constants.DEL_FLAG_0);
conds.equal("d.openid", order.getOpenid());
conds.equal("o.openid", order.getOpenid());
conds.equal("YEAR(d.create_time)", new Date().getYear());
conds.equal("d.drugs_id", SystemConfig.p.getProperty("THREE_GRUGS_ID"));
conds.notEqual("d.order_id", order.getId());
conds.equal("t.del_flag", Constants.DEL_FLAG_0);
conds.equal("t.openid", order.getOpenid());
Calendar cal = Calendar.getInstance();
int year = cal.get(Calendar.YEAR);
conds.equal("YEAR(t.create_time)", year);
Integer number = orderDetailsService.fetchMemberByYearGoodsNum(conds);//已购药品数据
if (number >= 12) {
order.setOrderAmount(orderAmount);
order.setTotalAmount(orderAmount * 100);//订单原价
order.setOrderAmount(orderAmount);//实际需支付价格
} else {
int realNum = (12 - number);//剩余每年免费盒数
if (num.intValue() < realNum) {
......@@ -271,11 +281,14 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
BigDecimal saleAmount = unitP.multiply(nums);//三期患者折扣价格
BigDecimal sumAmount = new BigDecimal(orderAmount);//订单总价
BigDecimal realAmount = sumAmount.subtract(saleAmount);//实际需支付价格
order.setOrderAmount(realAmount.doubleValue());
order.setTotalAmount(sumAmount.doubleValue() * 100);//订单原价
order.setOrderAmount(realAmount.doubleValue());//实际需支付价格
order.setRemindType(nums.toString());//三期患者本单免费数量
}
} else {
//非三期用户
order.setOrderAmount(orderAmount);
order.setTotalAmount(orderAmount * 100);//订单原价
order.setOrderAmount(orderAmount);//实际需支付价格
}
}
......@@ -422,7 +435,7 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
Conds conds = new Conds();
conds.equal("o.id", invoiceDto.getId());
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) {
for (Order order : list) {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
......
......@@ -22,6 +22,8 @@ import com.cftech.core.sql.Sort;
import com.cftech.core.util.Constants;
import com.cftech.order.utils.DoubleJSONFilter;
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.sys.model.User;
import com.cftech.sys.model.UserRole;
......@@ -46,6 +48,7 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.IOException;
import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
......@@ -103,6 +106,9 @@ public class OrderController {
@Autowired
private RoleService roleService;
@Autowired
private OrderDetailsService orderDetailsService;
//列表页面
@RequiresPermissions(value = ORDER_VIEW)
@RequestMapping("/list")
......@@ -173,7 +179,7 @@ public class OrderController {
//订单出货页面
@RequiresPermissions(value = ORDER_VIEW)
@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)) {
OrderFromVO orderFromVO = orderService.fetchId(id);
List<OrderFromVO> fromVO = orderService.fetchProductId(id);
......@@ -182,6 +188,7 @@ public class OrderController {
model.addAttribute("data", jsonObject);
model.addAttribute("list", jsonArray);
}
model.addAttribute("pageType", StringUtils.equals(pageType, "View") ? true : false);
return "order/orderSendOut";
}
......@@ -258,28 +265,27 @@ public class OrderController {
if (StringUtils.isNoneBlank(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.isNoneBlank(order.getStatus())) {
if (StringUtils.equals("-1", order.getStatus())) {
conds.in("o.status", new String[]{"0", "1"});
} else if (StringUtils.isNoneBlank(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")) {//未开票
conds.isNull("o.confirm");
......@@ -335,9 +341,14 @@ public class OrderController {
conds.in("o.id", id.split(","));
conds.equal("o.del_flag", Constants.DEL_FLAG_0);
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) {
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");
order.setCreateTimeStr(format.format(order.getCreateTime()));
String str = invoiceUtil.startInvoice(order, String.valueOf(userid), email, "0", "1", null, null);
......@@ -434,22 +445,6 @@ public class OrderController {
if (StringUtils.isNoneBlank(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())) {
conds.equal("o.status", order.getStatus());
......@@ -653,6 +648,26 @@ public class OrderController {
return rtnJson;
}
if (StringUtils.isNoneBlank(drugVo.getOrderId()) && StringUtils.equals(drugVo.getPageType(), "true")) {
Conds conds = new Conds();
conds.equal("t.del_flag", Constants.DEL_FLAG_0);
conds.equal("t.order_id", drugVo.getOrderId());
List<OrderSplitBatchDto> dtos = orderDetailsService.fetchSearchByBatchDrug(conds, null, 0, 0);
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.put("drugId", orderSplitBatchDto.getDrugsId());
map.put("drugCode", orderSplitBatchDto.getDrugsCode());
map.put("drugName", orderSplitBatchDto.getDrugsName());
map.put("num", 1);
map.put("batchNO", orderSplitBatchDto.getDrugsBatchNo());
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);
......@@ -660,6 +675,7 @@ public class OrderController {
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);
......@@ -668,9 +684,10 @@ public class OrderController {
}
}
rtnJson.put("iTotalRecords", 100);
rtnJson.put("iTotalDisplayRecords", 100);
rtnJson.put("iTotalRecords", 0);
rtnJson.put("iTotalDisplayRecords", 0);
rtnJson.put("aaData", list);
}
return rtnJson;
}
}
......@@ -353,13 +353,19 @@
<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"/>
</select>
<select id="fetchSearchByPageOutReport" parameterType="java.util.Map" resultType="com.cftech.report.model.OutStoreReport">
SELECT
sb.id,
cs.consult_id consultCode,
o.number orderCode,
p.common_name drugName,
......
......@@ -8,6 +8,8 @@ import lombok.Data;
@Data
public class OutStoreReport {
private String id;
/* 咨询单编码 */
private String consultCode;
......
......@@ -102,9 +102,9 @@ public class OutStoreReportController {
public JSONObject listData(int iDisplayStart, int iDisplayLength, Report report, HttpServletRequest request,String startPayTime,String endPayTime) {
Long accountsId = UserUtils.getmpaccounts(request);
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);
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);
......
......@@ -47,11 +47,121 @@
<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>
<![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>
<!-- END HEAD -->
<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;">
<section class="content-header">
......@@ -228,6 +338,7 @@
<div class="box-footer">
#if($shiro.hasPermission("qy:waybill:edit"))
<input class="btn btn-primary" id="save" value="保存" type="submit">
<input class="btn btn-primary" value="打印随行单" id="printSheet">
#end
<a href="#springUrl('/a/waybill/list')" class="btn btn-default">取消</a>
</div>
......@@ -268,14 +379,24 @@
<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.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>
$().ready(function () {
Cfapp.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 () {
......@@ -337,6 +458,9 @@
};
}();
</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>
<!-- END BODY -->
</html>
\ No newline at end of file
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.core.generic.GenericDao;
import java.util.List;
/**
* 顺丰物流运单Mapper
*
......@@ -17,4 +21,18 @@ public interface WaybillMapper extends GenericDao<Waybill> {
* @return
*/
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 @@
<update id="delete" parameterType="java.lang.Long">
update t_aidea_waybill set del_flag=1 where id=#{id,jdbcType=BIGINT}
</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>
\ 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;
import com.alibaba.fastjson.JSONObject;
import com.cftech.waybill.model.FollowPrinter;
import com.cftech.waybill.model.Waybill;
import com.cftech.core.generic.GenericService;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
/**
* 顺丰物流运单Service
......@@ -34,4 +36,11 @@ public interface WaybillService extends GenericService<Waybill> {
* @return
*/
JSONObject orderPrinterBill(HttpServletRequest request, Long orderId);
/**
* 获取打印随行单实体
* @param orderId
* @return
*/
FollowPrinter findFollowPrinterData(Long orderId);
}
......@@ -15,6 +15,8 @@ import com.cftech.orderdetail.model.OrderSplitBatchDto;
import com.cftech.orderdetail.service.OrderDetailsService;
import com.cftech.sys.model.User;
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.dao.WaybillMapper;
import com.cftech.waybill.service.WaybillService;
......@@ -194,6 +196,7 @@ public class WaybillServiceImpl extends GenericServiceImpl<Waybill> implements W
orderSplitBatchDto.setOrderId(order.getId());
orderSplitBatchDto.setOrderCode(order.getNumber());
orderSplitBatchDto.setDrugsBatchNo(drugs.getString("batchNo"));
orderSplitBatchDto.setDrugsId(drugs.getLong("drugId"));
orderSplitBatchDto.setDrugsName(drugs.getString("drugName"));
orderSplitBatchDto.setDrugsCode(drugs.getString("drugCode"));
orderSplitBatchDto.setDrugsNum(drugs.getLong("num"));
......@@ -312,5 +315,16 @@ public class WaybillServiceImpl extends GenericServiceImpl<Waybill> implements W
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;
import com.cftech.order.service.OrderService;
import com.cftech.orderdetail.model.OrderDetails;
import com.cftech.orderdetail.service.OrderDetailsService;
import com.cftech.waybill.model.FollowPrinter;
import com.cftech.waybill.model.Waybill;
import com.cftech.waybill.service.WaybillService;
import com.cftech.core.poi.ExcelKit;
......@@ -90,6 +91,9 @@ public class WaybillController {
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);
}
return "waybill/waybillform";
......
......@@ -5,12 +5,14 @@ WX_MP_SERVER_APPID=wxc587e8869baec269
WX_MP_QRCODE_URI=https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=
#\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
#\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
#\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
#\u68C0\u6D4B\u7ED3\u679C\u901A\u77E5\u6A21\u677F\u6D88\u606F
CHECK_RESULT_TEMPLATE_MSG=5Fy77DKlvulE4L2vxsQfhOsJuRqQzIoI-LSmDYWCJt0
#\u4F01\u4E1A\u53F7\u914D\u7F6E\u4FE1\u606F
ROOT_ORG_NAME=\u6C5F\u82CF\u827E\u8FEA\u836F\u4E1A
......@@ -55,7 +57,7 @@ THREE_DRUGS_ID=24
#\u56FE\u7247\u8BBF\u95EE\u5730\u5740
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}
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}
......@@ -65,7 +67,7 @@ LOG_URL=http://www.michang-tech.com.cn:6989/log/addlog
#\u6821\u9A8C\u5151\u6362\u5BC6\u7801KEY
MEMBER_PASSWORD_KEY=DONGCHANGINT9527;
list.refreshtoken=true
jwt.domain=localhost
jwt.domain=pd.shxrtech.com
#\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD
jwt.duration=86400000
#\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u03AAtrue
......@@ -82,6 +84,7 @@ sf.checkWord=5Nhuavqk0JG7zTYLtPKq7JpnceuekRcH
sf.monthlyCard=7551234567
#\u8BFA\u8BFA\u5F00\u7968\u914D\u7F6E\u4FE1\u606F\u53C2\u6570
INVOICE_URL=https://sandbox.nuonuocs.cn/open/v1/services
INVOICE_TOKEN=4d02142a23eece11a0407f0sghefntms
SQ_INVOICE_TAX=91321000MA22HQQ953
INVOICE_TAX=339901999999824
......@@ -99,7 +102,8 @@ INVOICE_API=nuonuo.ElectronInvoice.requestBillingNew
INVOICE_QUERY_API=nuonuo.ElectronInvoice.queryInvoiceResult
#\u90AE\u7BB1\u63A8\u9001\u63A5\u53E3
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,
......
......@@ -28,9 +28,9 @@ QY_SEND_APPID=350
#\u4F01\u4E1A\u53F7\u4F1A\u8BDD\u5185\u5BB9\u5B58\u6863
QY_CHAT_WORK=351
#\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
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
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
......@@ -46,9 +46,17 @@ userfiles.imgdir=/mydata/fileResource
#\u4F1A\u8BDD\u5185\u5BB9\u5B58\u6863\u5730\u5740
userfiles.msgdir=/mydata/wechatSdk/
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
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
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}
......@@ -74,6 +82,7 @@ sf.checkWord=ExAMu7ADrjDeUMJCKOAf45Ywgo2q12Sd
sf.monthlyCard=5141870609
#\u8BFA\u8BFA\u5F00\u7968\u914D\u7F6E\u4FE1\u606F\u53C2\u6570
INVOICE_URL=https://sdk.nuonuo.com/open/vi/services
INVOICE_TOKEN=4d02142a23eece11a0407f0jge3cbk0s
#SQ_INVOICE_TAX=91321000MA22HQQ953
INVOICE_TAX=91321000MA22HQQ953
......@@ -91,7 +100,8 @@ INVOICE_API=nuonuo.ElectronInvoice.requestBillingNew
INVOICE_QUERY_API=nuonuo.ElectronInvoice.queryInvoiceResult
#\u90AE\u7BB1\u63A8\u9001\u63A5\u53E3
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,
......@@ -106,3 +116,12 @@ mch.notify_url=https://pe.aidea.com.cn/aidea/mobile/auth/order/wechatCallback
#\u4ED8\u6B3E\u754C\u9762\u6807\u9898
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 @@
<input id="gender" name="gender" value="$!{data.gender}" hidden="true"/>
<input id="isVer" name="isVer" value="$!{data.isVer}" 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="form-group form-md-line-input col-md-4">
<label>所属组织</label>
......@@ -131,19 +135,17 @@
<input type="text"
class="form-control" name="loginNameQyUser" id="loginNameQyUser"
maxlength="50" placeholder="登录账号"
value="$!{data.loginName}">
value="$!{data.loginName}" #if ($!{isView}=='true')
readonly="readonly" #end>
</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">
<label for="passwordQyUser">密码</label>
<input type="password" class="form-control" name="passwordQyUser"
id="passwordQyUser"
placeholder="请输入密码" maxlength="50" minlength="3">
</div>
<div class="form-group form-md-line-input col-md-4">
<label for="email">EMAIL</label>
<input type="text"
......@@ -152,6 +154,14 @@
value="$!{data.email}">
</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">
<label>角色</label>
<select name="userType" class="form-control pull-right">
......@@ -309,7 +319,7 @@
coverPP = new uePicPicker({
tarId: 'img',
title: '客服名片',
sizeDes: '205*202',
sizeDes: '',
max: 1,
datas: smallimg=='' ? null : smallimg.split(","),
success: null
......
......@@ -342,7 +342,7 @@
"mData": "qrcode",
"mRender": function (a, b, c, d) {//a表示对应mData的值,c表示当前记录行对象
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>";
}
......@@ -382,7 +382,7 @@
'<span class="sr-only">Toggle Dropdown</span>\n' +
'</button>\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') {
html += "<li><a href='javascript:bindQrCode(" + a + ", "+ c.userType +")' >绑定二维码</a></li>";
if (c.qrcode != null)
......
......@@ -90,6 +90,7 @@ public class QyUserUtil {
qyuser.setAvatar(userInfo.getString("avatar"));
qyuser.setStatus(userInfo.getString("status"));
qyuser.setWxno(userInfo.getString("weixinid"));
qyuser.setQrcode(userInfo.getString("qr_code"));
}
return qyuser;
}
......@@ -105,45 +106,26 @@ public class QyUserUtil {
departments.add(orgUnit.getWxorgId());
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())) {
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()))
postObj.put("email", qyuser.getEmail());
if (!StringUtils.isEmpty(qyuser.getWxno()))
postObj.put("weixinid", qyuser.getWxno());
if (!StringUtils.isEmpty(qyuser.getPositionId())) {
Position position = positionService.fetchById(qyuser.getPositionId());
if (position != null) {
postObj.put("position", position.getName());
}
}
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);
......@@ -161,44 +143,24 @@ public class QyUserUtil {
departments.add(orgUnit.getWxorgId());
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())) {
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()))
postObj.put("email", qyuser.getEmail());
if (!StringUtils.isEmpty(qyuser.getWxno()))
postObj.put("weixinid", qyuser.getWxno());
Position position = positionService.fetchById(qyuser.getId());
if (!StringUtils.isEmpty(qyuser.getPositionId())) {
Position position = positionService.fetchById(qyuser.getPositionId());
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);
return retObj.getIntValue("errcode") == 0;
......
......@@ -88,7 +88,7 @@ public class QyuserController {
//返回编辑页面(新增、修改)
@RequiresPermissions(value = PermissionSign.QYUSER_VIEW)
@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);
if (!StringUtils.isEmpty(id)) {
Qyuser qyuser = qyuserService.fetchById(id);
......@@ -119,6 +119,7 @@ public class QyuserController {
Sort sort = new Sort("t.create_time", OrderType.DESC);
List<Position> positionList = positionService.fetchSearchByPage(positionConds, sort, 0, 0);
model.addAttribute("positions", positionList);
model.addAttribute("isView", com.cftech.core.util.StringUtils.equals(pageType, "Edit") ? true : false);
return "managerqyuser/qyuseradd";
}
......
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